[MATH] Clean up get_math_constant implementation
This commit is contained in:
parent
8a8cfad9a0
commit
54c0cc38fb
|
@ -77,7 +77,8 @@ struct MathConstants
|
||||||
return_trace (c->check_struct (this) && sanitize_math_value_records(c));
|
return_trace (c->check_struct (this) && sanitize_math_value_records(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline hb_position_t get_value (hb_font_t *font, hb_ot_math_constant_t constant) const
|
inline hb_position_t get_value (hb_ot_math_constant_t constant,
|
||||||
|
hb_font_t *font) const
|
||||||
{
|
{
|
||||||
switch (constant) {
|
switch (constant) {
|
||||||
|
|
||||||
|
@ -437,10 +438,9 @@ struct MATH
|
||||||
mathGlyphInfo.sanitize (c, this));
|
mathGlyphInfo.sanitize (c, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool has_math_constants (void) const { return mathConstants != 0; }
|
inline hb_position_t get_constant (hb_ot_math_constant_t constant,
|
||||||
inline const MathConstants &get_math_constants (void) const {
|
hb_font_t *font) const
|
||||||
return this+mathConstants;
|
{ return (this+mathConstants).get_value (constant, font); }
|
||||||
}
|
|
||||||
|
|
||||||
inline bool has_math_glyph_info (void) const { return mathGlyphInfo != 0; }
|
inline bool has_math_glyph_info (void) const { return mathGlyphInfo != 0; }
|
||||||
inline const MathGlyphInfo &get_math_glyph_info (void) const {
|
inline const MathGlyphInfo &get_math_glyph_info (void) const {
|
||||||
|
|
|
@ -1259,15 +1259,14 @@ hb_ot_layout_has_math_data (hb_face_t *face)
|
||||||
*
|
*
|
||||||
* Return value: the requested constant or 0
|
* Return value: the requested constant or 0
|
||||||
*
|
*
|
||||||
* Since: ????
|
* Since: 1.4
|
||||||
**/
|
**/
|
||||||
hb_position_t
|
hb_position_t
|
||||||
hb_ot_layout_get_math_constant (hb_font_t *font,
|
hb_ot_layout_get_math_constant (hb_font_t *font,
|
||||||
hb_ot_math_constant_t constant)
|
hb_ot_math_constant_t constant)
|
||||||
{
|
{
|
||||||
const OT::MATH &math = _get_math (font->face);
|
const OT::MATH &math = _get_math (font->face);
|
||||||
return math.has_math_constants() ?
|
return math.get_constant(constant, font);
|
||||||
math.get_math_constants().get_value(font, constant) : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue