<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/font.h, branch master</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=master</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2019-12-01T12:38:59Z</updated>
<entry>
<title>tllist: remove git submodule and local copy under subprojects</title>
<updated>2019-12-01T12:38:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-12-01T12:38:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ed176352e2a7c120aaa489972773ab3f263c80f7'/>
<id>urn:sha1:ed176352e2a7c120aaa489972773ab3f263c80f7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: fix underline/strikeout positioning</title>
<updated>2019-11-30T13:53:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-30T13:53:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=90bfcc1fbd8bb53508dc93405add1d8aacb4e7ed'/>
<id>urn:sha1:90bfcc1fbd8bb53508dc93405add1d8aacb4e7ed</id>
<content type='text'>
There were two errors:

* We subtracted half the line width instead of adding it to the
  baseline

* We rounded the line positioning and thickness before the positioning
  calculation. In particular, rounding the thickness before using it
  to adjust the position was wrong. Now we round just before the
  pixman call.
</content>
</entry>
<entry>
<title>font: move metrics from terminal struct to font struct</title>
<updated>2019-11-26T18:02:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-11-26T17:54:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bc86cd61c75f984633eb226692a30832c58efb17'/>
<id>urn:sha1:bc86cd61c75f984633eb226692a30832c58efb17</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: load fallback fonts on demand</title>
<updated>2019-10-17T15:53:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-17T15:53:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3c42691e1b2d859d9266e088cc3d76b2c1cb9aaf'/>
<id>urn:sha1:3c42691e1b2d859d9266e088cc3d76b2c1cb9aaf</id>
<content type='text'>
When instantiating a primary font, build the fallback font list, but
don't actually instantiate the fallback fonts.

Instead, remember the (full) pattern that we should use if/when we
instantiate it.

Then, when looking up a glyph and we need a fallback font, loop the
list and instantiate the font(s) there and then.
</content>
</entry>
<entry>
<title>font: load all fallbacks when instantiating a primary font</title>
<updated>2019-10-17T15:43:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-17T15:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e218e19ea3f47b69b985ce997fa5dba80ae78e9b'/>
<id>urn:sha1:e218e19ea3f47b69b985ce997fa5dba80ae78e9b</id>
<content type='text'>
The caching of fallback fonts didn't work. It "worked" because we
didn't free the fonts... When we started doing that, the fallback
fonts were no longer cached.

Another solution would have been to keep the cached fallback fonts
around until exit, and free them there. But that didn't seem very
clean.

So, for now, load *all* fallbacks when instantiating a
primary (non-fallback) font.

Note that this slows down initial startup time.
</content>
</entry>
<entry>
<title>font: rename cache -&gt; glyph_cache</title>
<updated>2019-10-17T15:12:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-17T15:12:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a80bcff18c4786b2f80d1b20e9b1ee40389209f'/>
<id>urn:sha1:5a80bcff18c4786b2f80d1b20e9b1ee40389209f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: rename fc_loaded_fonts -&gt; fc_loaded_fallbacks</title>
<updated>2019-10-17T15:07:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-17T15:06:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=af85c101274cd3b9c23c61e8d94d3d8549de94ee'/>
<id>urn:sha1:af85c101274cd3b9c23c61e8d94d3d8549de94ee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: cache top-level fonts</title>
<updated>2019-10-16T20:34:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-16T20:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=04edd960186dd316858d3b4d68298a01465043e6'/>
<id>urn:sha1:04edd960186dd316858d3b4d68298a01465043e6</id>
<content type='text'>
This greatly improves the performance when loading user-configured
fallback fonts.

Previously, we had to re-load these fallback fonts over and over again
for each (new) glyph.
</content>
</entry>
<entry>
<title>font: cache loaded fontconfig fallback fonts</title>
<updated>2019-10-16T20:18:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-16T20:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=928e86b423f5ca5905a4b9525d25ac0e469564c2'/>
<id>urn:sha1:928e86b423f5ca5905a4b9525d25ac0e469564c2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: font_from_name() returns an allocated font struct</title>
<updated>2019-10-16T19:52:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-10-16T19:52:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a789230cf9f87c68fcced647d0a1e8edc516f1c2'/>
<id>urn:sha1:a789230cf9f87c68fcced647d0a1e8edc516f1c2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: tentative support for BGR, V-RGB and V-BGR</title>
<updated>2019-08-19T15:45:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-19T15:45:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9029478e8c73915f6abb2eabe3f06411aa2537c8'/>
<id>urn:sha1:9029478e8c73915f6abb2eabe3f06411aa2537c8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: replace all usage of cairo with pixman</title>
<updated>2019-08-16T20:06:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-16T20:06:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=81107753bf88b6add556838780cfa1c727ccb4c2'/>
<id>urn:sha1:81107753bf88b6add556838780cfa1c727ccb4c2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wip: render background and glyphs using pixman</title>
<updated>2019-08-16T18:40:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-16T18:40:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bed7b34c2857ebac8028e8b7a00b0bef0d831df0'/>
<id>urn:sha1:bed7b34c2857ebac8028e8b7a00b0bef0d831df0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: initial support for fontconfig font fallback</title>
<updated>2019-08-10T18:34:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-10T18:34:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=92319d1570e712e3df23f9f623f17dc6e19b0c2a'/>
<id>urn:sha1:92319d1570e712e3df23f9f623f17dc6e19b0c2a</id>
<content type='text'>
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...
</content>
</entry>
<entry>
<title>cell: pack more efficiently and store glyph as a wchar</title>
<updated>2019-08-02T16:19:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-08-02T16:19:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4d7993b36fa3f97e26c527c37b36eb9321b79791'/>
<id>urn:sha1:4d7993b36fa3f97e26c527c37b36eb9321b79791</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>font: initial support for double-width *and* color emoji glyphs</title>
<updated>2019-07-31T16:03:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-31T16:03:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=858a0d9906a66f2eb9c2ffaf6d71e1153dad33f7'/>
<id>urn:sha1:858a0d9906a66f2eb9c2ffaf6d71e1153dad33f7</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>font: add support for fallback fonts</title>
<updated>2019-07-30T16:04:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-30T16:04:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=73b4d5d05ab3d3059017a0d3e2a5c798a241da87'/>
<id>urn:sha1:73b4d5d05ab3d3059017a0d3e2a5c798a241da87</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>font: set FT load and render flags from FontConfig properties</title>
<updated>2019-07-29T18:10:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-29T18:10:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4302d3eb680e1bd88724b8d67a6659f44bcdf789'/>
<id>urn:sha1:4302d3eb680e1bd88724b8d67a6659f44bcdf789</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: populate glyph cache (ASCII characters only) when instantiating font</title>
<updated>2019-07-28T19:03:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-28T19:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fe882bddbab2b3c75220976ba01cc998773fdfa5'/>
<id>urn:sha1:fe882bddbab2b3c75220976ba01cc998773fdfa5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>font: add font_glyph_for_utf8()</title>
<updated>2019-07-28T18:37:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2019-07-28T18:37:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9e57ba21086abb15772ae7efda06e584d618cd19'/>
<id>urn:sha1:9e57ba21086abb15772ae7efda06e584d618cd19</id>
<content type='text'>
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).
</content>
</entry>
</feed>
