difference between icu4c opentype harfbuzz - icu

These three open source library are used in android very frequently. I just know that these library are used to handle fonts.
I was thinking what is the difference between in these library and Are they interrelated with each? or They can substitute one another.

OpenType is not a library, it is a standard for “smart” font that is the most widely used format for advanced typography and support for complex writing systems.
ICU is a library for Unicode support, it provides many features like Unicode characters properties, Unicode Bidirectional algorithm implementation, encoding conversions and more. ICU provides also an OpenType implementation, ICU LayoutEngine, but it is not used by Android AFAIK, it is also unmaintained and will be replaced by HarfBuzz at some point.
HarfBuzz is a text shaping library, in short it takes a font, a string of text and some properties (script, language, optional OpenType features) and return a sequence of font glyph ids that a rendering engine will draw them on the screen. It is mainly an OpenType implementation, but can support other font technologies. It is a bit of low level library and requires some understanding of fonts and text rendering to be used properly.

Related

How do I add Asian language fonts to Mono Linux?

Linux 5.19.10-arch1-1 x86_64 GNU/Linux
I already have several Asian language fonts installed on the system, and they work fine in GTK & QT apps. But Mono seems to default to one of the default Windows fonts. (Understandable.) Which while breaking the system UI, would be fine if it wasn't lacking Asian language character sets. Specifically Japanese if that matters, I presume it doesn't since Asian language character sets are typically bundled. Unless I need to give a specific language/locale flag.
I tried Googling how to add Asian font support to Mono Linux, but Google AI misinterprets me and thinks I'm searching for Monospaced Asian Language Fonts for Linux. 🤦‍♂️ I tried searching the Mono documentation for font and fonts but it did not turn up anything useful. Is there anyway to add more available fonts to Mono? (it apparently isn't just using the system fonts folder) Or even just a way to force it to use a specific font?

SVG Glyphs with Huge Dimensions

This question is about the design of SVG-fonts.
I am using some third-party SVG music fonts for an application. The single glyphs of these fonts, are by default very huge in size. I was wondering what the reason for this could be. I can think of, this allows to do more fine-tuning work while designing the fonts, and since they are of course scalable, they should be down-scaled as needed when I want to actually use them. Is this true, or are there some other points to consider?
Also when I use the path's data of single fonts (e.g. in a svg file) and open the svg file in Inkscape the symbols are upside-down, so I have to apply scale(1 -1) to all symbols. Is there a reason why these fonts are designed this way?
It will generally relate to the tool(s) they are using. Font editors commonly have a default em size of around 1000 units. The reason for that is likely because font files generally use integers, rather than floating point, for their glyph coordinates. And 1000 gives you a decent three digits of precision.
For instance have a look at a description of the OTF/TTF glyf table

What text rendering library Chrome uses for Linux?

Are they using freetype or xfonts or cairo or something else? Maybe their own made library? I am thinking to use the same library in my program as well. I think what Google uses will be well maintained for long time.
The accepted answer is not correct. Under the hood, Skia uses Uniscribe on Windows, HarfBuzz on Linux + ChromeOS, and CoreText on the Mac. (Actually it's possible at this point, much of the Uniscribe and CoreText code has also been replaced with HarfBuzz for consistency.) Skia is used only to draw glyphs after the the shaping/layout code has done its job.
https://skia.org/docs/user/tips/ : "Skia does not shape text. Skia provides interfaces to draw glyphs, but does not implement a text shaper. Skia’s client’s often use HarfBuzz to generate the glyphs and their positions, including kerning."
Chrome uses Skia for nearly all graphics operations, including text
rendering. GDI is for the most part only used for native theme
rendering; new code should use Skia.
http://www.chromium.org/developers/design-documents/graphics-and-skia
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.
Skia Project Page:
http://code.google.com/p/skia/

Why don't cross-platform applications like Chrome use FreeType to render text?

Just looking through the list of issues for the chromium project, a large number of them are cross-platform text rendering issues. Having to use the platform's text rendering system, and cater to their respective idiosyncrasies, I imagine is a lot of work.
Why not simply use the FreeType library and be done with it? FreeType is used in Linux, iOS and Android, among other platforms. So on these platforms, browsers are using a wrapped FreeType library anyway. Why not scrap that wrapping, scrap the platform-supplied rendering on Windows and Mac, and go pure FreeType?
The only answer that occurs to me is that perhaps it's to take advantage of the hardware accelerated composition and blending of glyphs that Windows- and Mac-supplied rendering offers.
Or my other answer is that perhaps it was because WebKit was ported before the subpixel antialiasing patents had expired, so the only way to get subpixel antialiased text was to use platform-supplied rendering.
Are either of these correct? If not, what is the case?
When Safari was ported to Windows, it came with a port of Apple text renderer. Popular opinion was that the text was blurry and illegible.
People get really, really used to how their system renders text and react very sensitively, and very annoyed indeed, to anything different.

how Font and text rendering is done in different OSes

How font rendering is done in linux, bsd, windows? how they differ?
I am not talking about browser web font rendering.say for example how input system works? I press mouse keys. they trigger evdev drivers of linux kernel, and the kernel manages the higher level ops.
low level font rendering mechanism. how freetype, pango, window manager, interact with each other. another big question? how unicode support is accomplished??
simply, when I type a character in a text editor, what are the paths does the character flow before coming into the screen. how the MS word or LibreOffice render different fonts together in single canvas??
On *nix text-rendering is done client-side nowadays which means apps use whatever lib they like best to transform unicode codepoints to pixels and feed the result to x. The actual libs used wary widely though people has been converging on fontconfig + freetype + freebidi + harfbuzz in the past years, usually accessed through pango-cairo
A summary was posted here a few years ago
http://behdad.org/text/
It's all a devilishly complex process, you have weeks of reading if you want to understand all the steps involved.
text-rendering linux fonts

Resources