|
scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
|
One rasterized glyph: an 8-bit coverage bitmap plus placement info. More...
#include <font.h>
Public Member Functions | |
| bool | empty () const |
| Whether this glyph has no pixels to draw (e.g. a space). | |
| uint8_t | at (int x, int y) const |
| Coverage value at pixel (x, y), 0-255. No bounds checking. | |
Public Attributes | |
| int | width = 0 |
| Bitmap width in pixels. | |
| int | height = 0 |
| Bitmap height in pixels. | |
| int | x_offset = 0 |
| Horizontal offset from the pen position to the bitmap's left edge. | |
| int | y_offset = 0 |
| Vertical offset from the baseline to the bitmap's top edge. | |
| float | advance = 0.0f |
| Pen advance for this glyph, in pixels. | |
| std::vector< uint8_t > | coverage |
Coverage values, row-major, width * height entries. | |
One rasterized glyph: an 8-bit coverage bitmap plus placement info.
The bitmap is a single-channel (coverage) image: 0 means fully transparent, 255 means the pixel is fully covered by the glyph. Coverage values are fractional, which is what gives text its anti-aliasing.
Placement follows the usual TrueType convention: the glyph is drawn with its bitmap top left corner at (pen_x + x_offset, baseline_y + y_offset), where the y axis points down. Because the y offsets are negative for glyphs that sit above the baseline, the renderer draws at baseline_y + y_offset.
|
inline |
| float scimesh::GlyphBitmap::advance = 0.0f |
| std::vector<uint8_t> scimesh::GlyphBitmap::coverage |
| int scimesh::GlyphBitmap::x_offset = 0 |
| int scimesh::GlyphBitmap::y_offset = 0 |