<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/char32.c, branch 1.22.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.22.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.22.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2024-04-20T06:26:15Z</updated>
<entry>
<title>char32: mbsntoc32() returns a size_t, not a char32_t</title>
<updated>2024-04-20T06:26:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-04-20T06:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=acbb3cbb703e5c20290b677c515ff5f9e2646014'/>
<id>urn:sha1:acbb3cbb703e5c20290b677c515ff5f9e2646014</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace unchecked allocations with calls to xmalloc.h functions</title>
<updated>2024-01-25T07:03:50Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-01-25T07:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=91b22ae21acd0b3171814b47b0dead027f8da779'/>
<id>urn:sha1:91b22ae21acd0b3171814b47b0dead027f8da779</id>
<content type='text'>
</content>
</entry>
<entry>
<title>char32: only include stdc-predef.h if it is available</title>
<updated>2022-03-19T18:52:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-19T18:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dcdbb3613ce66483161e032050c3bed55e7d16b1'/>
<id>urn:sha1:dcdbb3613ce66483161e032050c3bed55e7d16b1</id>
<content type='text'>
Use the (relatively new) macro __has_include() to check if
stdc-predef.h exists, and only include it if it does.

If stdc-predef.h does not exist, or if the compiler does not implement
__has_include(), stdc-predef.h is *not* included.
</content>
</entry>
<entry>
<title>char32: add missing header to work with musl</title>
<updated>2022-03-19T18:05:34Z</updated>
<author>
<name>Leonardo Neumann</name>
<email>leonardo@neumann.dev.br</email>
</author>
<published>2022-03-15T02:15:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c365df495efea1deab5126526b286cc80544ec2f'/>
<id>urn:sha1:c365df495efea1deab5126526b286cc80544ec2f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Wrap setlocale in asserts since it can fail</title>
<updated>2022-02-27T15:33:20Z</updated>
<author>
<name>jvoisin</name>
<email>julien.voisin@dustri.org</email>
</author>
<published>2022-02-27T13:29:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7d647c08ff54d9fbee10fd4dcd033515cfac0114'/>
<id>urn:sha1:7d647c08ff54d9fbee10fd4dcd033515cfac0114</id>
<content type='text'>
</content>
</entry>
<entry>
<title>char32: inline wcs*() wrappers</title>
<updated>2022-02-05T16:00:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-10T20:06:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dc42b41b6238cb44c1098009e68d7d63095cbef3'/>
<id>urn:sha1:dc42b41b6238cb44c1098009e68d7d63095cbef3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fcft: adapt to API changes in fcft-3.x</title>
<updated>2022-02-05T16:00:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-21T12:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e0227266cabc015c282774ac898e3f52dce943df'/>
<id>urn:sha1:e0227266cabc015c282774ac898e3f52dce943df</id>
<content type='text'>
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.

Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.

For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).

Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.

These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.

For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the  __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.

FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.

Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.

Other fcft API changes:

* fcft_glyph_rasterize() -&gt; fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
</content>
</entry>
</feed>
