Dart DocumentationstagexlTextFormat

TextFormat class

class TextFormat {

 String font;
 num size;
 int color;

 bool bold;
 bool italic;
 bool underline;
 String align;

 num topMargin;
 num bottomMargin;
 num leftMargin;
 num rightMargin;
 num indent;
 num leading;

 //-------------------------------------------------------------------------------------------------

 TextFormat(this.font, this.size, this.color, {
   this.bold         : false,
   this.italic       : false,
   this.underline    : false,
   this.align        : "left",
   this.topMargin    : 0.0,
   this.bottomMargin : 0.0,
   this.leftMargin   : 0.0,
   this.rightMargin  : 0.0,
   this.indent       : 0.0,
   this.leading      : 0.0
 });

 //-------------------------------------------------------------------------------------------------

 TextFormat clone() {
   return new TextFormat(font, size, color,
       bold: bold, italic: italic, underline: underline, align: align,
       topMargin: topMargin, bottomMargin: bottomMargin, leftMargin: leftMargin, rightMargin: rightMargin,
       indent: indent, leading: leading);
 }

 //-------------------------------------------------------------------------------------------------

 String get _cssFontStyle {
   var fontStyle = "${size}px ${font}, sans-serif";
   if (bold) fontStyle = "bold $fontStyle";
   if (italic) fontStyle = "italic $fontStyle";
   return fontStyle;
 }

}

Constructors

new TextFormat(String font, num size, int color, {bool bold: false, bool italic: false, bool underline: false, String align: "left", num topMargin: 0.0, num bottomMargin: 0.0, num leftMargin: 0.0, num rightMargin: 0.0, num indent: 0.0, num leading: 0.0}) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
TextFormat(this.font, this.size, this.color, {
 this.bold         : false,
 this.italic       : false,
 this.underline    : false,
 this.align        : "left",
 this.topMargin    : 0.0,
 this.bottomMargin : 0.0,
 this.leftMargin   : 0.0,
 this.rightMargin  : 0.0,
 this.indent       : 0.0,
 this.leading      : 0.0
});

Properties

String align #

String align

bool bold #

bool bold

num bottomMargin #

num bottomMargin

int color #

int color

String font #

String font

num indent #

num indent

bool italic #

bool italic

num leading #

num leading

num leftMargin #

num leftMargin

num rightMargin #

num rightMargin

num size #

num size

num topMargin #

num topMargin

bool underline #

bool underline

Methods

TextFormat clone() #

TextFormat clone() {
 return new TextFormat(font, size, color,
     bold: bold, italic: italic, underline: underline, align: align,
     topMargin: topMargin, bottomMargin: bottomMargin, leftMargin: leftMargin, rightMargin: rightMargin,
     indent: indent, leading: leading);
}