1 // -*- C++ -*- 2 /** 3 * \file FontLoader.h 4 * This file is part of LyX, the document processor. 5 * Licence details can be found in the file COPYING. 6 * 7 * \author Abdelrazak Younes 8 * 9 * Full author contact details are available in file CREDITS. 10 */ 11 12 #ifndef FONTLOADER_H 13 #define FONTLOADER_H 14 15 #include "support/strfwd.h" 16 17 namespace lyx { 18 19 class FontInfo; 20 21 namespace frontend { 22 23 class FontMetrics; 24 25 /// Hold info about a particular font 26 class FontLoader 27 { 28 public: 29 /// 30 FontLoader(); 31 /// Clears cache 32 ~FontLoader(); 33 34 /// Update fonts after zoom, dpi, font names, or norm change 35 // (basically by deleting all cached values) 36 void update(); 37 38 /// Is the given font available ? 39 bool available(FontInfo const & f); 40 41 /// Can the given symbol be displayed in general? 42 bool canBeDisplayed(char_type c); 43 44 /// Get the Font metrics for this FontInfo 45 FontMetrics const & metrics(FontInfo const & f); 46 }; 47 48 49 } // namespace frontend 50 51 /// Implementation is in Application.cpp 52 extern frontend::FontLoader & theFontLoader(); 53 54 } // namespace lyx 55 56 #endif // FONTLOADER_H 57