20 #ifndef AGG_FONT_FREETYPE_INCLUDED 21 #define AGG_FONT_FREETYPE_INCLUDED 24 #include FT_FREETYPE_H 27 #include "agg_scanline_storage_aa.h" 28 #include "agg_scanline_storage_bin.h" 29 #include "agg_scanline_u.h" 30 #include "agg_scanline_bin.h" 31 #include "agg_path_storage_integer.h" 32 #include "agg_rasterizer_scanline_aa.h" 33 #include "agg_conv_curve.h" 34 #include "agg_font_cache_manager.h" 35 #include "agg_trans_affine.h" 57 void resolution(
unsigned dpi);
58 bool load_font(
const char* font_name,
unsigned face_index, glyph_rendering ren_type,
59 const char* font_mem = 0,
const long font_mem_size = 0);
60 bool attach(
const char* file_name);
61 bool char_map(FT_Encoding map);
62 bool height(
double h);
70 template<
class GammaF>
void gamma(
const GammaF& f)
72 m_rasterizer.gamma(f);
77 int last_error()
const {
return m_last_error; }
78 unsigned resolution()
const {
return m_resolution; }
79 const char* name()
const {
return m_name; }
80 unsigned num_faces()
const;
81 FT_Encoding char_map()
const {
return m_char_map; }
82 double height()
const {
return double(m_height) / 64.0; }
83 double width()
const {
return double(m_width) / 64.0; }
84 double ascender()
const;
85 double descender()
const;
86 bool hinting()
const {
return m_hinting; }
87 bool flip_y()
const {
return m_flip_y; }
92 const char* font_signature()
const {
return m_signature; }
93 int change_stamp()
const {
return m_change_stamp; }
95 bool prepare_glyph(
unsigned glyph_code);
96 unsigned glyph_index()
const {
return m_glyph_index; }
97 unsigned data_size()
const {
return m_data_size; }
98 glyph_data_type data_type()
const {
return m_data_type; }
99 const rect_i& bounds()
const {
return m_bounds; }
100 double advance_x()
const {
return m_advance_x; }
101 double advance_y()
const {
return m_advance_y; }
102 void write_glyph_to(int8u* data)
const;
103 bool add_kerning(
unsigned first,
unsigned second,
104 double* x,
double* y);
110 void update_char_size();
111 void update_signature();
112 int find_face(
const char* face_name)
const;
119 unsigned m_face_index;
120 FT_Encoding m_char_map;
126 bool m_library_initialized;
127 FT_Library m_library;
130 unsigned m_num_faces;
131 unsigned m_max_faces;
134 glyph_rendering m_glyph_rendering;
135 unsigned m_glyph_index;
136 unsigned m_data_size;
137 glyph_data_type m_data_type;
149 scanlines_aa_type m_scanlines_aa;
150 scanlines_bin_type m_scanlines_bin;