![]() |
tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
|
A loaded face. More...
#include <text.h>
Public Attributes | |
| const uint8_t * | data |
| size_t | size |
| TinyFontKind | kind |
| uint32_t | cmap |
| uint32_t | glyf |
| uint32_t | loca |
| uint32_t | hmtx |
| uint32_t | kern |
| uint32_t | glyf_size |
| uint32_t | glyphs |
| uint32_t | hmetrics |
| uint32_t | units_per_em |
| uint8_t | long_loca |
| int32_t | ascent |
| int32_t | descent |
| int32_t | line_gap |
| uint32_t | cell_width |
| uint32_t | cell_height |
| uint32_t | glyph_bytes |
| uint32_t | bitmap |
| uint32_t * | index |
| Codepoint and offset pairs for a BDF face, owned. | |
| uint32_t | index_count |
A loaded face.
Keep one on the stack. It borrows the bytes it was loaded from rather than copying them, so a font stays valid only as long as those bytes do: a blob lives until tiny_blob_free, and bytes handed to tiny_font_load_bytes live as long as the caller keeps them.
The fields are read by the drawing code and by nothing else; a host reads a face through tiny_font_metrics rather than out of this structure, so the layout is not part of the ABI.
| int32_t TinyFont::ascent |
Baseline to the top of the ascenders, in font units.
| uint32_t TinyFont::bitmap |
Offset of the first glyph bitmap.
| uint32_t TinyFont::cell_height |
Cell height of a bitmap face, in pixels.
| uint32_t TinyFont::cell_width |
Cell width of a bitmap face, in pixels.
| uint32_t TinyFont::cmap |
Offset of cmap, or zero when the face has none.
| const uint8_t* TinyFont::data |
The face's bytes, borrowed.
| int32_t TinyFont::descent |
Baseline down to the bottom of the descenders, positive, in font units.
| uint32_t TinyFont::glyf |
Offset of glyf.
| uint32_t TinyFont::glyph_bytes |
Bytes one bitmap glyph occupies.
| uint32_t TinyFont::glyphs |
Glyphs the face holds, from maxp.
| uint32_t TinyFont::hmetrics |
Entries in hmtx before the trailing left side bearings.
| uint32_t TinyFont::hmtx |
Offset of hmtx.
| uint32_t* TinyFont::index |
Codepoint and offset pairs for a BDF face, owned.
BDF is a text format with no index of its own, so one is built at load and released by tiny_font_free. The other two formats leave this NULL, which is why calling tiny_font_free is harmless rather than required for them.
| uint32_t TinyFont::index_count |
How many pairs.
| uint32_t TinyFont::kern |
Offset of kern, or zero when the face has none.
| TinyFontKind TinyFont::kind |
Which format the magic bytes identified.
| int32_t TinyFont::line_gap |
Space between the descenders of one line and the ascenders of the next.
| uint32_t TinyFont::loca |
Offset of loca.
| uint8_t TinyFont::long_loca |
Non-zero when loca entries are 32 bit.
| size_t TinyFont::size |
How many.
| uint32_t TinyFont::units_per_em |
Font units per em, the divisor that turns a font unit into a pixel.