HBINT16 xOffset; /* The horizontal (x-axis) offset from the left * edge of the graphic to the glyph’s origin. * That is, the x-coordinate of the point on the
* baseline at the left edge of the glyph. */
HBINT16 yOffset; /* The vertical (y-axis) offset from the bottom * edge of the graphic to the glyph’s origin. * That is, the y-coordinate of the point on the
* baseline at the left edge of the glyph. */
Tag graphicType; /* Indicates the format of the embedded graphic * data: one of 'jpg ', 'png ' or 'tiff', or the
* special format 'dupe'. */
UnsizedArrayOf<HBUINT8>
data; /* The actual embedded graphic data. The total * length is inferred from sequential entries in * the glyphDataOffsets array and the fixed size
* (8 bytes) of the preceding fields. */ public:
DEFINE_SIZE_ARRAY (8, data);
};
hb_blob_t *get_glyph_blob (unsignedint glyph_id,
hb_blob_t *sbix_blob,
hb_tag_t file_type, int *x_offset, int *y_offset, unsignedint num_glyphs, unsignedint *strike_ppem) const
{ if (unlikely (!ppem)) return hb_blob_get_empty (); /* To get Null() object out of the way. */
public:
HBUINT16 ppem; /* The PPEM size for which this strike was designed. */
HBUINT16 resolution; /* The device pixel density (in PPI) for which this
* strike was designed. (E.g., 96 PPI, 192 PPI.) */ protected:
UnsizedArrayOf<Offset32To<SBIXGlyph>>
imageOffsetsZ; /* Offset from the beginning of the strike data header
* to bitmap data for an individual glyph ID. */ public:
DEFINE_SIZE_ARRAY (4, imageOffsetsZ);
};
bool get_extents (hb_font_t *font,
hb_codepoint_t glyph,
hb_glyph_extents_t *extents, bool scale = true) const
{ /* We only support PNG right now, and following function checks type. */ return get_png_extents (font, glyph, extents, scale);
}
bool get_png_extents (hb_font_t *font,
hb_codepoint_t glyph,
hb_glyph_extents_t *extents, bool scale = true) const
{ /* Following code is safe to call even without data.
* But faster to short-circuit. */ if (!has_data ()) returnfalse;
auto *out = c->serializer->start_embed<Array32OfOffset32To<SBIXStrike>> (); if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
hb_vector_t<Offset32To<SBIXStrike>*> new_strikes;
hb_vector_t<hb_serialize_context_t::objidx_t> objidxs; for (int i = strikes.len - 1; i >= 0; --i)
{ auto* o = out->serialize_append (c->serializer); if (unlikely (!o)) return_trace (false);
*o = 0; auto snap = c->serializer->snapshot ();
c->serializer->push (); bool ret = add_strike (c, i); if (!ret)
{
c->serializer->pop_discard ();
out->pop ();
c->serializer->revert (snap);
} else
{
objidxs.push (c->serializer->pop_pack ());
new_strikes.push (o);
}
} for (unsignedint i = 0; i < new_strikes.length; ++i)
c->serializer->add_link (*new_strikes[i], objidxs[new_strikes.length - 1 - i]);
return_trace (true);
}
bool subset (hb_subset_context_t* c) const
{
TRACE_SUBSET (this);
if (unlikely (!c->serializer->embed (this->version))) return_trace (false); if (unlikely (!c->serializer->embed (this->flags))) return_trace (false);
return_trace (serialize_strike_offsets (c));
}
protected:
HBUINT16 version; /* Table version number — set to 1 */
HBUINT16 flags; /* Bit 0: Set to 1. Bit 1: Draw outlines.
* Bits 2 to 15: reserved (set to 0). */
Array32OfOffset32To<SBIXStrike>
strikes; /* Offsets from the beginning of the 'sbix'
* table to data for each individual bitmap strike. */ public:
DEFINE_SIZE_ARRAY (8, strikes);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.