2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright (C) 1997 Asger Alstrup
10 *======================================================*/
12 #ifndef _FONTLOADER_H_
13 #define _FONTLOADER_H_
19 #include FORMS_H_LOCATION
24 /** This class takes care of loading fonts. It uses FontInfo to make
25 intelligent guesses about matching font size, and it tries different tags
26 itself in order to match the font loading demands. Later, I plan to extend
27 this with support for T1Lib, probably via a new class building on this.
37 /// Update fonts after zoom, dpi, font names, or norm change
41 XFontStruct* load(LyXFont::FONT_FAMILY family,
42 LyXFont::FONT_SERIES series,
43 LyXFont::FONT_SHAPE shape,
44 LyXFont::FONT_SIZE size)
46 if (fontstruct[family][series][shape][size]!=0)
47 return fontstruct[family][series][shape][size];
49 return doLoad(family,series,shape,size);
52 /// Array of font structs
53 XFontStruct* fontstruct[4][2][4][10];
55 /// Array of font infos
56 FontInfo * fontinfo[4][2][4];
58 /// Reset font handler
65 void getFontinfo(LyXFont::FONT_FAMILY family,
66 LyXFont::FONT_SERIES series,
67 LyXFont::FONT_SHAPE shape);
69 /** Does the actual loading of a font. Updates fontstruct. */
70 XFontStruct* doLoad(LyXFont::FONT_FAMILY family,
71 LyXFont::FONT_SERIES series,
72 LyXFont::FONT_SHAPE shape,
73 LyXFont::FONT_SIZE size);