// methods //------------------------------------------------- // line::add_character //------------------------------------------------- public void add_character(text_layout layout, char32_t ch, char_style style, source_info source) { // get the width of this character float chwidth = layout.get_char_width(ch, style.size); // append the positioned character m_characters.emplace_back(new positioned_char() { character = ch, style = style, source = source, xoffset = m_width, xwidth = chwidth }); m_width += chwidth; // we might be bigger m_height = std.max(m_height, style.size * layout.yscale()); }
// methods //------------------------------------------------- // line::add_character //------------------------------------------------- public void add_character(char32_t ch, char_style style, source_info source) { // get the width of this character float chwidth = m_layout.get_char_width(ch, style.size); // create the positioned character positioned_char positioned_char; positioned_char.character = ch; positioned_char.xoffset = m_width; positioned_char.xwidth = chwidth; positioned_char.style = style; positioned_char.source = source; // append the character m_characters.push_back(positioned_char); m_width += chwidth; // we might be bigger m_height = Math.Max(m_height, style.size * m_layout.yscale()); }