提交 b76dc031 编写于 作者: B Behdad Esfahbod

[sbix] Reduce code

上级 50fb02a2
...@@ -97,7 +97,8 @@ struct SBIXStrike ...@@ -97,7 +97,8 @@ struct SBIXStrike
imageOffsetsZ[glyph_id + 1] - imageOffsetsZ[glyph_id] <= SBIXGlyph::min_size)) imageOffsetsZ[glyph_id + 1] - imageOffsetsZ[glyph_id] <= SBIXGlyph::min_size))
return hb_blob_get_empty (); return hb_blob_get_empty ();
if (strike_offset + (unsigned int) imageOffsetsZ[glyph_id] + SBIXGlyph::min_size > sbix_len) unsigned int glyph_offset = strike_offset + (unsigned int) imageOffsetsZ[glyph_id] + SBIXGlyph::min_size;
if (glyph_offset > sbix_len)
return hb_blob_get_empty (); return hb_blob_get_empty ();
const SBIXGlyph *glyph = &(this+imageOffsetsZ[glyph_id]); const SBIXGlyph *glyph = &(this+imageOffsetsZ[glyph_id]);
...@@ -121,9 +122,7 @@ struct SBIXStrike ...@@ -121,9 +122,7 @@ struct SBIXStrike
if (x_offset) *x_offset = glyph->xOffset; if (x_offset) *x_offset = glyph->xOffset;
if (y_offset) *y_offset = glyph->yOffset; if (y_offset) *y_offset = glyph->yOffset;
unsigned int offset = strike_offset + SBIXGlyph::min_size; return hb_blob_create_sub_blob (sbix_blob, glyph_offset, blob_size);
offset += imageOffsetsZ[glyph_id];
return hb_blob_create_sub_blob (sbix_blob, offset, blob_size);
} }
protected: protected:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册