- const GL::Font *font = style->get_font();
- float font_size = font->get_default_size();
- unsigned line_height = static_cast<unsigned>((font->get_ascent()-font->get_descent())*font_size);
+ StringCodec::Utf8::Decoder dec;
+ string::const_iterator i = text.begin()+start;
+ string::const_iterator end = i+bytes;
+ unsigned count = 0;
+ for(; i<end; dec.decode_char(text, i))
+ ++count;
+ return count;
+}
+
+void Text::check_alignment(unsigned offs) const
+{
+ StringCodec::Utf8::Decoder dec;
+ string::const_iterator i = text.begin()+offs;
+ dec.decode_char(text, i);
+}
+
+template<typename T>
+void Text::process_lines(const Part &part, const Geometry &parent, unsigned first_row, void (Text::*func)(unsigned, const Geometry &, T &) const, T &data) const
+{
+ if(!style)
+ return;
+
+ const GL::Font &font = style->get_font();
+ float font_size = style->get_font_size();