Advertisement
Guest User

Harfbuzz ssty feature

a guest
Dec 22nd, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. buf = hb_buffer_create();
  2. hb_buffer_set_script(buf, HB_SCRIPT_LATIN);
  3. hb_buffer_set_direction(buf, HB_DIRECTION_LTR);
  4. hb_buffer_set_language(buf, hb_language_get_default());
  5.        
  6. hb_feature_t *features = NULL;
  7. const hb_tag_t math_ssty_tag = HB_TAG('s', 's', 't', 'y');
  8. int num_features = 0;
  9. if (cur_style <= math_script_style) {
  10.     features = malloc(sizeof(hb_feature_t));
  11.     num_features = 1;
  12.     features[0] = (hb_feature_t){ math_ssty_tag, 1, 0, UINT_MAX };
  13. }
  14.        
  15. hb_buffer_add_utf32(buf, unicode_char, 1, 0, 1);
  16. hb_shape(font, buf, features, num_features);
  17.        
  18. glyph_info   = hb_buffer_get_glyph_infos(buf, &glyph_count);
  19.        
  20. assert(glyph_count == 1);
  21.        
  22. hb_codepoint_t glyph_code = glyph_info[0].codepoint;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement