sanitize_math_value_records (c));
}
- inline hb_position_t get_value (hb_font_t *font,
- hb_position_t &correction_height) const
+ inline hb_position_t get_value (hb_position_t correction_height, hb_font_t *font) const
{
const MathValueRecord* correctionHeight = mathValueRecords;
const MathValueRecord* kernValue = mathValueRecords + heightCount;
return_trace (true);
}
- inline const MathKern &get_math_kern (hb_ot_math_kern_t kern,
- const void *base) const
+ inline hb_position_t get_kerning (hb_ot_math_kern_t kern,
+ hb_position_t correction_height,
+ hb_font_t *font,
+ const void *base) const
{
unsigned int idx = kern;
- if (unlikely (idx > ARRAY_LENGTH (mathKern))) return Null(MathKern);
- return base+mathKern[idx];
+ if (unlikely (idx >= ARRAY_LENGTH (mathKern))) return 0;
+ return (base+mathKern[idx]).get_value (correction_height, font);
}
protected:
mathKernInfoRecords.sanitize (c, this));
}
- inline const MathKernInfoRecord&
- get_math_kern_info_record (hb_codepoint_t glyph) const
+ inline hb_position_t get_kerning (hb_codepoint_t glyph,
+ hb_ot_math_kern_t kern,
+ hb_position_t correction_height,
+ hb_font_t *font) const
{
unsigned int index = (this+mathKernCoverage).get_coverage (glyph);
- return mathKernInfoRecords[index];
+ return mathKernInfoRecords[index].get_kerning (kern, correction_height, font, this);
}
protected:
inline bool is_extended_shape (hb_codepoint_t glyph) const
{ return (this+extendedShapeCoverage).get_coverage (glyph) != NOT_COVERED; }
- inline const MathKernInfo &get_math_kern_info (void) const {
- return this+mathKernInfo;
- }
+ inline hb_position_t get_kerning (hb_codepoint_t glyph,
+ hb_ot_math_kern_t kern,
+ hb_position_t correction_height,
+ hb_font_t *font) const
+ { return (this+mathKernInfo).get_kerning (glyph, kern, correction_height, font); }
protected:
/* Offset to MathItalicsCorrectionInfo table -
hb_position_t correction_height)
{
const OT::MATH &math = _get_math (font->face);
- const OT::MathGlyphInfo &glyphInfo = math.get_math_glyph_info();
- const OT::MathKernInfo &kernInfo = glyphInfo.get_math_kern_info();
- const OT::MathKernInfoRecord &kernInfoRecord = kernInfo.get_math_kern_info_record(glyph);
- return kernInfoRecord.get_math_kern (kern, &kernInfo).get_value (font, correction_height);
+ return math.get_math_glyph_info().get_kerning (glyph, kern, correction_height, font);
}