View Full Version : ClanLib Font Underlining

10-08-2013, 10:53 PM
Something else to consider for the future.

FontDescription set_underline and set_strikeout is currently not implemented.

Since underline and strikeout is not actually part of the glyph, but drawn on afterwards, maybe it should not be a part of the font description.

Maybe modify clan::Font to contain a set_underline() function.

However, if a line of text contains multiple fonts and images, for example the clan::SpanLayout class, then maybe it is clan::SpanLayout responsibility to draw the underline.

10-09-2013, 08:06 PM
Harry once wrote some support for this, but I can't remember why it is no longer part of our font drawing functions.

Personally I think font.draw should support drawing underlines and strikethrough for us. In principle it is just a question of issueing a fill_rect command on the canvas after drawing the glyphs. Forcing individual apps to do their own underline or strikeout has no advantages from what I can tell (except as a excuse for us not to support it :)). If an app does have specials reasons for doing its own fill, it can just set those flags in the font description to false.