summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc44
1 files changed, 18 insertions, 26 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
index 41bea140523..b19b25a3eed 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
@@ -33,10 +33,12 @@
#include "hb-ot-face.hh"
#include "hb-ot-cmap-table.hh"
+#include "hb-ot-glyf-table.hh"
#include "hb-ot-hmtx-table.hh"
#include "hb-ot-kern-table.hh"
+#include "hb-ot-os2-table.hh"
#include "hb-ot-post-table.hh"
-#include "hb-ot-glyf-table.hh"
+#include "hb-ot-stat-table.hh" // Just so we compile it; unused otherwise.
#include "hb-ot-vorg-table.hh"
#include "hb-ot-color-cbdt-table.hh"
#include "hb-ot-color-sbix-table.hh"
@@ -61,7 +63,7 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
return ot_face->cmap->get_nominal_glyph (unicode, glyph);
}
@@ -75,17 +77,10 @@ hb_ot_get_nominal_glyphs (hb_font_t *font HB_UNUSED,
unsigned int glyph_stride,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
- const OT::cmap_accelerator_t &cmap = *ot_face->cmap;
- unsigned int done;
- for (done = 0;
- done < count && cmap.get_nominal_glyph (*first_unicode, first_glyph);
- done++)
- {
- first_unicode = &StructAtOffset<hb_codepoint_t> (first_unicode, unicode_stride);
- first_glyph = &StructAtOffset<hb_codepoint_t> (first_glyph, glyph_stride);
- }
- return done;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
+ return ot_face->cmap->get_nominal_glyphs (count,
+ first_unicode, unicode_stride,
+ first_glyph, glyph_stride);
}
static hb_bool_t
@@ -96,7 +91,7 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
return ot_face->cmap->get_variation_glyph (unicode, variation_selector, glyph);
}
@@ -109,7 +104,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
unsigned advance_stride,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx;
for (unsigned int i = 0; i < count; i++)
@@ -129,7 +124,7 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data,
unsigned advance_stride,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx;
for (unsigned int i = 0; i < count; i++)
@@ -148,7 +143,7 @@ hb_ot_get_glyph_v_origin (hb_font_t *font,
hb_position_t *y,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
*x = font->get_glyph_h_advance (glyph) / 2;
@@ -182,7 +177,7 @@ hb_ot_get_glyph_extents (hb_font_t *font,
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
bool ret = ot_face->sbix->get_extents (font, glyph, extents);
if (!ret)
ret = ot_face->glyf->get_extents (glyph, extents);
@@ -203,7 +198,7 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED,
char *name, unsigned int size,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
return ot_face->post->get_glyph_name (glyph, name, size);
}
@@ -214,7 +209,7 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
return ot_face->post->get_glyph_from_name (name, len, glyph);
}
@@ -224,7 +219,7 @@ hb_ot_get_font_h_extents (hb_font_t *font,
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx;
metrics->ascender = font->em_scale_y (hmtx.ascender);
metrics->descender = font->em_scale_y (hmtx.descender);
@@ -239,7 +234,7 @@ hb_ot_get_font_v_extents (hb_font_t *font,
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data;
const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx;
metrics->ascender = font->em_scale_x (vmtx.ascender);
metrics->descender = font->em_scale_x (vmtx.descender);
@@ -305,11 +300,8 @@ _hb_ot_get_font_funcs (void)
void
hb_ot_font_set_funcs (hb_font_t *font)
{
- if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
- hb_ot_face_data_t *ot_face = hb_ot_face_data (font->face);
-
hb_font_set_funcs (font,
_hb_ot_get_font_funcs (),
- ot_face,
+ &font->face->table,
nullptr);
}