MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.6k stars 434 forks source link

[Suggestion] GPU flags for bold/italic output #1846

Closed ghost closed 6 years ago

ghost commented 8 years ago

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 of gpu.set or gpu.fill will draw bold text.

Problems

I think it's easy to use flags with functions like gpu.set<Something>(state: boolean). So...

What do you think about it?

fnuecke commented 8 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).

SaphireLattice commented 8 years ago

@fnuecke But wouldn't that require to triple the amount of glyphs in the font file?

fnuecke commented 8 years ago

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.

SaphireLattice commented 8 years ago

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.

skyem123 commented 8 years ago

It's worth noting that underline and strikethrough can be done without extra glyphs.

dgelessus commented 8 years ago

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.

skyem123 commented 8 years ago

That would be useful, though what would happen if someone tried to make a bold unicode bold? Nothing?

J0SLAN commented 7 years ago

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.

payonel commented 6 years ago

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