summaryrefslogtreecommitdiff
path: root/src/rufl_metrics.c
Commit message (Collapse)AuthorAgeFilesLines
* Partially revert public API type changesJohn-Mark Bell2022-05-271-2/+3
| | | | | | | | | | | | | a4c41198 made a variety of consistency changes to the public API, including changing the type of the "string" parameter passed to many entry points from const char * to const uint8_t *, as that better reflects the data. However, this then forces the user of the API to explicitly cast when passing string constants, or other strings (which, would be passed to standard library APIs as const char *, even if UTF-8 encoded). Revert this part of the change so the type of "string" is once more const char * and cast to the type we actually want internally.
* Clean up types in public APIJohn-Mark Bell2021-08-151-8/+8
|
* Perform font substitution for astral characters, too.John-Mark Bell2021-08-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | This significantly reworks the construction of the substitution table (and hides its implementation from the rest of the library). It is no longer practical to use a directly-indexed array so, instead, we front it with a perfect hash function. The storage required for the (unoptimised) hash data is currently about 6 bits per entry. Implementing compression would reduce this to the order of ~2 bits per entry. As the resulting data structure is sparse, we must store the original Unicode codepoint value along with the identity of the font providing a suitable glyph. This has necessitated expanding the size of substitution table entries from 16 to 64 bits (of which 27 bits are currently unused). With the 55757 codepoint coverage I have been testing with, this results in an increase in the substitution table storage requirements from the original 128kB directly-indexed array (covering the Basic Multilingual Plane only) to a rather fatter 512kB (for the codepoint+font id array) + ~41kB of hash metadata. This is still ~25% the size of a linear array, however, so is not completely outrageous.
* Use UCS-4 for rendering and display 6-digit replacement characters.John-Mark Bell2021-08-081-4/+4
| | | | | | | | | | | As we introduce support for discovering and rendering astral characters, ensure that we pass UCS-4 to the relevant Font Manager APIs and extend our replacement hex code generation to emit 6 digits for codepoints outside the Basic Multilingual Plane. This has necessitated a change to the API of the callback function provided to rufl_paint_callback(). Where, previously, a 16 bit UCS-2 string was exposed, we now expose UCS-4.
* OSLib headers are system headers.Michael Drake2021-04-251-1/+1
|
* Port to core buildsystem.John Mark Bell2010-01-061-0/+312
The python module (and associated make runes) need some love (as does non-GCC building with the core buildsystem in general) svn path=/trunk/rufl/; revision=9792