<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/blog/rss.xsl" type="text/xsl" media="screen" ?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Linux Xft Unicode fonts	</title>
	<atom:link href="https://cdn.jwz.org/blog/2026/03/linux-xft-unicode-fonts/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/</link>
	<description></description>
	<lastBuildDate>Wed, 11 Mar 2026 17:11:19 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="hub" href="https://websubhub.com/hub"/>
<atom:link rel="self" href="https://cdn.jwz.org/blog/2026/03/linux-xft-unicode-fonts/feed/"/>
	<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267460</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 17:11:19 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267460</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267449&quot;&gt;twb&lt;/a&gt;.

Ok, well I guess that &lt;em&gt;technically&lt;/em&gt; works, but getting an 8x12 pixel font, even for Latin1, is somewhat suboptimal.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267449">twb</a>.</p>
<p>Ok, well I guess that <em>technically</em> works, but getting an 8x12 pixel font, even for Latin1, is somewhat suboptimal.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: twb		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267449</link>

		<dc:creator><![CDATA[twb]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 08:42:21 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267449</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267448&quot;&gt;jwz&lt;/a&gt;.

This works for me, I get meaningful characters for both scripts:
sudo apt install fonts-unifont xscreensaver-gl
/usr/libexec/xscreensaver/unicrud --block Katakana,Arabic --font Unifont-120

Omitting the font size (--font Unifont) makes it segfault instead of defaulting to 12pt.

strace -etrace=openat shows it is opening DejaVuSans-Bold.ttf even with --no-titles.

--font System-UI-300 is choosing Cantarell-VF.otf, which is consistent with fontconfig:

$ for i in Monospace Serif Sans Sans\\-Serif System\\-UI; do fc-match &quot;$i&quot; file; done
:file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
:file=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
:file=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
:file=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
:file=/usr/share/fonts/opentype/cantarell/Cantarell-VF.otf

$ fc-list : family &#124; sort -u
Cantarell
DejaVu Sans
DejaVu Sans Mono
DejaVu Serif
FontAwesome
Noto Color Emoji
OpenSymbol
Quicksand
Quicksand Light
Quicksand Medium
Terminus
Unifont
Unifont CSUR
Unifont Sample
Unifont Upper
Unifont\-JP]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Australia</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267448">jwz</a>.</p>
<p>This works for me, I get meaningful characters for both scripts:<br />
sudo apt install fonts-unifont xscreensaver-gl<br />
/usr/libexec/xscreensaver/unicrud --block Katakana,Arabic --font Unifont-120</p>
<p>Omitting the font size (--font Unifont) makes it segfault instead of defaulting to 12pt.</p>
<p>strace -etrace=openat shows it is opening DejaVuSans-Bold.ttf even with --no-titles.</p>
<p>--font System-UI-300 is choosing Cantarell-VF.otf, which is consistent with fontconfig:</p>
<p>$ for i in Monospace Serif Sans Sans\\-Serif System\\-UI; do fc-match "$i" file; done<br />
:file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf<br />
:file=/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf<br />
:file=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf<br />
:file=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf<br />
:file=/usr/share/fonts/opentype/cantarell/Cantarell-VF.otf</p>
<p>$ fc-list : family | sort -u<br />
Cantarell<br />
DejaVu Sans<br />
DejaVu Sans Mono<br />
DejaVu Serif<br />
FontAwesome<br />
Noto Color Emoji<br />
OpenSymbol<br />
Quicksand<br />
Quicksand Light<br />
Quicksand Medium<br />
Terminus<br />
Unifont<br />
Unifont CSUR<br />
Unifont Sample<br />
Unifont Upper<br />
Unifont\-JP</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267448</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 08:08:55 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267448</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267447&quot;&gt;twb&lt;/a&gt;.

xlsfonts is not in the picture, that&#039;s for XLoadFont. I am no longer using XLFD, I&#039;m just doing &lt;strong&gt;XftNameParse (&quot;sans serif-300:style=Bold&quot;)&lt;/strong&gt;

Anyway further speculation is not helpful unless you&#039;ve installed/uninstalled a thing and made &quot;&lt;strong&gt;unicrud --block Katakana,Arabic --font &lt;/strong&gt;&lt;strong&gt;&lt;em&gt;X&lt;/em&gt;&lt;/strong&gt;&quot; work on a Linux system and seen it with your own lying eyes.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267447">twb</a>.</p>
<p>xlsfonts is not in the picture, that's for XLoadFont. I am no longer using XLFD, I'm just doing <strong>XftNameParse ("sans serif-300:style=Bold")</strong></p>
<p>Anyway further speculation is not helpful unless you've installed/uninstalled a thing and made "<strong>unicrud --block Katakana,Arabic --font </strong><strong><em>X</em></strong>" work on a Linux system and seen it with your own lying eyes.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: twb		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267447</link>

		<dc:creator><![CDATA[twb]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 07:56:07 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267447</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267446&quot;&gt;jwz&lt;/a&gt;.

Ah, sorry, I wasn&#039;t clear on &quot;try [this]&quot;.
I am *absolutely* guessing here, because I don&#039;t know Xft, but...

You mentioned XftFontOpenXlfd(&quot;-*-sans serif-bold-r-*-*-*-180-*-*-*-*-*-*&quot;) earlier.
Try &quot;sudo apt install fonts-unifont xfonts-unifont&quot; then... ugh, restart X I guess?
Then try XftFontOpenXlfd(&quot;-*-unifont-*-*-*-*-*-120-*-*-*-*-*-*&quot;).
If you get actual characters instead of empty boxes for English, Russian, Japanese, and Arabic, then that is one layer of bullshit eliminated from the bullshit cake.
Then you &quot;just&quot; have to find a font foundry that provides all the scripts (languages) you want, in one file, that doesn&#039;t look fugly.&#160; (I mentioned Iosevka before, but Iosevka doesn&#039;t do Japanese OR Arabic, so ignore Iosevka).

I was just testing it here and after installing all the unifont packages, I still can&#039;t convince xlsfonts or xfontsel to &quot;see&quot; Unifont, and I can&#039;t be arsed restarting X right now.&#160; I definitely have Unifont working normally in emacs-pgtk and firefox-esr with only fonts-unifont installed (xfonts-unifont and psf-unifont and unifont NOT installed).
The whole -*-*-*-*- stuff for me was a long long time ago and I don&#039;t remember too good beyond 1 week ago.

You shouldn&#039;t need to remove any Noto packages.
I don&#039;t think asking for &quot;Sans Serif&quot; is was ever supposed to work, it would have been &quot;Sans&quot;, &quot;Serif&quot;, &quot;System-UI&quot; (with the - escaped in various crazy ways), or &quot;Monospace&quot;.

What I&#039;m actually personaly using day-to-day is DejaVu + Unifont.
DejaVu covers all the alphabets (latin, cyrillic, greek, georgian, etc) and some abjads (hebrew, arabic).&#160; Unifont is Good EnoughTM for me to get by in Korean and I don&#039;t read Japanese or any abugidas well enough to care, and it means my font list is only like 12 files instead of Noto&#039;s 2000+.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Australia</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267446">jwz</a>.</p>
<p>Ah, sorry, I wasn't clear on "try [this]".<br />
I am *absolutely* guessing here, because I don't know Xft, but...</p>
<p>You mentioned XftFontOpenXlfd("-*-sans serif-bold-r-*-*-*-180-*-*-*-*-*-*") earlier.<br />
Try "sudo apt install fonts-unifont xfonts-unifont" then... ugh, restart X I guess?<br />
Then try XftFontOpenXlfd("-*-unifont-*-*-*-*-*-120-*-*-*-*-*-*").<br />
If you get actual characters instead of empty boxes for English, Russian, Japanese, and Arabic, then that is one layer of bullshit eliminated from the bullshit cake.<br />
Then you "just" have to find a font foundry that provides all the scripts (languages) you want, in one file, that doesn't look fugly.&nbsp; (I mentioned Iosevka before, but Iosevka doesn't do Japanese OR Arabic, so ignore Iosevka).</p>
<p>I was just testing it here and after installing all the unifont packages, I still can't convince xlsfonts or xfontsel to "see" Unifont, and I can't be arsed restarting X right now.&nbsp; I definitely have Unifont working normally in emacs-pgtk and firefox-esr with only fonts-unifont installed (xfonts-unifont and psf-unifont and unifont NOT installed).<br />
The whole -*-*-*-*- stuff for me was a long long time ago and I don't remember too good beyond 1 week ago.</p>
<p>You shouldn't need to remove any Noto packages.<br />
I don't think asking for "Sans Serif" is was ever supposed to work, it would have been "Sans", "Serif", "System-UI" (with the - escaped in various crazy ways), or "Monospace".</p>
<p>What I'm actually personaly using day-to-day is DejaVu + Unifont.<br />
DejaVu covers all the alphabets (latin, cyrillic, greek, georgian, etc) and some abjads (hebrew, arabic).&nbsp; Unifont is Good EnoughTM for me to get by in Korean and I don't read Japanese or any abugidas well enough to care, and it means my font list is only like 12 files instead of Noto's 2000+.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267446</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 07:37:30 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267446</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267445&quot;&gt;twb&lt;/a&gt;.

I think what you&#039;re saying is &quot;uninstall package noto, install package X and it will work&quot; but I am unclear in what X is for values of Debian.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267445">twb</a>.</p>
<p>I think what you're saying is "uninstall package noto, install package X and it will work" but I am unclear in what X is for values of Debian.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: twb		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267445</link>

		<dc:creator><![CDATA[twb]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 07:30:29 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267445</guid>

					<description><![CDATA[So I just noticed the original post is using NotoSans-Bold.ttf where the first response is using NotoSerifCJK-Regular.ttc.
Google choose to break up Noto into one file per script (except for en-US-Latn exceptionalism).
If you want all languages, and your font engine can only use one file at a time, then you can&#039;t use Noto.
&lt;pre&gt;&lt;code&gt;
$ fc-scan /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf &#124; grep lang: &#124; grep ja
[no hits -- Japanese NOT supported by this file]

$ fc-scan /usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc &#124; grep lang: &#124; grep ar
[this file supports Chinese/Japanese/Korean but not Arabic/Farsi]&lt;/code&gt;&lt;/pre&gt;
GNU Unifont looks fugly but at least packs all the languages into a single file (unifont.otf).
Iosevka packs everything into one .ttc file and doesn&#039;t look ugly, but it&#039;s like a 700MB file.
I don&#039;t know how to do this stuff in plain Xft, sorry.
I&#039;ve only ever fought this stuff at the high level -- GTK3 and CSS4 (browsers).]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Australia</div>
<p>So I just noticed the original post is using NotoSans-Bold.ttf where the first response is using NotoSerifCJK-Regular.ttc.<br />
Google choose to break up Noto into one file per script (except for en-US-Latn exceptionalism).<br />
If you want all languages, and your font engine can only use one file at a time, then you can't use Noto.</p>
<pre><code>
$ fc-scan /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf | grep lang: | grep ja
[no hits -- Japanese NOT supported by this file]

$ fc-scan /usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc | grep lang: | grep ar
[this file supports Chinese/Japanese/Korean but not Arabic/Farsi]</code></pre>
<p>GNU Unifont looks fugly but at least packs all the languages into a single file (unifont.otf).<br />
Iosevka packs everything into one .ttc file and doesn't look ugly, but it's like a 700MB file.<br />
I don't know how to do this stuff in plain Xft, sorry.<br />
I've only ever fought this stuff at the high level -- GTK3 and CSS4 (browsers).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kyzer		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267353</link>

		<dc:creator><![CDATA[Kyzer]]></dc:creator>
		<pubDate>Sat, 07 Mar 2026 10:49:27 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267353</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267352&quot;&gt;jwz&lt;/a&gt;.

Hmm, it works fine for me with no changes, so if it&#039;s not working for you, that&#039;ll be down to what fonts you have available. Run it with FC_DEBUG=1 and see what got matched.

I get family: &quot;Noto Color Emoji&quot;(s) &quot;Noto Color Emoji&quot;(w) &quot;Apple Color Emoji&quot;(w) &quot;Segoe UI Emoji&quot;(w) &quot;Twitter Color Emoji&quot;(w) ... and so on for &lt;em&gt;30&lt;/em&gt; font families, clearly I have too many emoji fonts. It ultimately picks Noto Color Emoji.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United Kingdom</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267352">jwz</a>.</p>
<p>Hmm, it works fine for me with no changes, so if it's not working for you, that'll be down to what fonts you have available. Run it with FC_DEBUG=1 and see what got matched.</p>
<p>I get family: "Noto Color Emoji"(s) "Noto Color Emoji"(w) "Apple Color Emoji"(w) "Segoe UI Emoji"(w) "Twitter Color Emoji"(w) ... and so on for <em>30</em> font families, clearly I have too many emoji fonts. It ultimately picks Noto Color Emoji.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267352</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Sat, 07 Mar 2026 04:39:47 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267352</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267350&quot;&gt;Kyzer&lt;/a&gt;.

Interesting, thanks!

Oddly, while it can display many languages, it doesn&#039;t seem to be able to display emojis or blackulas:&#160; &quot;👨🧛🏿💩🏃‍🚀&quot;]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267350">Kyzer</a>.</p>
<p>Interesting, thanks!</p>
<p>Oddly, while it can display many languages, it doesn't seem to be able to display emojis or blackulas:&nbsp; "👨🧛🏿💩🏃‍🚀"</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kyzer		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267350</link>

		<dc:creator><![CDATA[Kyzer]]></dc:creator>
		<pubDate>Sat, 07 Mar 2026 00:05:04 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267350</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267342&quot;&gt;jwz&lt;/a&gt;.

Pango comes with an example program featuring every bell and whistle it has, called &lt;a href=&quot;https://gitlab.gnome.org/GNOME/pango/-/blob/main/utils/viewer-main.c&quot; rel=&quot;nofollow ugc&quot;&gt;pango-view&lt;/a&gt;

Here&#039;s a quick and dirty example instead. It will render arbitrary UTF-8 in argv[1]:
&lt;pre&gt;&lt;code&gt;/* pangotest.c */
#include &#060;X11/Xlib.h&#062;
#include &#060;pango/pangocairo.h&#062;
#include &#060;cairo/cairo-xlib.h&#062;

int main(int argc, char *argv[]) {
    Display *dpy = XOpenDisplay(NULL);
    int screen = DefaultScreen(dpy);
    Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, screen), 100, 100, 400, 200, 1, BlackPixel(dpy, screen), WhitePixel(dpy, screen));
    XSelectInput(dpy, win, ExposureMask &#124; KeyPressMask);
    XMapWindow(dpy, win);

    cairo_surface_t *surface = cairo_xlib_surface_create(dpy, win, DefaultVisual(dpy, screen), 400, 200);
    cairo_t *cr = cairo_create(surface);

    PangoFontDescription *font = pango_font_description_from_string(&quot;Sans Bold 40&quot;);

    for (;;) {
       XEvent ev;
        XNextEvent(dpy, &#038;ev);
        if (ev.type == Expose) {
            cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
            cairo_paint(cr);

            PangoLayout *layout = pango_cairo_create_layout(cr);
            pango_layout_set_text(layout, argv[1], -1);
            pango_layout_set_font_description(layout, font);

            cairo_set_source_rgb(cr, 0.0, 1.0, 0.0);
            cairo_move_to(cr, 50, 80);
            pango_cairo_show_layout(cr, layout);

            g_object_unref(layout);
        }
        else if (ev.type == KeyPress) {
            break;
        }
    }

    pango_font_description_free(font);
    cairo_destroy(cr);
    cairo_surface_destroy(surface);
    XCloseDisplay(dpy);
    return 0;
}&lt;/code&gt;&lt;/pre&gt;
Compile and run like so:
&lt;pre&gt;&lt;code&gt;$ gcc -o pangotest pangotest.c $(pkgconf --cflags --libs pango cairo pangocairo) -lX11
$ ./pangotest &quot;مرگ بر آمریکا&quot;

&lt;/code&gt;&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United Kingdom</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267342">jwz</a>.</p>
<p>Pango comes with an example program featuring every bell and whistle it has, called <a href="https://gitlab.gnome.org/GNOME/pango/-/blob/main/utils/viewer-main.c" rel="nofollow ugc">pango-view</a></p>
<p>Here's a quick and dirty example instead. It will render arbitrary UTF-8 in argv[1]:</p>
<pre><code>/* pangotest.c */
#include &lt;X11/Xlib.h&gt;
#include &lt;pango/pangocairo.h&gt;
#include &lt;cairo/cairo-xlib.h&gt;

int main(int argc, char *argv[]) {
    Display *dpy = XOpenDisplay(NULL);
    int screen = DefaultScreen(dpy);
    Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, screen), 100, 100, 400, 200, 1, BlackPixel(dpy, screen), WhitePixel(dpy, screen));
    XSelectInput(dpy, win, ExposureMask | KeyPressMask);
    XMapWindow(dpy, win);

    cairo_surface_t *surface = cairo_xlib_surface_create(dpy, win, DefaultVisual(dpy, screen), 400, 200);
    cairo_t *cr = cairo_create(surface);

    PangoFontDescription *font = pango_font_description_from_string("Sans Bold 40");

    for (;;) {
       XEvent ev;
        XNextEvent(dpy, &amp;ev);
        if (ev.type == Expose) {
            cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
            cairo_paint(cr);

            PangoLayout *layout = pango_cairo_create_layout(cr);
            pango_layout_set_text(layout, argv[1], -1);
            pango_layout_set_font_description(layout, font);

            cairo_set_source_rgb(cr, 0.0, 1.0, 0.0);
            cairo_move_to(cr, 50, 80);
            pango_cairo_show_layout(cr, layout);

            g_object_unref(layout);
        }
        else if (ev.type == KeyPress) {
            break;
        }
    }

    pango_font_description_free(font);
    cairo_destroy(cr);
    cairo_surface_destroy(surface);
    XCloseDisplay(dpy);
    return 0;
}</code></pre>
<p>Compile and run like so:</p>
<pre><code>$ gcc -o pangotest pangotest.c $(pkgconf --cflags --libs pango cairo pangocairo) -lX11
$ ./pangotest "مرگ بر آمریکا"

</code></pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cordwainer Fish		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267347</link>

		<dc:creator><![CDATA[Cordwainer Fish]]></dc:creator>
		<pubDate>Fri, 06 Mar 2026 19:09:40 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267347</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267344&quot;&gt;Joseph Brenner&lt;/a&gt;.

It&#039;s worse than that - the character shapes you use for Chinese can be &lt;em&gt;really fucking political&lt;/em&gt;, because they&#039;re different in the PRC than they are in Taiwan.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267344">Joseph Brenner</a>.</p>
<p>It's worse than that - the character shapes you use for Chinese can be <em>really fucking political</em>, because they're different in the PRC than they are in Taiwan.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Joseph Brenner		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267344</link>

		<dc:creator><![CDATA[Joseph Brenner]]></dc:creator>
		<pubDate>Fri, 06 Mar 2026 17:32:45 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267344</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267318&quot;&gt;flatrute&lt;/a&gt;.

What puzzles me is there was a way to embed a locale in Unicode, which looked to me like a good way of providing a hint as to which CJK font to use, but for some reason it was deprecated (around the time of Unicode 5.0 if I remember right). &#160;

Anyway, yeah-- the original sin of Unicode is they were originally intent on squeezing all the world&#039;s characters into 16 bits (you see, it was now a 16 bit world!&#160; We&#039;ve got 16 bit microprocessors now! And it&#039;s important to have codepoint boundaries line up with the microprocessor&#039;s words because *mumble*). &#160; There&#039;s absolutely no way that could be done with separate code points for Chinese and Japanese so they had to share (&quot;the Han Unification&quot;, ha ha).&#160; The CJKV block is over 40% of the BMP (the bottom 64k of the codepoints, and the original scheme for unicode). &#160; I gather that the Chinese and Japanese can kind-of read each other&#039;s fonts, but they really don&#039;t like to-- so the original question jwz asked about displaying a character without knowing the language first, maybe you can find a way, but anything you do is going to be half-assed.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267318">flatrute</a>.</p>
<p>What puzzles me is there was a way to embed a locale in Unicode, which looked to me like a good way of providing a hint as to which CJK font to use, but for some reason it was deprecated (around the time of Unicode 5.0 if I remember right). &nbsp;</p>
<p>Anyway, yeah-- the original sin of Unicode is they were originally intent on squeezing all the world's characters into 16 bits (you see, it was now a 16 bit world!&nbsp; We've got 16 bit microprocessors now! And it's important to have codepoint boundaries line up with the microprocessor's words because *mumble*). &nbsp; There's absolutely no way that could be done with separate code points for Chinese and Japanese so they had to share ("the Han Unification", ha ha).&nbsp; The CJKV block is over 40% of the BMP (the bottom 64k of the codepoints, and the original scheme for unicode). &nbsp; I gather that the Chinese and Japanese can kind-of read each other's fonts, but they really don't like to-- so the original question jwz asked about displaying a character without knowing the language first, maybe you can find a way, but anything you do is going to be half-assed.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267342</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Thu, 05 Mar 2026 20:42:09 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267342</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267339&quot;&gt;Stephen Thorne&lt;/a&gt;.

If someone were to say: &quot;to render an arbitrary UTF-8 string without knowing what language it is in ahead of time, you should replace your calls to &lt;strong&gt;XftFontOpenName(&quot;sans serif-300&quot;)&lt;/strong&gt; and &lt;strong&gt;XftDrawStringUtf8()&lt;/strong&gt; with &lt;em&gt;[...this Pango code...]&lt;/em&gt;&quot;, that might be a helpful response.

So far nobody has said anything like that, and I&#039;m not even sure it&#039;s true.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267339">Stephen Thorne</a>.</p>
<p>If someone were to say: "to render an arbitrary UTF-8 string without knowing what language it is in ahead of time, you should replace your calls to <strong>XftFontOpenName("sans serif-300")</strong> and <strong>XftDrawStringUtf8()</strong> with <em>[...this Pango code...]</em>", that might be a helpful response.</p>
<p>So far nobody has said anything like that, and I'm not even sure it's true.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: tfb		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267341</link>

		<dc:creator><![CDATA[tfb]]></dc:creator>
		<pubDate>Thu, 05 Mar 2026 13:47:12 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267341</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309&quot;&gt;jwz&lt;/a&gt;.

It&#039;s all right.&#160; I have it on good authority that your dear leader is soon to issue an executive order forbidding any character set other than ASCII in American software.

Apparently it has slightly held up by an argument amongst the faithful that EBCDIC should be mandated instead.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United Kingdom</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309">jwz</a>.</p>
<p>It's all right.&nbsp; I have it on good authority that your dear leader is soon to issue an executive order forbidding any character set other than ASCII in American software.</p>
<p>Apparently it has slightly held up by an argument amongst the faithful that EBCDIC should be mandated instead.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Stephen Thorne		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267339</link>

		<dc:creator><![CDATA[Stephen Thorne]]></dc:creator>
		<pubDate>Thu, 05 Mar 2026 12:19:22 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267339</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267324&quot;&gt;jwz&lt;/a&gt;.

This sucks. But I&#039;m wondering about the use-case. You say it&#039;s for locations on a map. Perhaps you can use pango (or whatever hacked up tool works) to pre-compute the right parameters for the calls.

This would only be possible if you had a dictionary of map labels ahead of time, but the rate at which the names of countries and towns in the world changes is quite low, so perhaps this is a better tradeoff than making xscreensaver run untrustworthy fuzzymatching libraries at runtime.

I&#039;m suggesting you use pango as either a manual step during preparing your release, or make it part of the build-deps during compilation.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Switzerland</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267324">jwz</a>.</p>
<p>This sucks. But I'm wondering about the use-case. You say it's for locations on a map. Perhaps you can use pango (or whatever hacked up tool works) to pre-compute the right parameters for the calls.</p>
<p>This would only be possible if you had a dictionary of map labels ahead of time, but the rate at which the names of countries and towns in the world changes is quite low, so perhaps this is a better tradeoff than making xscreensaver run untrustworthy fuzzymatching libraries at runtime.</p>
<p>I'm suggesting you use pango as either a manual step during preparing your release, or make it part of the build-deps during compilation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ryan		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267335</link>

		<dc:creator><![CDATA[Ryan]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 19:37:44 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267335</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267327&quot;&gt;Kyzer&lt;/a&gt;.

This is a clever, if quite manual, hack.

Easier than maintaining a mapping between countries and their replacement letters, though, would be to just use ligatures (which the free FontForge supports). When the font encounters the full name of a country and a ligature for that combination of letters exists, it could swap in an outlined SVG of the localized name....]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267327">Kyzer</a>.</p>
<p>This is a clever, if quite manual, hack.</p>
<p>Easier than maintaining a mapping between countries and their replacement letters, though, would be to just use ligatures (which the free FontForge supports). When the font encounters the full name of a country and a ligature for that combination of letters exists, it could swap in an outlined SVG of the localized name....</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: k3ninho		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267332</link>

		<dc:creator><![CDATA[k3ninho]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 15:03:46 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267332</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267331&quot;&gt;twb&lt;/a&gt;.

It&#039;s well-known pain, we call this this problem Ye Olde¹ Thorn².

1: https://en.wikipedia.org/wiki/English_articles#Ye_form
2: https://en.wikipedia.org/wiki/Thorn_(letter)

K3n.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United Kingdom</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267331">twb</a>.</p>
<p>It's well-known pain, we call this this problem Ye Olde¹ Thorn².</p>
<p>1: <a href="https://en.wikipedia.org/wiki/English_articles#Ye_form" rel="nofollow ugc">https://en.wikipedia.org/wiki/English_articles#Ye_form</a><br />
2: <a href="https://en.wikipedia.org/wiki/Thorn_(letter)" rel="nofollow ugc">https://en.wikipedia.org/wiki/Thorn_(letter)</a></p>
<p>K3n.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: twb		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267331</link>

		<dc:creator><![CDATA[twb]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 14:49:09 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267331</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309&quot;&gt;jwz&lt;/a&gt;.

I *think* it’s that freetype is a font engine (render 1 codepoint correctly, or 2 with kerning), and pango/harfbuzz is a text engine (render whole words correctly).
Freetype alone can only pretend to be a text engine for baby scripts where you just lay each grapheme out one after another, like Suomi or Ukrainian but not Farsi or Punjabi or Bangla – which never worked properly on Linux before harfbuzz.
I don’t know why xft is failing on Japanese because – other than rubigana – that only needs basic one-after-another layout and the glyphs don’t change the shape of nearby glyphs. And you probably aren’t caring about Hanja unification issues yet.

Ok I guess technically e.g. Latin has different glyphs for /u/ depending on where it is in a word (turning into a “v”) and English has sharp s in older manuscripts, but most fonts just ignore that stuff. It’s an optional opentype setting in EB Garamond, and trying to use it makes you realise how shitty fontconfig is. Browsers can do it via css3 and hard coding which codepoints use which font files, which was tedious but worked.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Australia</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309">jwz</a>.</p>
<p>I *think* it’s that freetype is a font engine (render 1 codepoint correctly, or 2 with kerning), and pango/harfbuzz is a text engine (render whole words correctly).<br />
Freetype alone can only pretend to be a text engine for baby scripts where you just lay each grapheme out one after another, like Suomi or Ukrainian but not Farsi or Punjabi or Bangla – which never worked properly on Linux before harfbuzz.<br />
I don’t know why xft is failing on Japanese because – other than rubigana – that only needs basic one-after-another layout and the glyphs don’t change the shape of nearby glyphs. And you probably aren’t caring about Hanja unification issues yet.</p>
<p>Ok I guess technically e.g. Latin has different glyphs for /u/ depending on where it is in a word (turning into a “v”) and English has sharp s in older manuscripts, but most fonts just ignore that stuff. It’s an optional opentype setting in EB Garamond, and trying to use it makes you realise how shitty fontconfig is. Browsers can do it via css3 and hard coding which codepoints use which font files, which was tedious but worked.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kyzer		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267328</link>

		<dc:creator><![CDATA[Kyzer]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 11:40:34 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267328</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267327&quot;&gt;Kyzer&lt;/a&gt;.

&lt;a href=&quot;https://fontforge.org/&quot; rel=&quot;nofollow ugc&quot;&gt;FontForge&lt;/a&gt; is free, available for macOS, and can import SVGs! I haven&#039;t used it, but the guy who made the Bad Apple font &lt;a href=&quot;https://leifgehrmann.com/2019/04/28/creating-fonts-from-svg/&quot; rel=&quot;nofollow ugc&quot;&gt;notes that FontForge has a command line interface&lt;/a&gt;, and he wrote &lt;a href=&quot;https://github.com/leifgehrmann/fontforge-svg-importer&quot; rel=&quot;nofollow ugc&quot;&gt;a script&lt;/a&gt; to import all his SVGs as glyphs.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United Kingdom</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267327">Kyzer</a>.</p>
<p><a href="https://fontforge.org/" rel="nofollow ugc">FontForge</a> is free, available for macOS, and can import SVGs! I haven't used it, but the guy who made the Bad Apple font <a href="https://leifgehrmann.com/2019/04/28/creating-fonts-from-svg/" rel="nofollow ugc">notes that FontForge has a command line interface</a>, and he wrote <a href="https://github.com/leifgehrmann/fontforge-svg-importer" rel="nofollow ugc">a script</a> to import all his SVGs as glyphs.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kyzer		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267327</link>

		<dc:creator><![CDATA[Kyzer]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 11:30:23 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267327</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267324&quot;&gt;jwz&lt;/a&gt;.

There&#039;s this horrible line where text rendering crosses from easy to insanely complex. Xft lives on one side of that line. Pango et al live on the other side.

By needing a &lt;em&gt;single word&lt;/em&gt; using &lt;a href=&quot;https://en.wikipedia.org/wiki/Complex_text_layout&quot; rel=&quot;nofollow ugc&quot;&gt;complex text layout&lt;/a&gt;, you damn yourself.

Pango is just GNOME&#039;s solution to this, it&#039;s nice they didn&#039;t hardwire it into GTK. Qt uses a different library (WorldType), but even then, if you say your Qt app needs any complex text layout, it brings in a &lt;em&gt;whole other library&lt;/em&gt; just for that. 

My wacky idea would be to produce your own font with pre-composed characters, each character being the name of a country. Then you can skip all the hard bits about doing text shaping for every language in the world as code.

The hard bit then becomes the manual labour of turning county names first into SVGs using some &quot;text to SVG&quot; website and a specific font, then making a font out of these SVGs (a cursory web search suggests &lt;a href=&quot;https://glyphsmith.app/&quot; rel=&quot;nofollow ugc&quot;&gt;GlyphSmith&lt;/a&gt; can easily do this but it costs $29 if you want more than 10 glyphs in the font). Then you can print &quot;A&quot; for ભારત, &quot;B&quot; for ایران, &quot;C&quot; for ᠮᠤᠩᠭᠤᠯ
ᠤᠯᠤᠰ and so on.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United Kingdom</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267324">jwz</a>.</p>
<p>There's this horrible line where text rendering crosses from easy to insanely complex. Xft lives on one side of that line. Pango et al live on the other side.</p>
<p>By needing a <em>single word</em> using <a href="https://en.wikipedia.org/wiki/Complex_text_layout" rel="nofollow ugc">complex text layout</a>, you damn yourself.</p>
<p>Pango is just GNOME's solution to this, it's nice they didn't hardwire it into GTK. Qt uses a different library (WorldType), but even then, if you say your Qt app needs any complex text layout, it brings in a <em>whole other library</em> just for that. </p>
<p>My wacky idea would be to produce your own font with pre-composed characters, each character being the name of a country. Then you can skip all the hard bits about doing text shaping for every language in the world as code.</p>
<p>The hard bit then becomes the manual labour of turning county names first into SVGs using some "text to SVG" website and a specific font, then making a font out of these SVGs (a cursory web search suggests <a href="https://glyphsmith.app/" rel="nofollow ugc">GlyphSmith</a> can easily do this but it costs $29 if you want more than 10 glyphs in the font). Then you can print "A" for ભારત, "B" for ایران, "C" for ᠮᠤᠩᠭᠤᠯ<br />
ᠤᠯᠤᠰ and so on.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: rmu		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267326</link>

		<dc:creator><![CDATA[rmu]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 09:28:30 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267326</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267300&quot;&gt;Kyzer&lt;/a&gt;.

So xscreensaver could then be included into a font (as wasm) and then be displayed by xscreensaver...]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Austria</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267300">Kyzer</a>.</p>
<p>So xscreensaver could then be included into a font (as wasm) and then be displayed by xscreensaver...</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267324</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 05:10:24 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267324</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267323&quot;&gt;moof&lt;/a&gt;.

Look, here is the problem that I am currently trying to solve that led me down this godforsaken rathole:

&lt;ul&gt;&lt;li&gt;Here is the name of a country, in the official spelling in its native language.&lt;/li&gt;&lt;li&gt;I have a UTF-8 string that unambiguously represents those characters.&lt;/li&gt;&lt;li&gt;I would like to use that text as a label on a map.&lt;/li&gt;&lt;/ul&gt;
Linux has made this &lt;em&gt;god damned impossible.&lt;/em&gt;

No amount of telling me &quot;well, but it&#039;s really hard, there could be all of these edge cases&quot; is going to make this sound any less ridiculous. It is patently absurd that I can&#039;t load a font and have those characters show up as &lt;em&gt;something other than a blank rectangle.
&lt;/em&gt;
It manages to find the glyph for a goddamned &lt;em&gt;poop with eyeballs&lt;/em&gt; ferchrissakes, it should work with a random Chinese glyph too!]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267323">moof</a>.</p>
<p>Look, here is the problem that I am currently trying to solve that led me down this godforsaken rathole:</p>
<ul>
<li>Here is the name of a country, in the official spelling in its native language.</li>
<li>I have a UTF-8 string that unambiguously represents those characters.</li>
<li>I would like to use that text as a label on a map.</li>
</ul>
<p>Linux has made this <em>god damned impossible.</em></p>
<p>No amount of telling me "well, but it's really hard, there could be all of these edge cases" is going to make this sound any less ridiculous. It is patently absurd that I can't load a font and have those characters show up as <em>something other than a blank rectangle.<br />
</em><br />
It manages to find the glyph for a goddamned <em>poop with eyeballs</em> ferchrissakes, it should work with a random Chinese glyph too!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: moof		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267323</link>

		<dc:creator><![CDATA[moof]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 05:00:33 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267323</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267322&quot;&gt;jwz&lt;/a&gt;.

if you want to be able to emit utf-8 sequences that aren&#039;t just &quot;emit one independent glyph after another, left-to-right&quot;, then you&#039;re going to have to use harfbuzz or some other character shaping library. producing Arabic - or even worse, Mongolian - is a non-trivial task, and there are still edge conditions in many renderers that get it wrong. (See &lt;a href=&quot;https://www.unicode.org/notes/tn57/utn57-mong-4.pdf&quot; rel=&quot;nofollow ugc&quot;&gt;https://www.unicode.org/notes/tn57/utn57-mong-4.pdf&lt;/a&gt; for a delightful 80 page PDF that goes into the details and phases of character shaping and joining for Mongolian.)]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267322">jwz</a>.</p>
<p>if you want to be able to emit utf-8 sequences that aren't just "emit one independent glyph after another, left-to-right", then you're going to have to use harfbuzz or some other character shaping library. producing Arabic - or even worse, Mongolian - is a non-trivial task, and there are still edge conditions in many renderers that get it wrong. (See <a href="https://www.unicode.org/notes/tn57/utn57-mong-4.pdf" rel="nofollow ugc">https://www.unicode.org/notes/tn57/utn57-mong-4.pdf</a> for a delightful 80 page PDF that goes into the details and phases of character shaping and joining for Mongolian.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267322</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 04:33:18 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267322</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267321&quot;&gt;moof&lt;/a&gt;.

Hardcoding in support for one particular language is not the goal here.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267321">moof</a>.</p>
<p>Hardcoding in support for one particular language is not the goal here.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: moof		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267321</link>

		<dc:creator><![CDATA[moof]]></dc:creator>
		<pubDate>Wed, 04 Mar 2026 04:21:01 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267321</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267282&quot;&gt;raveguide&lt;/a&gt;.

fwiw, &lt;a href=&quot;https://github.com/hrs-allbsd/kterm&quot; rel=&quot;nofollow ugc&quot;&gt;https://github.com/hrs-allbsd/kterm&lt;/a&gt; does japanese text without pango or cairo - but it also doesn&#039;t use Xft, instead just using XDrawString (and Xaw), and requiring a bunch of fiddly config specifying whether it&#039;s using utf-8 or euc-jp or shift-jis or whatever. ]]></description>
			<content:encoded><![CDATA[<div class="geolocation">United States</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267282">raveguide</a>.</p>
<p>fwiw, <a href="https://github.com/hrs-allbsd/kterm" rel="nofollow ugc">https://github.com/hrs-allbsd/kterm</a> does japanese text without pango or cairo - but it also doesn't use Xft, instead just using XDrawString (and Xaw), and requiring a bunch of fiddly config specifying whether it's using utf-8 or euc-jp or shift-jis or whatever. </p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: flatrute		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267318</link>

		<dc:creator><![CDATA[flatrute]]></dc:creator>
		<pubDate>Tue, 03 Mar 2026 23:12:29 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267318</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267312&quot;&gt;Elladan&lt;/a&gt;.

Yep and it made quite an amount of hardcore computer users in those East Asian countries pissed off if I am not wrong. There is a workaround by inserting dedicated character select control codes but it does not work for all of them.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Vietnam</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267312">Elladan</a>.</p>
<p>Yep and it made quite an amount of hardcore computer users in those East Asian countries pissed off if I am not wrong. There is a workaround by inserting dedicated character select control codes but it does not work for all of them.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jwz		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267316</link>

		<dc:creator><![CDATA[jwz]]></dc:creator>
		<pubDate>Tue, 03 Mar 2026 20:27:39 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267316</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267314&quot;&gt;#?.info&lt;/a&gt;.

For the record, X11-versus-Wayland has nothing to do with this. Xft is a thin wrapper over FontConfig, which is the same in both universes, so Wayland won&#039;t save you.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Via Mastodon</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267314">#?.info</a>.</p>
<p>For the record, X11-versus-Wayland has nothing to do with this. Xft is a thin wrapper over FontConfig, which is the same in both universes, so Wayland won't save you.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Francis Cook		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267315</link>

		<dc:creator><![CDATA[Francis Cook]]></dc:creator>
		<pubDate>Tue, 03 Mar 2026 20:19:26 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267315</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309&quot;&gt;jwz&lt;/a&gt;.

what… and I can’t be more emphatic about this: the fuck?!]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Via Mastodon</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309">jwz</a>.</p>
<p>what… and I can’t be more emphatic about this: the fuck?!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: #?.info		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267314</link>

		<dc:creator><![CDATA[#?.info]]></dc:creator>
		<pubDate>Tue, 03 Mar 2026 19:15:15 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267314</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267311&quot;&gt;Szymon Sokół 🇵🇱🇪🇺🇺🇦&lt;/a&gt;.

Apparently the X11 font rendering system requires you specify a language as well as a font, then gets the glyths for that language/font combination.

Which is pretty ugly. Honestly, this is another reason I think X11 should be...

...fixed and not replaced with something worse.]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Via Mastodon</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267311">Szymon Sokół 🇵🇱🇪🇺🇺🇦</a>.</p>
<p>Apparently the X11 font rendering system requires you specify a language as well as a font, then gets the glyths for that language/font combination.</p>
<p>Which is pretty ugly. Honestly, this is another reason I think X11 should be...</p>
<p>...fixed and not replaced with something worse.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Elladan		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267312</link>

		<dc:creator><![CDATA[Elladan]]></dc:creator>
		<pubDate>Tue, 03 Mar 2026 18:27:34 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267312</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267311&quot;&gt;Szymon Sokół 🇵🇱🇪🇺🇺🇦&lt;/a&gt;.

don&#039;t you also need to know what CJK language the text is written in due to Han Unification, or something?]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Via Mastodon</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267311">Szymon Sokół 🇵🇱🇪🇺🇺🇦</a>.</p>
<p>don't you also need to know what CJK language the text is written in due to Han Unification, or something?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Szymon Sokół 🇵🇱🇪🇺🇺🇦		</title>
		<link>https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267311</link>

		<dc:creator><![CDATA[Szymon Sokół 🇵🇱🇪🇺🇺🇦]]></dc:creator>
		<pubDate>Tue, 03 Mar 2026 17:38:03 +0000</pubDate>
		<guid isPermaLink="false">https://jwz.org/b/yk39#comment-267311</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309&quot;&gt;jwz&lt;/a&gt;.

is it because no font contains all existing Unicode glyphs, or is there another reason?]]></description>
			<content:encoded><![CDATA[<div class="geolocation">Via Mastodon</div>
<p>In reply to <a href="https://www.jwz.org/blog/2026/03/linux-xft-unicode-fonts/#comment-267309">jwz</a>.</p>
<p>is it because no font contains all existing Unicode glyphs, or is there another reason?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
