As I study the code, I'm going to fill this page.

Text rendering on Linux(Pango).(how can I make this text section????)

Of cource, gfx takes text, and it breaks down to textruns. Then, what exactly happening under the hood? Basically, there is two dive into gfx to render the page. One is for making gfx do glyph-level layout, and aquiring the result of textruns, in turn, using that information, gecko do css-box-level layout with frames (a.k.a. reflow). The other is for actually making gfx draw graphics using the combied glyph-level- and css-box-level- geometric information.


This is lying under gfx, with wearing thebes. ;) Cairo interacts with gfx's text rendering in some way. One is by becoming by proxy of gfx and Freetype. Because Freetype's glyph data is destined to Cairo, gfx instructs Freetype only via Cairo. Thus, actual glyph vector data are stop at Cairo, in the form which Cairo likes.


Pango is for doing layout of glyphs. But, gfx doesn't use the high level PangoLayout. Instead, it interacts it deeply. First of all, Pango doesn't render at all. Pango is only used for calculating positions of glyphs. Then evenry resultant information are passed back to gfx. How gfx communicate with Pango?


This enables font selection. Various CSS values are passed as FC_Pattern.


This extracts glyphs from actual font files residing in the system. At this level, RTL glyphs are exactly same as LTR glyphs. This means. glyph's coordinate is tied to screen coordinate, not the text coordinate in which the glyph may belong to. So, while we render glyphs, we must do x-=width.


The files

gfxFont.cpp gfxFont.h: this is for platform-independent header related Fonts.


Various caches:

textrun, glyph metrics, extents.

The flowchart.

1st: Glyph Layout part.

How extents are retreaved??? And cached??

gfx_pango_fc_font_get_glyph_extents() is called every time glyph extents is needed by Pango's shapers.

2nd: Glyph Rendering part.

gfxFont.cpp:333 gfxFont::Draw() does final rendering of all glyphs rendered on Firefox, even including UI.