[sbix] Move code around. Add get_extents()
This commit is contained in:
parent
48bc3039cb
commit
f9f26bff4c
@ -157,6 +157,8 @@ struct sbix
|
|||||||
hb_blob_destroy (sbix_blob);
|
hb_blob_destroy (sbix_blob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool has_data () const { return sbix_len; }
|
||||||
|
|
||||||
/* only to support dump-emoji, don't use it anywhere else */
|
/* only to support dump-emoji, don't use it anywhere else */
|
||||||
inline unsigned int *get_available_ppems (unsigned int *length)
|
inline unsigned int *get_available_ppems (unsigned int *length)
|
||||||
{
|
{
|
||||||
@ -170,6 +172,15 @@ struct sbix
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool get_extents (hb_codepoint_t glyph,
|
||||||
|
unsigned int x_ppem,
|
||||||
|
unsigned int y_ppem,
|
||||||
|
hb_glyph_extents_t *extents) const
|
||||||
|
{
|
||||||
|
/* We only support PNG right now, and following function checks type. */
|
||||||
|
return get_png_extents (glyph, x_ppem, y_ppem, extents);
|
||||||
|
}
|
||||||
|
|
||||||
inline hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id,
|
inline hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id,
|
||||||
unsigned int x_ppem,
|
unsigned int x_ppem,
|
||||||
unsigned int y_ppem,
|
unsigned int y_ppem,
|
||||||
@ -196,6 +207,8 @@ struct sbix
|
|||||||
file_type, num_glyphs);
|
file_type, num_glyphs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
struct PNGHeader
|
struct PNGHeader
|
||||||
{
|
{
|
||||||
HBUINT8 signature[8];
|
HBUINT8 signature[8];
|
||||||
@ -245,8 +258,6 @@ struct sbix
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool has_data () const { return sbix_len; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
hb_blob_t *sbix_blob;
|
hb_blob_t *sbix_blob;
|
||||||
const sbix *sbix_table;
|
const sbix *sbix_table;
|
||||||
|
@ -183,7 +183,7 @@ hb_ot_get_glyph_extents (hb_font_t *font,
|
|||||||
void *user_data HB_UNUSED)
|
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_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
|
||||||
bool ret = ot_face->sbix->get_png_extents (glyph, font->x_ppem, font->y_ppem, extents);
|
bool ret = ot_face->sbix->get_extents (glyph, font->x_ppem, font->y_ppem, extents);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = ot_face->glyf->get_extents (glyph, extents);
|
ret = ot_face->glyf->get_extents (glyph, extents);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user