RaylibTypeface

Font rendering via Raylib. Discouraged, potentially slow, and not HiDPI-compatible. Use FreetypeTypeface instead.

Constructors

this
this(Font font)

Load a Raylib font.

this
deprecated this(string filename, int size)

Load a Raylib font from file.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

advance
Vector2 advance(dchar codepoint)

Get advance vector for the given glyph.

dpi
Vector2 dpi()
Undocumented in source. Be warned that the author may not have intended to support it.
dpi
Vector2 dpi(Vector2 dpi)

Changing DPI at runtime is not supported for Raylib typefaces.

drawLine
void drawLine(.Image target, Vector2 penPosition, string text, Color tint)

Draw a line of text Note: This API is unstable and might change over time.

font
Font font()
Undocumented in source. Be warned that the author may not have intended to support it.
font
const(Font) font()
Undocumented in source. Be warned that the author may not have intended to support it.
fontHeight
int fontHeight()

Get font height in pixels.

glyphCount
long glyphCount()

List glyphs in the typeface.

isOwner
bool isOwner()
Undocumented in source. Be warned that the author may not have intended to support it.
isOwner
bool isOwner(bool value)
Undocumented in source.
lineHeight
int lineHeight()

Get line height in pixels.

penPosition
Vector2 penPosition()

Get initial pen position.

Static functions

defaultTypeface
RaylibTypeface defaultTypeface()

Object holding the default typeface.

Variables

relativeLineHeight
float relativeLineHeight;

Line height relative to font height.

scale
float scale;

Scale to apply for the typeface.

spacing
float spacing;

Character spacing, as a fraction of the font size.

Inherited Members

From Typeface

glyphCount
long glyphCount()

List glyphs in the typeface.

penPosition
Vector2 penPosition()

Get initial pen position.

lineHeight
int lineHeight()

Get line height.

advance
Vector2 advance(dchar glyph)

Get advance vector for the given glyph. Uses dots, not pixels, as the unit.

dpi
Vector2 dpi(Vector2 scale)

Set font scale. This should be called at least once before drawing.

dpi
Vector2 dpi()

Get curently set DPI.

drawLine
void drawLine(Image target, Vector2 penPosition, string text, Color tint)

Draw a line of text. Note: This API is unstable and might change over time.

defaultTypeface
defaultTypeface()

Get the default Fluid typeface.

defaultWordChunks
defaultWordChunks(Range range)

Default word splitter used by measure/draw.

measure
Vector2 measure(Vector2 availableSpace, String text, bool wrap)
Vector2 measure(String text)

Measure space the given text would span. Uses dots as the unit.

draw
void draw(Image image, Rectangle rectangle, String text, Color tint, bool wrap)

Draw text within the given rectangle in the image.

Meta