class TextStyleOptions extends Object
A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.
- Annotations
- @RawJSType() @ScalaJSDefined()
- Alphabetic
- By Inheritance
- TextStyleOptions
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
TextStyleOptions(font: UndefOr[String] = js.undefined, fill: UndefOr[|[String, Double]] = js.undefined, align: UndefOr[String] = js.undefined, stroke: UndefOr[|[String, Double]] = js.undefined, strokeThickness: UndefOr[LineWidth] = js.undefined, wordWrap: UndefOr[Boolean] = js.undefined, wordWrapWidth: UndefOr[Int] = js.undefined, lineHeight: UndefOr[Int] = js.undefined, dropShadow: UndefOr[Boolean] = js.undefined, dropShadowColor: UndefOr[String] = js.undefined, dropShadowAngle: UndefOr[Double] = js.undefined, dropShadowDistance: UndefOr[Int] = js.undefined, padding: UndefOr[Padding] = js.undefined, textBaseline: UndefOr[String] = js.undefined, lineJoin: UndefOr[String] = js.undefined, miterLimit: UndefOr[Int] = js.undefined)
- font
default 'bold 20px Arial' The style and size of the font
- fill
A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'
- align
Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
- stroke
A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'
- strokeThickness
A number that represents the thickness of the stroke. Default is 0 (no stroke)
- wordWrap
Indicates if word wrap should be used
- wordWrapWidth
The width at which text will wrap, it needs wordWrap to be set to true
- lineHeight
The line height, a number that represents the vertical space that a letter uses
- dropShadow
Set a drop shadow for the text
- dropShadowColor
A fill style to be used on the dropshadow e.g 'red', '#00FF00'
- dropShadowAngle
Set a angle of the drop shadow
- dropShadowDistance
Set a distance of the drop shadow
- padding
Occasionally some fonts are cropped on top or bottom. Adding some padding will prevent this from happening by adding padding to the top and bottom of text height.
- textBaseline
The baseline of the text that is rendered.
- lineJoin
The lineJoin property sets the type of corner created, it can resolve spiked text issues. Default is 'miter' (creates a sharp corner).
- miterLimit
The miter limit to use when using the 'miter' lineJoin mode. This can reduce or increase the spikiness of rendered text.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- var align: UndefOr[String]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- var dropShadow: UndefOr[Boolean]
- var dropShadowAngle: UndefOr[Double]
- var dropShadowColor: UndefOr[String]
- var dropShadowDistance: UndefOr[Int]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- var fill: UndefOr[|[String, Double]]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- var font: UndefOr[String]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- var lineHeight: UndefOr[Int]
- var lineJoin: UndefOr[String]
- var miterLimit: UndefOr[Int]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- var padding: UndefOr[Padding]
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- var stroke: UndefOr[|[String, Double]]
- var strokeThickness: UndefOr[LineWidth]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- var textBaseline: UndefOr[String]
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- var wordWrap: UndefOr[Boolean]
- var wordWrapWidth: UndefOr[Int]