text

How to write by SpWML

// default
(text)For main text.
(menu)Text without a top margin, used for menus, etc.

// material V3
(displayL)App name, page title, article heading, etc.
(displayM)Section headings, card titles, button labels, etc.
(displayS)Metadata, footnotes, captions, etc.
(headlineL)App name, page title, article heading, etc.
(headlineM)Section headings, card titles, button labels, etc.
(headlineS)Metadata, footnotes, captions, etc.
(titleL)List items, card titles, form labels, etc.
(titleM)Subtitles, descriptions, and button labels, etc.
(titleS)Metadata, footnotes, captions, etc.
(labelL)Form labels, button labels, menu items, etc.
(labelM)Form labels, button labels, menu items, etc.
(labelS)Additional information, tips, and error messages
(bodyL)Article text, blog posts, books, etc.
(bodyM)Product descriptions, reviews, text on settings screens, etc.
(bodyS)Captions, annotations, metadata, etc.

// material V2
(h1)The header text
(h2)The header text
(h3)The header text
(h4)The header text
(h5)The header text
(h6)The header text
(subtitle1)For subtitles.
(subtitle2)For subtitles.
(body1)For main text.
(body2)For main text.
(caption)For captions.
(overline)Used for text etc. at the top of the line element.

Summary

A block that contains text elements without a child block.

There are many variations in size and format.

Also, By default text is the same parameter as body1, and menu is almost the same as body1, but with selection disabled and a different lineHeight.

It has a variable with equivalent parameters of Flutter’s Text class and SelectableText class .


Dart Class Reference

TextElement class


SpWML Parameters

  • The common parameters.

  • isSelectable(bool). If true, the text can be selected.The initial value is true except for menu.

  • fontFamily(String). This is the name of the font to be used. To change the font, settings must be made on the Flutter project side. Only the fonts set in the project can be loaded.

  • fontSize(double). Specifies the font size in px.

  • fontWeight(String). The weight of the font.Specify one of normal, regular, bold, thin, light, medium, black, w100 to w900.

  • fontStyle(String). This is the font style setting.Specify either normal or italic.

  • textColor(String?). Color setting. The color system .

  • textBGColor(String). Text Background Color setting. The color system .

  • textDeco(String). Specify decoration such as underline.Specify one of none, underline, overline, lineThrough.

  • textDecoStyle(String).Decoration style. It can be solid, dotted, dashed, double or wavy.

  • textDecoColor(String)Color setting. The color system .

  • textDecoThickness(double). Specifies the line width of the decoration in px.

  • letterSpacing(double). Specifies the space between letters in px.

  • wordSpacing(double). Specifies the space between words in px.

  • textAlign(String). The alignment of the text. It can be left, center, right or justify.

  • lineHeight(double). Specifies the height of the text.For English, 1.0 is fine, but for Japanese, it may be better to adjust between 1.0 and 1.3.

  • overflow(String). The text overflow parameter. It can be clip, ellipsis, fade or visible. This parameter is valid only when isSelectable is false.

  • maxLines(int?). Maximum number of lines of text allowed when drawing.

  • usetextScaler(bool). Setting whether to respect the text size settings of the user’s device. Default is false.

  • leading(double?). Text line spacing settings. The default is null, in which case the font’s basic line spacing will be applied.


Deprecated parameters

  • textHeight(double). Renamed to lineHeight.

  • fontName(String). Renamed to fontFamily.