[ot-font] Respect OS/2 fsSelection USE_TYPO_METRICS bit

This commit is contained in:
Behdad Esfahbod 2015-12-10 16:37:49 +01:00
parent 6f2e6de1fa
commit 3ad16048fd
1 changed files with 8 additions and 4 deletions

View File

@ -62,11 +62,15 @@ struct hb_ot_face_metrics_accelerator_t
{ {
hb_blob_t *os2_blob = OT::Sanitizer<OT::os2>::sanitize (face->reference_table (os2_tag)); hb_blob_t *os2_blob = OT::Sanitizer<OT::os2>::sanitize (face->reference_table (os2_tag));
const OT::os2 *os2 = OT::Sanitizer<OT::os2>::lock_instance (os2_blob); const OT::os2 *os2 = OT::Sanitizer<OT::os2>::lock_instance (os2_blob);
this->ascender = os2->sTypoAscender; #define USE_TYPO_METRICS (1u<<7)
this->descender = os2->sTypoDescender; if (0 != (os2->fsSelection & USE_TYPO_METRICS))
this->line_gap = os2->sTypoLineGap; {
this->ascender = os2->sTypoAscender;
this->descender = os2->sTypoDescender;
this->line_gap = os2->sTypoLineGap;
got_font_extents = (this->ascender | this->descender) != 0;
}
hb_blob_destroy (os2_blob); hb_blob_destroy (os2_blob);
got_font_extents = (this->ascender | this->descender) != 0;
} }
hb_blob_t *_hea_blob = OT::Sanitizer<OT::_hea>::sanitize (face->reference_table (_hea_tag)); hb_blob_t *_hea_blob = OT::Sanitizer<OT::_hea>::sanitize (face->reference_table (_hea_tag));