cboe icon indicating copy to clipboard operation
cboe copied to clipboard

Strange algorithm for drawing bold text

Open x-qq opened this issue 5 years ago • 2 comments

Currently, text that uses FONT_BOLD is drawn 1) using bold.ttf 2) which is drawn twice with a 1 pixel offset (on top of already drawn text).

I guess this is made to achieve even more boldness?

https://github.com/calref/cboe/blob/master/src/gfx/render_text.cpp#L181

I think it would be better to simply use an appropriate font and not have to do this.

x-qq avatar Jan 17 '20 03:01 x-qq

Appropriate bitmap fonts, free to use - do not get blurred by SFML.

https://clort.shell.ircnow.org/ClortSans1_0.zip

https://clort.shell.ircnow.org/ClortSansBold1_0.zip

clort81 avatar Jan 18 '20 21:01 clort81

Tried disabling the double-drawing code and using LiberationSans-Bold.ttf in place of bold.ttf.

Results:

libsans

This seems reasonably good?

According to https://en.wikipedia.org/wiki/Liberation_fonts it is available for use under a permissive license.

Original double-drawn bold.ttf for comparison:

orig

x-qq avatar Jan 18 '20 23:01 x-qq