1 module pango.fontmap;
2 
3 import pango.utils;
4 import pango.font;
5 import pango.fontset;
6 import pango.context;
7 import pango.language;
8 import pango.c.fontmap;
9 
10 import gobject;
11 import glib;
12 
13 
14 /**
15 * PangoFontMap:
16 *
17 * The #PangoFontMap represents the set of fonts available for a
18 * particular rendering system. This is a virtual object with
19 * implementations being specific to particular rendering systems.  To
20 * create an implementation of a #PangoFontMap, the rendering-system
21 * specific code should allocate a larger structure that contains a nested
22 * #PangoFontMap, fill in the <structfield>klass</structfield> member of the nested #PangoFontMap with a
23 * pointer to a appropriate #PangoFontMapClass, then call
24 * pango_font_map_init() on the structure.
25 *
26 * The #PangoFontMap structure contains one member which the implementation
27 * fills in.
28 */
29 abstract class FontMap : D_GObject
30 {
31     mixin GObjectHolder!PangoFontMap;
32 
33     package this(PangoFontMap *ptr, Transfer transfer) {
34         super(cast(GObject*)ptr, transfer);
35     }
36 
37     abstract Context createContext();
38 
39     abstract Font loadFont(Context context, const(FontDescription) desc);
40 
41     abstract FontSet loadFontSet(Context context, const(FontDescription) desc, Language language);
42 
43 
44     FontFamily[] listFamilies()
45     {
46         return listGObjects!(FontFamily, pango_font_map_list_families)(nativePtr, Transfer.None);
47     }
48 
49 
50     @property uint serial() {
51         return pango_font_map_get_serial(nativePtr);
52     }
53 
54     version (Backend) {
55         void changed() {
56             pango_font_map_changed(nativePtr);
57         }
58     }
59 
60 }
61 
62