2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1997 Asger Alstrup
10 * ====================================================== */
21 /** This class manages a font.
22 The idea is to create a FontInfo object with a font name pattern with a
23 wildcard at the size field. Then this object can host request for font-
24 instances of any given size. If no exact match is found, the closest size
25 is chosen instead. If the font is scalable, the flag lyxrc.use_scalable_fonts
26 determines whether to allow scalable fonts to give an exact match. */
30 FontInfo() { init(); }
33 explicit FontInfo(string const & pat)
34 : pattern(pat) { init(); }
37 ~FontInfo() { release(); }
39 /// Does any font match our pattern?
45 /// Is this font scalable?
51 /// Get existing pattern
52 string getPattern() const { return pattern; }
55 void setPattern(string const & pat);
57 /** Return full name of font close to this size.
58 If impossible, result is the empty string */
59 string getFontname(int size);
61 /// Font pattern (with wildcard for size)
64 /// Available size list
67 /// Corresponding name list
73 /// Did we query X about this font?
76 /// Is this font scalable?
79 /// Which index points to scalable font entry?
82 /// Initialize empty record
85 /// Release allocated stuff
88 /// Ask X11 about this font pattern
91 /// Build newly sized font string
92 string resize(string const &, int size) const;