Module text

Module text 

Source
Expand description

Playdate text API

Modules§

api

Structs§

Font
Playdate Font representation.
FontPage
Playdate FontPage representation.
Glyph
Playdate Glyph representation.

Enums§

StringEncoding
TextAlignment
TextWrappingMode

Traits§

StringEncodingExt
TextAlignmentExt
TextWrappingModeExt

Functions§

draw_text
Draws the given text using the provided coords x, y.
draw_text_cstr
Draws the given text using the provided options.
draw_text_in_rect
Draws the text in the given rectangle using the provided options.
get_font_height
Returns the height of the given font.
get_font_page
Returns an FontPage object for the given character code c.
get_glyph_kerning
Returns the kerning adjustment between characters glyph_code and next_code as specified by the font
get_page_glyph
Returns an Glyph object for character c in FontPage page,
get_page_glyph_with_bitmap
Returns an Glyph object for character c in FontPage page, and optionally returns the glyph’s bitmap and advance value.
get_text_tracking
Gets the tracking used when drawing text.
get_text_width
Returns the width of the given text in the given font.
get_text_width_cstr
Returns the width of the given text in the given font.
load_font
Returns the Font object for the font file at path.
make_font_from_bytes
⚠️ Caution: This function is not tested.
set_font
Sets the font to use in subsequent draw_text calls.
set_text_leading
Sets the leading adjustment (added to the leading specified in the font) to use when drawing text.
set_text_tracking
Sets the tracking to use when drawing text.