freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype] Font files and vertical text


From: Lawrence D'Oliveiro
Subject: Re: [Freetype] Font files and vertical text
Date: Mon, 17 May 2021 02:48:19 +1200

OK, how about this as a starting point:

Q: How do I render a line of text in FreeType?
A: FreeType is a very low-level rendering engine. All it knows how to
do is render individual glyphs and return metrics for them.

Arranging glyphs into words and lines is best left to a more complete
2D graphics rendering library, like Cairo
<https://www.cairographics.org/>. Cairo also does very basic
translation of Unicode character codes to glyphs; for a more general
solution, add HarfBuzz
<https://www.freedesktop.org/wiki/Software/HarfBuzz/>, which implements
the full OpenType rules for glyph substitution and placement (Cairo
still handles the actual text drawing). To deal with right-to-left
(Arabic, Hebrew) text layout, you will also need FriBidi
<https://github.com/fribidi/fribidi>, which handles the details of the
Unicode bidirectional layout algorithm.

And finally, to cope with additional niceties like dealing with
writing-system-specific rules for word breaks and line breaks, you
might like to look at ICU <http://www.icu-project.org>, which includes
a whole range of internationalization and localization facilities.

[Is it worth mentioning Fontconfig
<https://www.freedesktop.org/wiki/Software/fontconfig/> as well, do you
think? As a solution for font matching?]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]