- const GL::Font &font = *style->get_font();
- const float font_size = font.get_default_size();
- const GL::Color &color = style->get_font_color();
- const Sides &margin = part.get_margin();
-
- Geometry pgeom = geom;
- pgeom.h = row_height;
- pgeom.w -= margin.left+margin.right;
-
- for(unsigned i=0; (i<n_visible && first+i<items.size()); ++i)
- {
- Geometry rgeom;
- rgeom.w = static_cast<unsigned>(font.get_string_width(items[first+i])*font_size);
- rgeom.h = row_height;
- rgeom.x = margin.left;
- rgeom.y = geom.h-margin.top-(i+1)*row_height-static_cast<int>(font.get_descent()*font_size);
- part.get_alignment().apply(rgeom, pgeom);
-
- GL::push_matrix();
- GL::translate(rgeom.x, rgeom.y, 0);
- GL::scale_uniform(font_size);
- GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
- imm.color(color.r, color.g, color.b);
- font.draw_string(items[first+i], imm);
- GL::pop_matrix();
- }