1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2009 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
13 #ifndef __FONT_MANAGER_H__
14 #define __FONT_MANAGER_H__
18 #include FT_FREETYPE_H
20 #include "moon-path.h"
23 struct ManagedStreamCallbacks
;
27 bool FontWeightIsBold (FontWeights weight
);
31 //double horiBearingY;
46 struct FontFaceExtents
{
47 double underline_thickness
;
48 double underline_position
;
63 FontFace (FontManager
*manager
, FT_Face face
, char *key
);
69 const char *GetFamilyName ();
70 const char *GetStyleName ();
76 gunichar
GetCharFromIndex (guint32 index
);
77 guint32
GetCharIndex (gunichar unichar
);
78 bool HasChar (gunichar unichar
);
80 void GetExtents (double size
, FontFaceExtents
*extents
);
81 double Kerning (double size
, guint32 left
, guint32 right
);
82 bool LoadGlyph (double size
, GlyphInfo
*glyph
, StyleSimulations simulate
= StyleSimulationsNone
);
86 friend class FontFace
;
88 GHashTable
*resources
;
94 FontFace
*OpenFontResource (const char *resource
, const char *family
, int index
, FontStretches stretch
, FontWeights weight
, FontStyles style
);
95 FontFace
*OpenSystemFont (const char *family
, FontStretches stretch
, FontWeights weight
, FontStyles style
);
96 FontFace
*OpenFontFace (const char *filename
, const char *guid
, int index
);
102 void AddResource (const char *resource
, const char *path
);
103 char *AddResource (ManagedStreamCallbacks
*stream
);
105 FontFace
*OpenFont (const char *name
, FontStretches stretch
, FontWeights weight
, FontStyles style
);
106 FontFace
*OpenFont (const char *name
, int index
);
109 #endif /* __FONT_MANAGER_H__ */