- FontInfo(string const & pat)
- : pattern(pat) { init(); }
-
- /// Destructor
- ~FontInfo() { release(); }
-
- /// Does any font match our pattern?
- bool exist() {
- query();
- return matches != 0;
- }
-
- /// Is this font scalable?
- bool isScalable() {
- query();
- return scalable;
- }
-
- /// Get existing pattern
- string getPattern() const { return pattern; }
-
- /// Set new pattern
- void setPattern(string const & pat);
-
- /** Return full name of font close to this size.
- If impossible, result is the empty string */
- string getFontname(int size);
-private:
- /// Font pattern (with wildcard for size)
- string pattern;
-
- /// Available size list
- int * sizes;
+ FontInfo(
+ FontFamily family,
+ FontSeries series,
+ FontShape shape,
+ FontSize size,
+ ColorCode color,
+ ColorCode background,
+ FontState emph,
+ FontState underbar,
+ FontState noun,
+ FontState number
+ ): family_(family), series_(series), shape_(shape), size_(size),
+ color_(color), background_(background), emph_(emph),
+ underbar_(underbar), noun_(noun), number_(number)
+ {}
+
+ /// Decreases font size by one
+ FontInfo & decSize();
+ /// Increases font size by one
+ FontInfo & incSize();
+
+ /// Accessor methods.
+ ///@{
+ FontFamily family() const { return family_; }
+ void setFamily(FontFamily f) { family_ = f; }
+ FontSeries series() const { return series_; }
+ void setSeries(FontSeries s) { series_ = s; }
+ FontShape shape() const { return shape_; }
+ void setShape(FontShape s) { shape_ = s; }
+ FontSize size() const { return size_; }
+ void setSize(FontSize s) { size_ = s; }
+ FontState emph() const { return emph_; }
+ void setEmph(FontState e) { emph_ = e; }
+ FontState underbar() const { return underbar_; }
+ void setUnderbar(FontState u) { underbar_ = u; }
+ FontState noun() const { return noun_; }
+ void setNoun(FontState n) { noun_ = n; }
+ FontState number() const { return number_; }
+ void setNumber(FontState n) { number_ = n; }
+ ColorCode color() const { return color_; }
+ void setColor(ColorCode c) { color_ = c; }
+ ColorCode background() const { return background_; }
+ void setBackground(ColorCode b) { background_ = b; }
+ ///@}