OpenGlLimitedFont

Note that the constructor calls OpenGL functions and thus this must be called AFTER the context creation, e.g. on simpledisplay's window first visible delegate.

Any text with characters outside the range you bake in the constructor are simply ignored - that's why it is called "limited" font. The TtfFont struct can generate any string on-demand which is more flexible, and even faster for strings repeated frequently, but slower for frequently-changing or one-off strings. That's what this class is made for.

Constructors

this
this(ubyte[] ttfData, float fontPixelHeight, dchar firstChar, dchar lastChar)

Members

Functions

drawString
DrawingTextContext drawString(int x, int y, char[] text, Color color, Rectangle boundingBox)

Tip: if color == Color.transparent, it will not actually attempt to draw to OpenGL. You can use this to help plan pagination inside the bounding box.

drawString
void drawString(DrawingTextContext context, Color color)

It won't attempt to draw partial characters if it butts up against the bounding box, unless word wrap was impossible. Use clipping if you need to cover that up and guarantee it never goes outside the bounding box ever.

Variables

ascent
int ascent;
descent
int descent;

metrics

lineHeight
int lineHeight;

metrics

line_gap
int line_gap;

ditto;

Meta

History

Added April 24, 2020

Suggestion Box / Bug Report