/** * Compute absolute line-height * * \param style Style to process * \param ex_size Ex size, in ems * \return CSS_OK on success */ css_error compute_absolute_line_height(css_computed_style *style, const css_hint_length *ex_size) { css_fixed length = 0; css_unit unit = CSS_UNIT_PX; uint8_t type; css_error error; type = get_line_height(style, &length, &unit); if (type == CSS_LINE_HEIGHT_DIMENSION) { if (unit == CSS_UNIT_EX) { length = FMUL(length, ex_size->value); unit = ex_size->unit; } error = set_line_height(style, type, length, unit); if (error != CSS_OK) return error; } return CSS_OK; }
void TextStyle::set_line_height_normal() { set_line_height(0.0f); }
void TextStyle::set_font(const std::string &family, float size, float line_height) { set_font_family(family); set_size(size); set_line_height(line_height); }