12 #ifndef ROOT_FontCache
13 #define ROOT_FontCache
20 #include <ApplicationServices/ApplicationServices.h>
47 FontStruct_t LoadFont(
const X11::XLFDName &xlfd);
48 void UnloadFont(FontStruct_t font);
50 char **ListFonts(
const X11::XLFDName &xlfd,
int maxNames,
int &count);
51 void FreeFontNames(
char **fontList);
53 unsigned GetTextWidth(FontStruct_t font,
const char *text,
int nChars);
54 void GetFontProperties(FontStruct_t font,
int &maxAscent,
int &maxDescent);
57 CTFontRef SelectFont(Font_t fontIndex, Float_t fontSize);
61 void GetTextBounds(UInt_t &w, UInt_t &h,
const char *text)
const;
62 void GetTextBounds(UInt_t &w, UInt_t &h,
const std::vector<UniChar> & unichars)
const;
64 double GetAscent()
const;
65 double GetAscent(
const char *text)
const;
66 double GetAscent(
const std::vector<UniChar> & unichars)
const;
67 double GetDescent()
const;
68 double GetDescent(
const char *text)
const;
69 double GetDescent(
const std::vector<UniChar> & unichars)
const;
70 double GetLeading()
const;
76 CTFontRef SelectSymbolFont(Float_t fontSize,
unsigned fontIndex);
78 typedef Util::CFStrongReference<CTFontRef> CTFontGuard_t;
81 std::map<CTFontRef, CTFontGuard_t> fLoadedFonts;
82 typedef std::map<CTFontRef, CTFontGuard_t>::iterator font_iterator;
83 typedef std::map<CTFontRef, CTFontGuard_t>::const_iterator const_font_iterator;
86 typedef std::map<UInt_t, CTFontGuard_t> FontMap_t;
87 typedef FontMap_t::iterator font_map_iterator;
88 typedef FontMap_t::const_iterator const_font_map_iterator;
90 FontMap_t fFonts[nPadFonts];
91 CTFontRef fSelectedFont;
103 std::vector<char *> fList;
104 std::vector<char> fStringData;
107 std::list<FontList> fFontLists;
110 typedef std::map<std::string, std::string> PSNameMap_t;
111 PSNameMap_t fXLFDtoPostscriptNames;
113 FontCache(
const FontCache &rhs);
114 FontCache &operator = (
const FontCache &rhs);
116 bool fSymbolFontRegistered;