|
|
@ -44,7 +44,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
static hb_bool_t |
|
|
|
hb_font_get_glyph_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t unicode, |
|
|
|
hb_codepoint_t unicode, |
|
|
|
hb_codepoint_t variation_selector, |
|
|
|
hb_codepoint_t variation_selector, |
|
|
@ -59,7 +59,7 @@ hb_font_get_glyph_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_position_t |
|
|
|
static hb_position_t |
|
|
|
hb_font_get_glyph_h_advance_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_h_advance_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
void *user_data HB_UNUSED) |
|
|
@ -71,7 +71,7 @@ hb_font_get_glyph_h_advance_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_position_t |
|
|
|
static hb_position_t |
|
|
|
hb_font_get_glyph_v_advance_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_v_advance_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
void *user_data HB_UNUSED) |
|
|
@ -83,7 +83,7 @@ hb_font_get_glyph_v_advance_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
static hb_bool_t |
|
|
|
hb_font_get_glyph_h_origin_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_h_origin_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_position_t *x, |
|
|
|
hb_position_t *x, |
|
|
@ -91,9 +91,7 @@ hb_font_get_glyph_h_origin_nil (hb_font_t *font HB_UNUSED, |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (font->parent) { |
|
|
|
if (font->parent) { |
|
|
|
hb_bool_t ret = hb_font_get_glyph_h_origin (font->parent, |
|
|
|
hb_bool_t ret = hb_font_get_glyph_h_origin (font->parent, glyph, x, y); |
|
|
|
glyph, |
|
|
|
|
|
|
|
x, y); |
|
|
|
|
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
font->parent_scale_position (x, y); |
|
|
|
font->parent_scale_position (x, y); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
@ -104,7 +102,7 @@ hb_font_get_glyph_h_origin_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
static hb_bool_t |
|
|
|
hb_font_get_glyph_v_origin_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_v_origin_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_position_t *x, |
|
|
|
hb_position_t *x, |
|
|
@ -112,9 +110,7 @@ hb_font_get_glyph_v_origin_nil (hb_font_t *font HB_UNUSED, |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (font->parent) { |
|
|
|
if (font->parent) { |
|
|
|
hb_bool_t ret = hb_font_get_glyph_v_origin (font->parent, |
|
|
|
hb_bool_t ret = hb_font_get_glyph_v_origin (font->parent, glyph, x, y); |
|
|
|
glyph, |
|
|
|
|
|
|
|
x, y); |
|
|
|
|
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
font->parent_scale_position (x, y); |
|
|
|
font->parent_scale_position (x, y); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
@ -125,7 +121,7 @@ hb_font_get_glyph_v_origin_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_position_t |
|
|
|
static hb_position_t |
|
|
|
hb_font_get_glyph_h_kerning_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_h_kerning_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t left_glyph, |
|
|
|
hb_codepoint_t left_glyph, |
|
|
|
hb_codepoint_t right_glyph, |
|
|
|
hb_codepoint_t right_glyph, |
|
|
@ -138,7 +134,7 @@ hb_font_get_glyph_h_kerning_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_position_t |
|
|
|
static hb_position_t |
|
|
|
hb_font_get_glyph_v_kerning_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_v_kerning_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t top_glyph, |
|
|
|
hb_codepoint_t top_glyph, |
|
|
|
hb_codepoint_t bottom_glyph, |
|
|
|
hb_codepoint_t bottom_glyph, |
|
|
@ -151,7 +147,7 @@ hb_font_get_glyph_v_kerning_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
static hb_bool_t |
|
|
|
hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_extents_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_glyph_extents_t *extents, |
|
|
|
hb_glyph_extents_t *extents, |
|
|
@ -173,7 +169,7 @@ hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
static hb_bool_t |
|
|
|
hb_font_get_glyph_contour_point_nil (hb_font_t *font HB_UNUSED, |
|
|
|
hb_font_get_glyph_contour_point_nil (hb_font_t *font, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
void *font_data HB_UNUSED, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
hb_codepoint_t glyph, |
|
|
|
unsigned int point_index, |
|
|
|
unsigned int point_index, |
|
|
@ -182,9 +178,7 @@ hb_font_get_glyph_contour_point_nil (hb_font_t *font HB_UNUSED, |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
void *user_data HB_UNUSED) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (font->parent) { |
|
|
|
if (font->parent) { |
|
|
|
hb_bool_t ret = hb_font_get_glyph_contour_point (font->parent, |
|
|
|
hb_bool_t ret = hb_font_get_glyph_contour_point (font->parent, glyph, point_index, x, y); |
|
|
|
glyph, point_index, |
|
|
|
|
|
|
|
x, y); |
|
|
|
|
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
font->parent_scale_position (x, y); |
|
|
|
font->parent_scale_position (x, y); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
@ -194,6 +188,34 @@ hb_font_get_glyph_contour_point_nil (hb_font_t *font HB_UNUSED, |
|
|
|
return FALSE; |
|
|
|
return FALSE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
|
|
|
|
hb_font_get_glyph_name_nil (hb_font_t *font, |
|
|
|
|
|
|
|
void *font_data HB_UNUSED, |
|
|
|
|
|
|
|
hb_codepoint_t glyph, |
|
|
|
|
|
|
|
char *name, unsigned int size, |
|
|
|
|
|
|
|
void *user_data HB_UNUSED) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (font->parent) |
|
|
|
|
|
|
|
return hb_font_get_glyph_name (font->parent, glyph, name, size); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
snprintf (name, size, "gid%u", glyph); |
|
|
|
|
|
|
|
return FALSE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static hb_bool_t |
|
|
|
|
|
|
|
hb_font_get_glyph_from_name_nil (hb_font_t *font, |
|
|
|
|
|
|
|
void *font_data HB_UNUSED, |
|
|
|
|
|
|
|
const char *name, int len, /* -1 means nul-terminated */ |
|
|
|
|
|
|
|
hb_codepoint_t *glyph, |
|
|
|
|
|
|
|
void *user_data HB_UNUSED) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (font->parent) |
|
|
|
|
|
|
|
return hb_font_get_glyph_from_name (font->parent, name, len, glyph); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*glyph = 0; |
|
|
|
|
|
|
|
return FALSE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static hb_font_funcs_t _hb_font_funcs_nil = { |
|
|
|
static hb_font_funcs_t _hb_font_funcs_nil = { |
|
|
|
HB_OBJECT_HEADER_STATIC, |
|
|
|
HB_OBJECT_HEADER_STATIC, |
|
|
@ -405,6 +427,28 @@ hb_font_get_glyph_contour_point (hb_font_t *font, |
|
|
|
font->klass->user_data.glyph_contour_point); |
|
|
|
font->klass->user_data.glyph_contour_point); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hb_bool_t |
|
|
|
|
|
|
|
hb_font_get_glyph_name (hb_font_t *font, |
|
|
|
|
|
|
|
hb_codepoint_t glyph, |
|
|
|
|
|
|
|
char *name, unsigned int size) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return font->klass->get.glyph_name (font, font->user_data, |
|
|
|
|
|
|
|
glyph, |
|
|
|
|
|
|
|
name, size, |
|
|
|
|
|
|
|
font->klass->user_data.glyph_name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hb_bool_t |
|
|
|
|
|
|
|
hb_font_get_glyph_from_name (hb_font_t *font, |
|
|
|
|
|
|
|
const char *name, int len, /* -1 means nul-terminated */ |
|
|
|
|
|
|
|
hb_codepoint_t *glyph) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return font->klass->get.glyph_from_name (font, font->user_data, |
|
|
|
|
|
|
|
name, len, |
|
|
|
|
|
|
|
glyph, |
|
|
|
|
|
|
|
font->klass->user_data.glyph_from_name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* A bit higher-level, and with fallback */ |
|
|
|
/* A bit higher-level, and with fallback */ |
|
|
|
|
|
|
|
|
|
|
|