Added in Version 1.6.0

TextWidthParameter

Parameters for setting the number of characters to print for text printing

Constructor

TextWidthParameter()

Initialize object

Property

widthType

Width type of a character when setting the number of characters to print

TextWidthType

alignment

Alignment of the text if it fits into the specified number of characters to be printed. It is ignored if the length of text is longer than the number of characters to print.

TextAlignment

ellipsizeType

Ellipsize type if the text exceeds the number of characters to print. It is ignored if the text does not exceed the number of characters to print.

TextEllipsizeType

printType

Print type of text when setting the number of characters to print. If the text is blank, select whether or not to print white space characters for the specified number of characters to print.

TextPrintType

Method

setWidthType(widthType: TextWidthType)

Set the width type of a character when setting the number of characters to print

setAlignment(alignment: TextAlignment)

Set the Alignment of the text if it fits into the specified number of characters to be printed

setEllipsizeType(ellipsizeType: TextEllipsizeType)

Set the ellipsize type if the text exceeds the number of characters to print

setPrintType(printType: TextPrintType)

Set the print type of text when setting the number of characters to print

Note

  • If the character spacing is set to 0 (default setting or when width is set to 0 using the styleCharacterSpace method), the ratio is the width of half-width character : the width of full-width character width = 1 : 2. This ratio will not be the same value if the character spacing is set to a value other than 0 or if the font is set to B. When printing a mixture of half-width and full-width characters, please check the actual printing results before deciding the number of characters to print.

  • This API cannot be used for Thai fonts because they the number of characters of them cannot be calcurated correctly.

  • Printing image

    ../../../../_images/text_width_parameter.png