Re: Font files and vertical text

Lawrence D'Oliveiro <[email protected]>
Newsgroups gmane.comp.fonts.freetype.user
Organization Geek Central
Message-ID <[email protected]>
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?]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.