Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
Atsuya Sato edited this page Nov 30, 2018 · 2 revisions

Text


text(_ str: String, _ x: CGFloat, _ y: CGFloat)

text(_ str: String, _ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat)

Available

iOS, OSX

Examples

textSize(32)
fill(0, 102, 153)
text("word", 10, 60)

Description

Draws a text.


textWidth(_ str: String) -> CGFloat

Available

iOS, OSX

Examples

print(textWidth("Hello"))

Description

returns the width of text string.


textSize(_ size: CGFloat)

Available

iOS, OSX

Examples

textSize(32)

Description

Sets the current font size.


textFont(_ font: UIFont)

Available

iOS, OSX

Examples

textFont(UIFont(name: "ArialMT", size: 32))

Description

Sets the current font style.


textAlign(_ allignX: NSTextAlignment)

Available

iOS, OSX

Examples

textAlign(.center)
text("EFGH", 50, 50)
textAlign(.left)
text("IJKL", 50, 70)

Description

Sets the current alignment for drawing text.

※ Currently not supported align right. issue #108