Search code examples
c++fontsxlibtruetypeopentype

TTF/OTF fonts on xlib


I'm Doing some simple tests with XLIB and c++ on linux, and I was wondering, is there any (relatively easy) way to implement OTF and TTF fonts in Xlib. Can anybody help me out with this?


Solution

  • Not really, opentype and unicode are tentacular specs, you need to use specialized libs such as (harfbuzz-ng + freebidi + fontconfig + freetype) to get something that works in anything but trivial cases.

    The font handling bits in Xlib are legacy leftovers of the time when XFree86 people thought modern fonts would be "easy". It proved a lot harder, and later versions of this code were spun out in separate projects that eventually became the libs I pointed to.