Interface TextStylePropsPart

interface TextStylePropsPart {
    align?: TextAlign;
    backgroundColor?: string | {
        image: string | ImageLike;
    };
    borderColor?: string;
    borderDash?: false | number[];
    borderDashOffset?: number;
    borderRadius?: number | number[];
    borderWidth?: number;
    fill?: string;
    fillOpacity?: number;
    font?: string;
    fontFamily?: string;
    fontSize?: string | number;
    fontStyle?: FontStyle;
    fontWeight?: FontWeight;
    height?: number;
    lineDash?: false | number[];
    lineDashOffset?: number;
    lineHeight?: number;
    lineWidth?: number;
    margin?: number;
    opacity?: number;
    padding?: number | number[];
    shadowBlur?: number;
    shadowColor?: string;
    shadowOffsetX?: number;
    shadowOffsetY?: number;
    stroke?: string;
    strokeNoScale?: boolean;
    strokeOpacity?: number;
    tag?: string;
    text?: string;
    textFont?: string;
    textShadowBlur?: number;
    textShadowColor?: string;
    textShadowOffsetX?: number;
    textShadowOffsetY?: number;
    verticalAlign?: TextVerticalAlign;
    width?: string | number;
}

Hierarchy (view full)

Properties

align?: TextAlign
backgroundColor?: string | {
    image: string | ImageLike;
}

Type declaration

  • image: string | ImageLike
borderColor?: string
borderDash?: false | number[]
borderDashOffset?: number
borderRadius?: number | number[]
borderWidth?: number
fill?: string
fillOpacity?: number
font?: string

If fontSize or fontFamily exists, font will be reset by fontSize, fontStyle, fontWeight, fontFamily. So do not visit it directly in upper application (like ), but use contain/text#makeFont instead.

fontFamily?: string

It helps merging respectively, rather than parsing an entire font string.

fontSize?: string | number

It helps merging respectively, rather than parsing an entire font string. Should be 12 but not '12px'.

fontStyle?: FontStyle

It helps merging respectively, rather than parsing an entire font string.

fontWeight?: FontWeight

It helps merging respectively, rather than parsing an entire font string.

height?: number

Height of text block. Not include padding Used for background, truncate

lineDash?: false | number[]
lineDashOffset?: number
lineHeight?: number

Line height. Default to be text height of '国'

lineWidth?: number

textStroke may be set as some color as a default value in upper applicaion, where the default value of lineWidth should be 0 to make sure that user can choose to do not use text stroke.

margin?: number

Margin of label. Used when layouting the label.

opacity?: number
padding?: number | number[]

Can be 2 or [2, 4] or [2, 3, 4, 5]

shadowBlur?: number

Shadow blur for background box.

shadowColor?: string

Shadow color for background box.

shadowOffsetX?: number

Shadow offset x for background box.

shadowOffsetY?: number

Shadow offset y for background box.

stroke?: string
strokeNoScale?: boolean
strokeOpacity?: number
tag?: string

Reserved for special functinality, like 'hr'.

text?: string
textFont?: string

The same as font. Use font please.

Deprecated

textShadowBlur?: number
textShadowColor?: string
textShadowOffsetX?: number
textShadowOffsetY?: number
verticalAlign?: TextVerticalAlign
width?: string | number

Width of text block. Not include padding Used for background, truncate, wrap