1 /** \file lvwin32fontman.cpp
2     \brief Win32 font manager interface
3 
4     CoolReader Engine
5 
6 
7     (c) Vadim Lopatin, 2000-2006
8     This source code is distributed under the terms of
9     GNU General Public License.
10 
11     See LICENSE file for details.
12 
13 */
14 
15 #ifndef __LV_WIN32FONTMAN_H_INCLUDED__
16 #define __LV_WIN32FONTMAN_H_INCLUDED__
17 
18 #include "../../include/crsetup.h"
19 #include "../../include/lvfntman.h"
20 
21 #include "lvfontcache.h"
22 
23 
24 #if !defined(__SYMBIAN32__) && defined(_WIN32) && USE_FREETYPE != 1
25 
26 class LVWin32FontManager : public LVFontManager
27 {
28 private:
29     lString8    _path;
30     LVFontCache _cache;
31     //FILE * _log;
32 public:
GetFontCount()33     virtual int GetFontCount()
34     {
35         return _cache.length();
36     }
37     virtual ~LVWin32FontManager();
38     LVWin32FontManager();
gc()39     virtual void gc() // garbage collector
40     {
41         _cache.gc();
42     }
43     virtual LVFontRef GetFont(int size, int weight, bool bitalic, css_font_family_t family, lString8 typeface,
44                               int features=0, int documentId = -1, bool useBias=false);
45 
46     virtual bool RegisterFont( const LOGFONTA * lf );
RegisterFont(lString8 name)47     virtual bool RegisterFont( lString8 name )
48     {
49         return false;
50     }
51     virtual bool Init( lString8 path );
52 
getFaceList(lString32Collection & list)53     virtual void getFaceList( lString32Collection & list )
54     {
55         _cache.getFaceList(list);
56     }
57     /// returns registered font files
58     virtual void getFontFileNameList( lString32Collection & list );
59 };
60 
61 #endif  // !defined(__SYMBIAN32__) && defined(_WIN32) && USE_FREETYPE!=1
62 
63 #endif  // __LV_WIN32FONTMAN_H_INCLUDED__
64