It’s the result of this code:
_renderer = new Renderer(this, 6500);
_renderer.MapBuffer();
var fontMap = new FontMap(_renderer, new Size(512, 512));
fontMap.AddGlyphSet(FontMap.BasicLatin, “Times New Roman”, 10, Style.Normal, Weight.Normal, Underline.None);
fontMap.AddGlyphSet(FontMap.BasicLatin, “Times New Roman”, 16, Style.Normal, Weight.Normal, Underline.None);
fontMap.GenerateFontMap();
// Renderer, FontMap, MaxWidth, MaxHeight, FontName, FontSize, FontStyle, FontWeight, FontUnderline, PosX|Y|Z
_block = new Block(_renderer, fontMap, 790, 600, “Times New Roman”, 16, Style.Normal, Weight.Normal, Underline.None, 0, 0, 0);
_block.SetText(Text, Block.Alignment.Center);
So, basically the fontmap uses Pango to paint all the glyphs that you need (e.g., FontMap.BasicLatin) into a dynamically managed buffer.
The rendered glyphs are sorted with an offshoot of the Cygon Bin Packer and then an opengl texture is generated with “GenerateFontMap()” call.
Well, after generating the texture you can access any glyph information by calling
glyphInfo = _fontMap.GetGlyph(Character, FontName, Size, Style, Weight, Underline);
The glyphInfo contains everything you need to successfully render a single glyph (e.g., position on the texture, index of the texture, bearingX|Y, advanceX|Y, etc).
It’s quite neat, but the dependency on Mono makes it all quite … distasteful. On the other hand, I doubt you’ll find faster dynamic text. Sure it may suffer against static text, but for my uses this was what I needed.