RonenNess / GeonBit.UI

UI system for MonoGame projects.
MIT License
467 stars 63 forks source link

Support for non-monospace fonts #119

Open ayousuf23 opened 3 years ago

ayousuf23 commented 3 years ago

GeonBit.UI needs to support non-monospace fonts. What should be done to support them?

ayousuf23 commented 3 years ago

@RonenNess what needs to be done to support non-monospace fonts?

RonenNess commented 3 years ago

Hi @ayousuf23, I'm afraid that would be quite difficult as I do a lot of size calculations based on font size, assuming all characters are equal. You can try setting non mono font and see what breaks, maybe the stuff that would break happen to be elements you don't use.

Bottom line- no idea, but might be complicated.

BlizzCrafter commented 3 years ago

Just as an idea: there are some programs which generating .xml or .json files of the font containing information like the size of each character. I would go that route and implement this funtionallity into the content pipeline or add a reference to JSON and implement (De-)Serializing methods.

Then it should be easily possible to work with any font in GeonBit.UI.

At least if someone is willing to do the work of course 😜