OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2013 Google, Inc. | 2 * Copyright © 2013 Google, Inc. |
3 * | 3 * |
4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
5 * | 5 * |
6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
10 * all copies of this software. | 10 * all copies of this software. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 static void | 53 static void |
54 collect_features_hangul (hb_ot_shape_planner_t *plan) | 54 collect_features_hangul (hb_ot_shape_planner_t *plan) |
55 { | 55 { |
56 hb_ot_map_builder_t *map = &plan->map; | 56 hb_ot_map_builder_t *map = &plan->map; |
57 | 57 |
58 for (unsigned int i = FIRST_HANGUL_FEATURE; i < HANGUL_FEATURE_COUNT; i++) | 58 for (unsigned int i = FIRST_HANGUL_FEATURE; i < HANGUL_FEATURE_COUNT; i++) |
59 map->add_feature (hangul_features[i], 1, F_NONE); | 59 map->add_feature (hangul_features[i], 1, F_NONE); |
60 } | 60 } |
61 | 61 |
| 62 static void |
| 63 override_features_hangul (hb_ot_shape_planner_t *plan) |
| 64 { |
| 65 /* Uniscribe does not apply 'calt' for Hangul, and certain fonts |
| 66 * (Noto Sans CJK, Source Sans Han, etc) apply all of jamo lookups |
| 67 * in calt, which is not desirable. */ |
| 68 plan->map.add_feature (HB_TAG('c','a','l','t'), 0, F_GLOBAL); |
| 69 } |
| 70 |
62 struct hangul_shape_plan_t | 71 struct hangul_shape_plan_t |
63 { | 72 { |
64 ASSERT_POD (); | 73 ASSERT_POD (); |
65 | 74 |
66 hb_mask_t mask_array[HANGUL_FEATURE_COUNT]; | 75 hb_mask_t mask_array[HANGUL_FEATURE_COUNT]; |
67 }; | 76 }; |
68 | 77 |
69 static void * | 78 static void * |
70 data_create_hangul (const hb_ot_shape_plan_t *plan) | 79 data_create_hangul (const hb_ot_shape_plan_t *plan) |
71 { | 80 { |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 } | 406 } |
398 | 407 |
399 HB_BUFFER_DEALLOCATE_VAR (buffer, hangul_shaping_feature); | 408 HB_BUFFER_DEALLOCATE_VAR (buffer, hangul_shaping_feature); |
400 } | 409 } |
401 | 410 |
402 | 411 |
403 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul = | 412 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul = |
404 { | 413 { |
405 "hangul", | 414 "hangul", |
406 collect_features_hangul, | 415 collect_features_hangul, |
407 NULL, /* override_features */ | 416 override_features_hangul, |
408 data_create_hangul, /* data_create */ | 417 data_create_hangul, /* data_create */ |
409 data_destroy_hangul, /* data_destroy */ | 418 data_destroy_hangul, /* data_destroy */ |
410 preprocess_text_hangul, | 419 preprocess_text_hangul, |
411 HB_OT_SHAPE_NORMALIZATION_MODE_NONE, | 420 HB_OT_SHAPE_NORMALIZATION_MODE_NONE, |
412 NULL, /* decompose */ | 421 NULL, /* decompose */ |
413 NULL, /* compose */ | 422 NULL, /* compose */ |
414 setup_masks_hangul, /* setup_masks */ | 423 setup_masks_hangul, /* setup_masks */ |
415 HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, | 424 HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, |
416 false, /* fallback_position */ | 425 false, /* fallback_position */ |
417 }; | 426 }; |
OLD | NEW |