libretro/docs

Create entry for adding new RGUI fonts

rtomasa opened this issue · 14 comments

On the Adding New Languages to RetroArch section it is mentioned the following:

If your language uses a different range of symbols, an RGUI compatible font must be added first. This is an extensive process, which is outside the scope of this article.

This would be very interesting for people trying to customise the UI or helping with the creation of new charsets for new langs.

I think that detailing the whole process is not even required but at least explain how to do the BMP to BIN, and how to compile te same if any special step is required.

@IlDucci Hi,

Do you have any resource to make this article possible? It is no urgent but a draft could be nice for people who like to contribute.

Unfortunatelly I don't. This is why I've requested the same, in the hope that someone else have the knowlege, because I'm trying to do that and after looking at the source code of RA, I was not able to figure out how is the bitmap.bmp compiled into the binary. I was only able to understand that a bin file exists for the corresponding bmp file and I assume that this is what make command takes into account for the compilation process. Also I don't know where can I ask about this...

@IlDucci Hi,

Do you have any resource to make this article possible? It is no urgent but a draft could be nice for people who like to contribute.

The main problem here is that all the new custom fonts I made were with the help of @trngaje . He developed a tool to convert BMP bitmap sheets into binary files. Unfortunately, this tool has not been publicly released, I just did the font sheets and he converted them for me. Besides that, it would be a matter of adding new code to RA (as RGUI is not ready for custom, user-selectable fonts, only fonts varying per existing language) and compressing the resulting binary file with one of the compressors that are in RA's dev toolset.

That was exactly what I was looking for in the RA tools folder. The script for converting the BMP to BIN. I know that this is very unique and very few people has the time and knowledge to create the font sheet, convert and compile RA for customising with the same but as you say, it would be the first step on adding more features in the future to make the customisation feasible just creating the font sheet.

Binding my other related issue here for future references: Script for converting BMP to BIN for RGUI Fonts #738

Binding my other related issue here for future references: Script for converting BMP to BIN for RGUI Fonts #738

to describe, i post https://trngaje.github.io/retroarch/retroarch-rgui-font/
you can get a tool to convert below.
https://github.com/trngaje/png2c

and update pre built file for windows below
https://github.com/trngaje/png2c/releases/tag/windows_64bit_png2c_220924

I won't be quick to answer, but I'll answer

@trngaje I was able to play around with the tool and it works like a charm! thanks a lot.
@fpscan I think that all the info and tools provided by @trngaje are enough to update the Docs and even to include the tool in the RA tools folder, but this is up to you. Please let me know whether I should close the issue now or wait until you update the Docs

to describe, i post https://trngaje.github.io/retroarch/retroarch-rgui-font/
you can get a tool to convert below.
https://github.com/trngaje/png2c

Thank you very, very much, @trngaje !

For future reference, all UI symbol icons like switches, battery, etc. are hardcoded in rgui.c so they must be customised independently.

@trngaje I was able to play around with the tool and it works like a charm! thanks a lot. @fpscan I think that all the info and tools provided by @trngaje are enough to update the Docs and even to include the tool in the RA tools folder, but this is up to you. Please let me know whether I should close the issue now or wait until you update the Docs

I thought it might be too late. I'm glad it was helpful.

For future reference, all UI symbol icons like switches, battery, etc. are hardcoded in rgui.c so they must be customised independently.

Can I look forward to something cool?

For future reference, all UI symbol icons like switches, battery, etc. are hardcoded in rgui.c so they must be customised independently.

Can I look forward to something cool?

Actually I'm only changing the ANSI chars in my customised RGUI but I think It would be cool to externalise both the fonts and symbol codes, so that if the corresponding BMP files exists in some path, they were translated to the C format in real time, otherwise fallback to the hardcoded images like now.

Maybe I can work on that when finishing some other projects that I'm involved

@trngaje Can we use your article in our docs while crediting your name and page?

@trngaje Can we use your article in our docs while crediting your name and page?

Feel free to use it. I wrote it in English for everyone. I will update it from time to time if the contents are confirmed incorrectly.