X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFontInfo.h;h=7f4af1d4c7e574953a344c1fc63cf212bacf68c1;hb=ce96d714211fc54fb5d3baf697c967695f641464;hp=d3d2e8b0a08a5b6216c0a7fad11f196be0f87f65;hpb=797d87b4513088a66b17c7ac653b84e36ea80458;p=lyx.git diff --git a/src/FontInfo.h b/src/FontInfo.h index d3d2e8b0a0..7f4af1d4c7 100644 --- a/src/FontInfo.h +++ b/src/FontInfo.h @@ -1,16 +1,16 @@ // -*- C++ -*- /* This file is part of * ====================================================== - * + * * LyX, The Document Processor - * + * * Copyright 1997 Asger Alstrup * and the LyX Team. * * ====================================================== */ #ifndef FONTINFO_H -#define FONTINFO_H +#define FONTINFO_H #ifdef __GNUG__ #pragma interface @@ -18,8 +18,10 @@ #include "LString.h" +#include + /** This class manages a font. - The idea is to create a FontInfo object with a font name pattern with a + The idea is to create a FontInfo object with a font name pattern with a wildcard at the size field. Then this object can host request for font- instances of any given size. If no exact match is found, the closest size is chosen instead. If the font is scalable, the flag @@ -35,9 +37,6 @@ public: explicit FontInfo(string const & pat) : pattern(pat) { init(); } - /// Destructor - ~FontInfo() { release(); } - /// Does any font match our pattern? bool exist() { query(); @@ -51,23 +50,23 @@ public: } /// Get existing pattern - string getPattern() const { return pattern; } + string const & 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); + string const getFontname(int size); private: /// Font pattern (with wildcard for size) string pattern; /// Available size list - int * sizes; + boost::scoped_array sizes; /// Corresponding name list - string * strings; + boost::scoped_array strings; /// Number of matches int matches; @@ -84,13 +83,10 @@ private: /// Initialize empty record void init(); - /// Release allocated stuff - void release(); - /// Ask X11 about this font pattern void query(); - /// Build newly sized font string - string resize(string const &, int size) const; + /// Build newly sized font string + string const resize(string const &, int size) const; }; #endif