MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.65k stars 1.33k forks source link

Support different font styles #1522

Open msteiger opened 9 years ago

msteiger commented 9 years ago

Currently, only one font style is supported. I think it would be nice if parts of text could be marked as italic or bold similar to how text can be colored.

Text coloring is currently done by adding special characters. Picking up an ancient comment by @MarcinSc, I also believe now that this encoding should be done differently.

I was thinking about a class StyledString that could contain such additional attributes similar to AttributedString. The renderer would read out that attributes and pick fonts / colors as needed.

msteiger commented 9 years ago

Alternatively, a more user-friendly encoding such as Markdown might make sense. It would also support italic/bold text and used directly for in-game chat. Unfortunately, color encoding isn't possible.

Related: #1817, #1826

immortius commented 9 years ago

We could just come up with some simple markup language. Could be as simple as:

{color:#fff}some text{color} {u}important{u}

It would have to be limited to options within a font though - so no italics or bold unless we introduce font families or similar. Or it could be extended if the text is used by a specialised widget that can handle that - like the html widget.

npetronio1 commented 1 year ago

Hey, I would like to work on this issue. Can this please be assigned to me? Thank you!

jdrueckert commented 1 year ago

Hi @npetronio1 You don't need to be assigned to this issue to start working on it 😉 Just fork this repo, create some first changes, open a draft PR and mention this issue in it, then it will be automatically linked to it. Also, the earlier we see changes, the earlier we can give you feedback on whether you're heading the right direction 🤓

Please also note, that if you don't have a lot of programming experience yet, this list of good first issues is likely an easier start. If you have general questions unrelated to a specific issue or PR change, I'd further recommend joining our Discord Server to get more timely responses.