| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * Copyright © 2011 Google, Inc. | 3 * Copyright © 2011 Google, Inc. |
| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 | 38 |
| 39 | 39 |
| 40 /* | 40 /* |
| 41 * hb_font_funcs_t | 41 * hb_font_funcs_t |
| 42 */ | 42 */ |
| 43 | 43 |
| 44 #define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS \ | 44 #define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS \ |
| 45 HB_FONT_FUNC_IMPLEMENT (font_h_extents) \ | 45 HB_FONT_FUNC_IMPLEMENT (font_h_extents) \ |
| 46 HB_FONT_FUNC_IMPLEMENT (font_v_extents) \ | 46 HB_FONT_FUNC_IMPLEMENT (font_v_extents) \ |
| 47 HB_FONT_FUNC_IMPLEMENT (glyph) \ | 47 HB_FONT_FUNC_IMPLEMENT (nominal_glyph) \ |
| 48 HB_FONT_FUNC_IMPLEMENT (variation_glyph) \ |
| 48 HB_FONT_FUNC_IMPLEMENT (glyph_h_advance) \ | 49 HB_FONT_FUNC_IMPLEMENT (glyph_h_advance) \ |
| 49 HB_FONT_FUNC_IMPLEMENT (glyph_v_advance) \ | 50 HB_FONT_FUNC_IMPLEMENT (glyph_v_advance) \ |
| 50 HB_FONT_FUNC_IMPLEMENT (glyph_h_origin) \ | 51 HB_FONT_FUNC_IMPLEMENT (glyph_h_origin) \ |
| 51 HB_FONT_FUNC_IMPLEMENT (glyph_v_origin) \ | 52 HB_FONT_FUNC_IMPLEMENT (glyph_v_origin) \ |
| 52 HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning) \ | 53 HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning) \ |
| 53 HB_FONT_FUNC_IMPLEMENT (glyph_v_kerning) \ | 54 HB_FONT_FUNC_IMPLEMENT (glyph_v_kerning) \ |
| 54 HB_FONT_FUNC_IMPLEMENT (glyph_extents) \ | 55 HB_FONT_FUNC_IMPLEMENT (glyph_extents) \ |
| 55 HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \ | 56 HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \ |
| 56 HB_FONT_FUNC_IMPLEMENT (glyph_name) \ | 57 HB_FONT_FUNC_IMPLEMENT (glyph_name) \ |
| 57 HB_FONT_FUNC_IMPLEMENT (glyph_from_name) \ | 58 HB_FONT_FUNC_IMPLEMENT (glyph_from_name) \ |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 { | 174 { |
| 174 memset (extents, 0, sizeof (*extents)); | 175 memset (extents, 0, sizeof (*extents)); |
| 175 return klass->get.f.font_v_extents (this, user_data, | 176 return klass->get.f.font_v_extents (this, user_data, |
| 176 extents, | 177 extents, |
| 177 klass->user_data.font_v_extents); | 178 klass->user_data.font_v_extents); |
| 178 } | 179 } |
| 179 | 180 |
| 180 inline bool has_glyph (hb_codepoint_t unicode) | 181 inline bool has_glyph (hb_codepoint_t unicode) |
| 181 { | 182 { |
| 182 hb_codepoint_t glyph; | 183 hb_codepoint_t glyph; |
| 183 return get_glyph (unicode, 0, &glyph); | 184 return get_nominal_glyph (unicode, &glyph); |
| 184 } | 185 } |
| 185 | 186 |
| 186 inline hb_bool_t get_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_s
elector, | 187 inline hb_bool_t get_nominal_glyph (hb_codepoint_t unicode, |
| 187 » » » hb_codepoint_t *glyph) | 188 » » » » hb_codepoint_t *glyph) |
| 188 { | 189 { |
| 189 *glyph = 0; | 190 *glyph = 0; |
| 190 return klass->get.f.glyph (this, user_data, | 191 return klass->get.f.nominal_glyph (this, user_data, |
| 191 » » » unicode, variation_selector, glyph, | 192 » » » » unicode, glyph, |
| 192 » » » klass->user_data.glyph); | 193 » » » » klass->user_data.nominal_glyph); |
| 194 } |
| 195 |
| 196 inline hb_bool_t get_variation_glyph (hb_codepoint_t unicode, hb_codepoint_t v
ariation_selector, |
| 197 » » » » » hb_codepoint_t *glyph) |
| 198 { |
| 199 *glyph = 0; |
| 200 return klass->get.f.variation_glyph (this, user_data, |
| 201 » » » » » unicode, variation_selector, glyph, |
| 202 » » » » » klass->user_data.variation_glyph); |
| 193 } | 203 } |
| 194 | 204 |
| 195 inline hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) | 205 inline hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) |
| 196 { | 206 { |
| 197 return klass->get.f.glyph_h_advance (this, user_data, | 207 return klass->get.f.glyph_h_advance (this, user_data, |
| 198 glyph, | 208 glyph, |
| 199 klass->user_data.glyph_h_advance); | 209 klass->user_data.glyph_h_advance); |
| 200 } | 210 } |
| 201 | 211 |
| 202 inline hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) | 212 inline hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 { | 490 { |
| 481 /* gidDDD syntax for glyph indices. */ | 491 /* gidDDD syntax for glyph indices. */ |
| 482 if (0 == strncmp (s, "gid", 3) && | 492 if (0 == strncmp (s, "gid", 3) && |
| 483 hb_codepoint_parse (s + 3, len - 3, 10, glyph)) | 493 hb_codepoint_parse (s + 3, len - 3, 10, glyph)) |
| 484 return true; | 494 return true; |
| 485 | 495 |
| 486 /* uniUUUU and other Unicode character indices. */ | 496 /* uniUUUU and other Unicode character indices. */ |
| 487 hb_codepoint_t unichar; | 497 hb_codepoint_t unichar; |
| 488 if (0 == strncmp (s, "uni", 3) && | 498 if (0 == strncmp (s, "uni", 3) && |
| 489 hb_codepoint_parse (s + 3, len - 3, 16, &unichar) && | 499 hb_codepoint_parse (s + 3, len - 3, 16, &unichar) && |
| 490 » get_glyph (unichar, 0, glyph)) | 500 » get_nominal_glyph (unichar, glyph)) |
| 491 return true; | 501 return true; |
| 492 } | 502 } |
| 493 | 503 |
| 494 return false; | 504 return false; |
| 495 } | 505 } |
| 496 | 506 |
| 497 private: | 507 private: |
| 498 inline hb_position_t em_scale (int16_t v, int scale) { return (hb_position_t)
(v * (int64_t) scale / face->get_upem ()); } | 508 inline hb_position_t em_scale (int16_t v, int scale) { return (hb_position_t)
(v * (int64_t) scale / face->get_upem ()); } |
| 499 }; | 509 }; |
| 500 | 510 |
| 501 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS | 511 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS |
| 502 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font); | 512 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font); |
| 503 #include "hb-shaper-list.hh" | 513 #include "hb-shaper-list.hh" |
| 504 #undef HB_SHAPER_IMPLEMENT | 514 #undef HB_SHAPER_IMPLEMENT |
| 505 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS | 515 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS |
| 506 | 516 |
| 507 | 517 |
| 508 #endif /* HB_FONT_PRIVATE_HH */ | 518 #endif /* HB_FONT_PRIVATE_HH */ |
| OLD | NEW |