What text rendering library Chrome uses for Linux? - 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/

Related

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

difference between icu4c opentype harfbuzz

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.

Direct2D equivalent 2D graphics API for WindowsXP

As you all know, Direct2D can be used for 2D animation in case of Windows7.
Since Direct2D is not supported in WindowsXP, can you specify some equivalent 2D graphics API that is supported both in Windows7 and WindowsXP
SDL.
check out http://www.libsdl.org/
It's what i've used for simple top down games and such, very very easy to learn!
You may check out agge - https://github.com/tyoma/agge.
It's a CPU-only rendering engine that beats Direct2D in the cases it supports.
The library is limited at the moment, it doesn't support textured/gradient filling, but otherwise is quite simple to use and has STL-lite spirit (in the sense it's more a set of algorithms than a fat interface like GDI's HDC or ID2D1RenderTarget).
Since it's CPU only, it's a cross-platform solution (samples can be compiled for Windows/Mac/Android/ Linux (there's no support for X11 XImage as underlying surface yet)).

windows ce - 2d graphics library

I have Windows CE 5.0 device and it doesn't support any hardware accelearation.
I am looking for some good 2d graphics library to do following things.
I prefer backend programming in Compact .Net Framework.
Drawing fonts with antialiasing.
drawing lines, and simple vector objects with antialiasing.
I am not doing animation, so i don't care about frames per seconds performance.
i have looked into following libraries, but nothing suits me.
opengl (vincent 3d software rendering) - works, but api is very low level and complex.
openvg - no software implementation for windows ce.
Cairo - api is very neat, but no wince build.
Adobe Flash - installs as browser plugin , no activex support in wince.
Anti-aliased fonts in .Net CF 2.0+ can be done with Microsoft.WindowsCE.Form.LogFont -- after creating your logfont, you can use it with any WinForms widget's .Font property by converting it using System.Drawing.Font.FromLogFont().
...you might need to enable anti-aliasing in the registry for these to render properly, see this MSDN article for the right keys: [http://msdn.microsoft.com/en-us/library/ms901096.aspx][1].
There was a decent implementation of GDI+ for .Net CF 1.0 called "XrossOne Mobile GDI+", it's not longer supported, but you can get the source code here: http://www.isquaredsoftware.com/XrossOneGDIPlus.php -- Run it through the import wizard on VS2008 to build it for later versions of CF. I liked this library for its alpha transparency support without hardware acceleration, rounded rectangles and gradient support.
Someone was advertising this library in some forum. It's for Windows Mobile, but you can check it out. I have no experience with it.
link
I have Google's skia library compiling under WindowsCE, although I haven't done much with it yet :) It wasn't too hard to get working. It does support a OpenGL/ES backend.
There is also AGG (Anti Grain Geometry) which is a heavy C++ library based on templates.

Resources