2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1997 Asger Alstrup
10 * ====================================================== */
20 #include FORMS_H_LOCATION
26 /** This class takes care of loading fonts. It uses FontInfo to make
27 intelligent guesses about matching font size, and it tries different tags
28 itself in order to match the font loading demands. Later, I plan to extend
29 this with support for T1Lib, probably via a new class building on this.
39 /// Update fonts after zoom, dpi, font names, or norm change
43 XFontStruct * load(LyXFont::FONT_FAMILY family,
44 LyXFont::FONT_SERIES series,
45 LyXFont::FONT_SHAPE shape,
46 LyXFont::FONT_SIZE size) {
47 if (fontstruct[family][series][shape][size] != 0)
48 return fontstruct[family][series][shape][size];
50 return doLoad(family, series, shape, size);
53 /// Array of font structs
54 XFontStruct * fontstruct[4][2][4][10];
56 /// Array of font infos
57 FontInfo * fontinfo[4][2][4];
59 /// Reset font handler
66 void getFontinfo(LyXFont::FONT_FAMILY family,
67 LyXFont::FONT_SERIES series,
68 LyXFont::FONT_SHAPE shape);
70 /** Does the actual loading of a font. Updates fontstruct. */
71 XFontStruct * doLoad(LyXFont::FONT_FAMILY family,
72 LyXFont::FONT_SERIES series,
73 LyXFont::FONT_SHAPE shape,
74 LyXFont::FONT_SIZE size);
77 extern FontLoader fontloader;