OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
3 * Copyright © 2009 Keith Stribley | 3 * Copyright © 2009 Keith Stribley |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 static hb_bool_t | 130 static hb_bool_t |
131 hb_ft_get_glyph_v_origin (hb_font_t *font HB_UNUSED, | 131 hb_ft_get_glyph_v_origin (hb_font_t *font HB_UNUSED, |
132 void *font_data, | 132 void *font_data, |
133 hb_codepoint_t glyph, | 133 hb_codepoint_t glyph, |
134 hb_position_t *x, | 134 hb_position_t *x, |
135 hb_position_t *y, | 135 hb_position_t *y, |
136 void *user_data HB_UNUSED) | 136 void *user_data HB_UNUSED) |
137 { | 137 { |
138 FT_Face ft_face = (FT_Face) font_data; | 138 FT_Face ft_face = (FT_Face) font_data; |
139 int load_flags = FT_LOAD_DEFAULT; | 139 int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING; |
140 | 140 |
141 if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags))) | 141 if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags))) |
142 return false; | 142 return false; |
143 | 143 |
144 /* Note: FreeType's vertical metrics grows downward while other FreeType coord
inates | 144 /* Note: FreeType's vertical metrics grows downward while other FreeType coord
inates |
145 * have a Y growing upward. Hence the extra negation. */ | 145 * have a Y growing upward. Hence the extra negation. */ |
146 *x = ft_face->glyph->metrics.horiBearingX - ft_face->glyph->metrics.vertBear
ingX; | 146 *x = ft_face->glyph->metrics.horiBearingX - ft_face->glyph->metrics.vertBear
ingX; |
147 *y = ft_face->glyph->metrics.horiBearingY - (-ft_face->glyph->metrics.vertBear
ingY); | 147 *y = ft_face->glyph->metrics.horiBearingY - (-ft_face->glyph->metrics.vertBear
ingY); |
148 | 148 |
149 return true; | 149 return true; |
(...skipping 28 matching lines...) Expand all Loading... |
178 } | 178 } |
179 | 179 |
180 static hb_bool_t | 180 static hb_bool_t |
181 hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED, | 181 hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED, |
182 void *font_data, | 182 void *font_data, |
183 hb_codepoint_t glyph, | 183 hb_codepoint_t glyph, |
184 hb_glyph_extents_t *extents, | 184 hb_glyph_extents_t *extents, |
185 void *user_data HB_UNUSED) | 185 void *user_data HB_UNUSED) |
186 { | 186 { |
187 FT_Face ft_face = (FT_Face) font_data; | 187 FT_Face ft_face = (FT_Face) font_data; |
188 int load_flags = FT_LOAD_DEFAULT; | 188 int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING; |
189 | 189 |
190 if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags))) | 190 if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags))) |
191 return false; | 191 return false; |
192 | 192 |
193 extents->x_bearing = ft_face->glyph->metrics.horiBearingX; | 193 extents->x_bearing = ft_face->glyph->metrics.horiBearingX; |
194 extents->y_bearing = ft_face->glyph->metrics.horiBearingY; | 194 extents->y_bearing = ft_face->glyph->metrics.horiBearingY; |
195 extents->width = ft_face->glyph->metrics.width; | 195 extents->width = ft_face->glyph->metrics.width; |
196 extents->height = -ft_face->glyph->metrics.height; | 196 extents->height = -ft_face->glyph->metrics.height; |
197 return true; | 197 return true; |
198 } | 198 } |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 513 |
514 FT_Face | 514 FT_Face |
515 hb_ft_font_get_face (hb_font_t *font) | 515 hb_ft_font_get_face (hb_font_t *font) |
516 { | 516 { |
517 if (font->destroy == (hb_destroy_func_t) FT_Done_Face || | 517 if (font->destroy == (hb_destroy_func_t) FT_Done_Face || |
518 font->destroy == (hb_destroy_func_t) _do_nothing) | 518 font->destroy == (hb_destroy_func_t) _do_nothing) |
519 return (FT_Face) font->user_data; | 519 return (FT_Face) font->user_data; |
520 | 520 |
521 return NULL; | 521 return NULL; |
522 } | 522 } |
OLD | NEW |