16 #ifndef AGG_FONT_WIN32_TT_INCLUDED 17 #define AGG_FONT_WIN32_TT_INCLUDED 20 #include "agg_scanline_storage_aa.h" 21 #include "agg_scanline_storage_bin.h" 22 #include "agg_scanline_u.h" 23 #include "agg_scanline_bin.h" 24 #include "agg_path_storage_integer.h" 25 #include "agg_rasterizer_scanline_aa.h" 26 #include "agg_conv_curve.h" 27 #include "agg_trans_affine.h" 28 #include "agg_font_cache_manager.h" 36 enum { buf_size = 32768-32 };
51 void resolution(
unsigned dpi) { m_resolution = unsigned(dpi); }
52 void height(
double h) { m_height = unsigned(h); }
53 void width(
double w) { m_width = unsigned(w); }
54 void weight(
int w) { m_weight = w; }
55 void italic(
bool it) { m_italic = it; }
56 void char_set(DWORD c) { m_char_set = c; }
57 void pitch_and_family(DWORD p){ m_pitch_and_family = p; }
58 void flip_y(
bool flip) { m_flip_y = flip; }
59 void hinting(
bool h) { m_hinting = h; }
60 bool create_font(
const char* typeface_, glyph_rendering ren_type);
62 bool create_font(
const char* typeface_,
63 glyph_rendering ren_type,
66 int weight_=FW_REGULAR,
68 DWORD char_set_=ANSI_CHARSET,
69 DWORD pitch_and_family_=FF_DONTCARE);
73 template<
class GammaF>
void gamma(
const GammaF& f)
75 m_rasterizer.gamma(f);
86 unsigned resolution()
const {
return m_resolution; }
87 const char* typeface()
const {
return m_typeface; }
88 double height()
const {
return m_height; }
89 double width()
const {
return m_width; }
90 int weight()
const {
return m_weight; }
91 bool italic()
const {
return m_italic; }
92 DWORD char_set()
const {
return m_char_set; }
93 DWORD pitch_and_family()
const {
return m_pitch_and_family; }
94 bool hinting()
const {
return m_hinting; }
95 bool flip_y()
const {
return m_flip_y; }
100 const char* font_signature()
const {
return m_signature; }
101 int change_stamp()
const {
return m_change_stamp; }
103 bool prepare_glyph(
unsigned glyph_code);
104 unsigned glyph_index()
const {
return m_glyph_index; }
105 unsigned data_size()
const {
return m_data_size; }
106 glyph_data_type data_type()
const {
return m_data_type; }
107 const rect_i& bounds()
const {
return m_bounds; }
108 double advance_x()
const {
return m_advance_x; }
109 double advance_y()
const {
return m_advance_y; }
110 void write_glyph_to(int8u* data)
const;
111 bool add_kerning(
unsigned first,
unsigned second,
112 double* x,
double* y);
118 void update_signature();
119 void load_kerning_pairs();
120 void sort_kerning_pairs();
121 int find_font(
const char* name)
const;
127 unsigned m_num_fonts;
128 unsigned m_max_fonts;
134 unsigned m_typeface_len;
141 DWORD m_pitch_and_family;
146 unsigned m_resolution;
147 glyph_rendering m_glyph_rendering;
148 unsigned m_glyph_index;
149 unsigned m_data_size;
150 glyph_data_type m_data_type;
156 KERNINGPAIR* m_kerning_pairs;
157 unsigned m_num_kerning_pairs;
158 unsigned m_max_kerning_pairs;
167 scanlines_aa_type m_scanlines_aa;
168 scanlines_bin_type m_scanlines_bin;