diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh index 580dc37690f..47774fd8f0a 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cbdt-table.hh @@ -384,26 +384,16 @@ struct CBDT { inline void init (hb_face_t *face) { - upem = hb_face_get_upem (face); - - cblc_blob = hb_sanitize_context_t().reference_table<CBLC> (face); - cbdt_blob = hb_sanitize_context_t().reference_table<CBDT> (face); - cbdt_len = hb_blob_get_length (cbdt_blob); - - if (hb_blob_get_length (cblc_blob) == 0) { - cblc = nullptr; - cbdt = nullptr; - return; /* Not a bitmap font. */ - } - cblc = cblc_blob->as<CBLC> (); - cbdt = cbdt_blob->as<CBDT> (); + cblc = hb_sanitize_context_t().reference_table<CBLC> (face); + cbdt = hb_sanitize_context_t().reference_table<CBDT> (face); + upem = hb_face_get_upem (face); } inline void fini (void) { - hb_blob_destroy (this->cblc_blob); - hb_blob_destroy (this->cbdt_blob); + this->cblc.destroy (); + this->cbdt.destroy (); } inline bool get_extents (hb_font_t *font, hb_codepoint_t glyph, @@ -423,6 +413,7 @@ struct CBDT return false; { + unsigned int cbdt_len = cbdt.get_length (); if (unlikely (image_offset > cbdt_len || cbdt_len - image_offset < image_length)) return false; @@ -475,6 +466,7 @@ struct CBDT return hb_blob_get_empty (); { + unsigned int cbdt_len = cbdt.get_length (); if (unlikely (image_offset > cbdt_len || cbdt_len - image_offset < image_length)) return hb_blob_get_empty (); @@ -485,7 +477,7 @@ struct CBDT return hb_blob_get_empty (); const GlyphBitmapDataFormat17& glyphFormat17 = StructAtOffset<GlyphBitmapDataFormat17> (this->cbdt, image_offset); - return hb_blob_create_sub_blob (cbdt_blob, + return hb_blob_create_sub_blob (cbdt.get_blob (), image_offset + GlyphBitmapDataFormat17::min_size, glyphFormat17.data.len); } @@ -494,7 +486,7 @@ struct CBDT return hb_blob_get_empty (); const GlyphBitmapDataFormat18& glyphFormat18 = StructAtOffset<GlyphBitmapDataFormat18> (this->cbdt, image_offset); - return hb_blob_create_sub_blob (cbdt_blob, + return hb_blob_create_sub_blob (cbdt.get_blob (), image_offset + GlyphBitmapDataFormat18::min_size, glyphFormat18.data.len); } @@ -503,7 +495,7 @@ struct CBDT return hb_blob_get_empty (); const GlyphBitmapDataFormat19& glyphFormat19 = StructAtOffset<GlyphBitmapDataFormat19> (this->cbdt, image_offset); - return hb_blob_create_sub_blob (cbdt_blob, + return hb_blob_create_sub_blob (cbdt.get_blob (), image_offset + GlyphBitmapDataFormat19::min_size, glyphFormat19.data.len); } @@ -513,16 +505,12 @@ struct CBDT return hb_blob_get_empty (); } - inline bool has_data () const - { return cbdt_len; } + inline bool has_data () const { return cbdt.get_length (); } private: - hb_blob_t *cblc_blob; - hb_blob_t *cbdt_blob; - hb_nonnull_ptr_t<const CBLC> cblc; - hb_nonnull_ptr_t<const CBDT> cbdt; + hb_blob_ptr_t<CBLC> cblc; + hb_blob_ptr_t<CBDT> cbdt; - unsigned int cbdt_len; unsigned int upem; }; |