For backward compatibility, a new subprogram From_Description has been added to this package, which gives access to the more advanced font handling.
This is the base package for handling fonts. GtkAda knows about bitmap and vectorial fonts, and can draw both. The list of fonts available to you depends on what is installed on your system.
The name of the font is indicated in the standard X11 fashion, namely: (example extracted from the Xlib manual):
-adobe-courier-bold-o-normal--10-100-75-75-m-60-iso8859-1 where: - adobe : foundry - courier : font family - bold : weight (e.g. bold, medium) - o : slant (e.g. roman, italic, oblique) - normal : set width (e.g. normal, condensed, narrow, double) - 10 : pixels - 100 : points (in tenths of a point) - 75 : horizontal resolution in dpi - 75 : vertical resolution in dpi - m : spacing (e.g. monospace or proportional) - 60 : average width (in tenths of a pixel) - iso8859-1 : character set
Any of the fields can have a '*' instead, so that the system will automatically find a font that matches the rest of the string, and won't care about that specific field.
An easy way to select a font is by using some external programs, for instance xfontsel, xlsfont, gfontsel, or even the font selection dialog example in the testgtk/ directory of the GtkAda distribution.
But the easiest way to create a font is to use a Pango_Font_Description. See package Pango.Font for more details about this structure.
Some of the functions below should be used only for wide-character strings. This is needed for languages with more than 256 characters.
Wide character values between 0 and 127 are always identical in meaning to the ASCII character codes. An alternative to wide characters is multi-byte characters, which extend normal char strings to cope with larger character sets. As the name suggests, multi-byte characters use a different number of bytes to store different character codes. For example codes 0-127 (i.e. the ASCII codes) often use just one byte of memory, while other codes may use 2, 3 or even 4 bytes. Multi-byte characters have the advantage that they can often be used in an application with little change, since strings are still represented as arrays of char values. However multi-byte strings are much easier to manipulate since the character are all of the same size.
On Unix systems, the external utility 'xfd' can be used to display all the characters in a font.
See From_Description below for another way of creating a Gdk_Font.