Closed ghost closed 6 years ago
A more... realistic approach taking into account the current workings of things might be to have a set of bold/italic characters in the font file, and have the software use those as required (i.e. replace normal with bold glyphs in a string).
@fnuecke But wouldn't that require to triple the amount of glyphs in the font file?
Only if we'd require a bold+italic representation for every glyph, which I think is not really needed? Latin alphabet, numbers and maybe some special characters could be an acceptable compromise. Aside from that, even if they were picked by the GPU/renderer, it's a bitmap font, so they need defining anyway.
Where they will be stored, though? On the other note: can we add custom glyph size in the fonts? Probably will need a special line on the top of the file though.
It's worth noting that underline and strikethrough can be done without extra glyphs.
Unicode has "mathematical" letters in one of the astral planes, which come in different styles, such as bold, italic, sans/serif, double-struck, cursive, you name it. If the font supported those, they would probably be the best way to implement bold/italic formatting without needing to redraw the whole font in bold.
That would be useful, though what would happen if someone tried to make a bold unicode bold? Nothing?
I'd do this myself by editing the font and trading out characters through a text parser, but editing the font doesn't work. Changing the font.hex file and the wcwidths file doesn't work. If it did, then we could just do this ourselves.
bold should be implemented as brighter colors, italics and strikethrough are different font glyphs. oc is going to stick with the current font.hex and at most and more unicode codepoints
Description
I think it's good to be able to write bold/italic output. I see this like GPU flags. We call
gpu.setBold(true)
and next call ofgpu.set
orgpu.fill
will draw bold text.Problems
API Changes
I think it's easy to use flags with functions like
gpu.set<Something>(state: boolean)
. So...gpu.setBold(state: boolean)
will turn bold output on or off.gpu.setItalic(state: boolean)
likegpu.setBold
, but for italic outputWhat do you think about it?