aboutsummaryrefslogtreecommitdiff
path: root/font.h (follow)
Commit message (Collapse)AuthorAgeLines
* font: tentative support for BGR, V-RGB and V-BGRDaniel Eklöf2019-08-19-0/+1
|
* render: replace all usage of cairo with pixmanDaniel Eklöf2019-08-16-4/+4
|
* wip: render background and glyphs using pixmanDaniel Eklöf2019-08-16-6/+7
|
* font: initial support for fontconfig font fallbackDaniel Eklöf2019-08-10-0/+5
| | | | | | | | When we've exhausted our own fallback list, try the font list provided by fontconfig. This means, the user's fallback fonts have priority, but in case all of them fail, we hopefully get lucky with fontconfig...
* cell: pack more efficiently and store glyph as a wcharDaniel Eklöf2019-08-02-1/+2
| | | | | | | | | | | The 'attributes' struct is now 8 bytes and naturally packed (used to be 9 bytes, artificially packed). 'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes, artificially packed). Furthermore, the glyph is stored as a wchar instead of a char*. This makes it easier (faster) to do glyph lookup when rendering.
* font: initial support for double-width *and* color emoji glyphsDaniel Eklöf2019-07-31-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fonts are now loaded with FT_LOAD_COLOR and we recognize and support the FT_PIXEL_MODE_BGRA pixel mode. This is mapped to a CAIRO_FORMAT_ARGB32 surface, that is blitted as-is (instead of used as a mask like we do for gray and mono glyphs). Furthermore, since many emojis are double-width, we add initial support for double-width glyphs. These are assumed to always be utf8. When PRINT:ing an utf8 character, we check its width, and add empty "spacer" cells after the cell with the multi-column glyph. When rendering, we render the columns in each row backwards. This ensures the spacer cells get cleared *before* we render the glyph (so that we don't end up erasing part of the glyph). Finally, emoji fonts are usually bitmap fonts with *large* glyphs. These aren't automatically scaled down. I.e. even if we request a glyph of 13 pixels, we might end up getting a 100px glyph. To handle this, fontconfig must be configured to scale bitmap fonts. When it is, we can look at the 'scalable' and 'pixelsizefixup' properties, and use these to scale the rendered glyph.
* font: add support for fallback fontsDaniel Eklöf2019-07-30-4/+51
| | | | | | | | | | | | | | | A top-level font now has a list of fallback fonts. When a glyph cannot be found, we try each fallback font in turn, until we either find one that has the glyph, or until we've exhausted the list. To make this actually work in practise (read: to make performance acceptable), the cache is re-worked and is now populated on demand. It also supports non-ASCII characters, by using the 4-byte unicode character as index instead. Since having an array that can be indexed by a 4-byte value isn't really viable, we now have a simple hash table instead of an array.
* font: set FT load and render flags from FontConfig propertiesDaniel Eklöf2019-07-29-1/+3
|
* font: populate glyph cache (ASCII characters only) when instantiating fontDaniel Eklöf2019-07-28-0/+1
|
* font: add font_glyph_for_utf8()Daniel Eklöf2019-07-28-0/+2
| | | | | | This function fills in a struct glyph with glyph bitmap data for the provided utf-8 character (essentially a FT_Bitmap wrapped in a cairo surface).
* font: load FreeType face, and set it's pixel sizesDaniel Eklöf2019-07-28-2/+3
|
* initial grid implementationDaniel Eklöf2019-06-13-0/+5
This allows us to render *something*, even though it's inefficient, stupid and far far away from the real thing.