| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2011,2014 Google, Inc. | 2 * Copyright © 2011,2014 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return NULL; | 74 return NULL; |
| 75 } | 75 } |
| 76 ot_font->hmtx = OT::Sanitizer<OT::hmtx>::lock_instance (ot_font->hmtx_blob); | 76 ot_font->hmtx = OT::Sanitizer<OT::hmtx>::lock_instance (ot_font->hmtx_blob); |
| 77 | 77 |
| 78 ot_font->cmap_blob = OT::Sanitizer<OT::cmap>::sanitize (font->face->reference_
table (HB_OT_TAG_cmap)); | 78 ot_font->cmap_blob = OT::Sanitizer<OT::cmap>::sanitize (font->face->reference_
table (HB_OT_TAG_cmap)); |
| 79 const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (ot_font->cmap_b
lob); | 79 const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (ot_font->cmap_b
lob); |
| 80 const OT::CmapSubtable *subtable = NULL; | 80 const OT::CmapSubtable *subtable = NULL; |
| 81 const OT::CmapSubtable *subtable_uvs = NULL; | 81 const OT::CmapSubtable *subtable_uvs = NULL; |
| 82 | 82 |
| 83 /* 32-bit subtables. */ | 83 /* 32-bit subtables. */ |
| 84 if (!subtable) subtable = cmap->find_subtable (3, 10); |
| 84 if (!subtable) subtable = cmap->find_subtable (0, 6); | 85 if (!subtable) subtable = cmap->find_subtable (0, 6); |
| 85 if (!subtable) subtable = cmap->find_subtable (0, 4); | 86 if (!subtable) subtable = cmap->find_subtable (0, 4); |
| 86 if (!subtable) subtable = cmap->find_subtable (3, 10); | |
| 87 /* 16-bit subtables. */ | 87 /* 16-bit subtables. */ |
| 88 if (!subtable) subtable = cmap->find_subtable (3, 1); |
| 88 if (!subtable) subtable = cmap->find_subtable (0, 3); | 89 if (!subtable) subtable = cmap->find_subtable (0, 3); |
| 89 if (!subtable) subtable = cmap->find_subtable (3, 1); | 90 if (!subtable) subtable = cmap->find_subtable (0, 2); |
| 91 if (!subtable) subtable = cmap->find_subtable (0, 1); |
| 92 if (!subtable) subtable = cmap->find_subtable (0, 0); |
| 90 /* Meh. */ | 93 /* Meh. */ |
| 91 if (!subtable) subtable = &OT::Null(OT::CmapSubtable); | 94 if (!subtable) subtable = &OT::Null(OT::CmapSubtable); |
| 92 | 95 |
| 93 /* UVS subtable. */ | 96 /* UVS subtable. */ |
| 94 if (!subtable_uvs) subtable_uvs = cmap->find_subtable (0, 5); | 97 if (!subtable_uvs) subtable_uvs = cmap->find_subtable (0, 5); |
| 95 /* Meh. */ | 98 /* Meh. */ |
| 96 if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtable); | 99 if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtable); |
| 97 | 100 |
| 98 ot_font->cmap = subtable; | 101 ot_font->cmap = subtable; |
| 99 ot_font->cmap_uvs = subtable_uvs; | 102 ot_font->cmap_uvs = subtable_uvs; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 { | 283 { |
| 281 hb_ot_font_t *ot_font = _hb_ot_font_create (font); | 284 hb_ot_font_t *ot_font = _hb_ot_font_create (font); |
| 282 if (unlikely (!ot_font)) | 285 if (unlikely (!ot_font)) |
| 283 return; | 286 return; |
| 284 | 287 |
| 285 hb_font_set_funcs (font, | 288 hb_font_set_funcs (font, |
| 286 _hb_ot_get_font_funcs (), | 289 _hb_ot_get_font_funcs (), |
| 287 ot_font, | 290 ot_font, |
| 288 (hb_destroy_func_t) _hb_ot_font_destroy); | 291 (hb_destroy_func_t) _hb_ot_font_destroy); |
| 289 } | 292 } |
| OLD | NEW |