Skip to main content

Fonts

Ibex supports TrueType fonts. When Ibex starts font information is read from font files. By default Ibex looks for font files in:

  • c:\windows\fonts- on Windows
  • /usr/share/fonts/truetype - on Linux

If fonts are stored in other than these default locations your can tell Ibex where to find them by using a FontFinder object as shown here:

using ibex4.fontdatabase;
...
FontFinder finder = new FontFinder();
finder.addSearchPath(@"c:\windows\fonts\");
finder.addSearchPath(@"d:\windows\fonts\");
FODocument doc = new FODocument(finder);

This approach works on Windows and Linux. Information on how to list the fonts which Ibex can use can be found in the here.

How Ibex uses fonts

Your FO file contains a series of letters. Each of which is stored in the file as a one or two byte code point such as 65 for 'A' or 0x8226 for the bullet character.

Ibex reads a TrueType font file and looks in the font to see if the font supports that particular code point. If it does, then the font maps that code point to a glyph, which is what gets displayed.

Not all fonts support all code points. For example arial.ttf is 370 KB in size, whereas arialuni.ttf is 23,000 KB, because arialuni has glyphs for a many more code points that arial.ttf.

Not all fonts map a code point to the same glyph. Some fonts map code points they do not support to a glyph such as the square box one.