Solarus-Games English Forum

Solarus => Development => Topic started by: alexgleason on October 24, 2018, 10:03:38 PM

Title: How do PNG fonts work?
Post by: alexgleason on October 24, 2018, 10:03:38 PM
I noticed the docs say that .png fonts are supported. I'm hoping I can get clarity on what this means exactly.


Thanks!
Title: Re: How do PNG fonts work?
Post by: froggy77 on October 25, 2018, 12:34:52 AM
In older versions, there was a fonts.dat
http://www.solarus-games.org/doc/1.3/quest_font_list_file.html

In the latest version, I don't know. Here you will find some explanations

http://www.solarus-games.org/doc/latest/quest_fonts.html (http://www.solarus-games.org/doc/latest/quest_fonts.html)

Title: Re: How do PNG fonts work?
Post by: llamazing on October 25, 2018, 01:14:10 AM
Quote from: alexgleason on October 24, 2018, 10:03:38 PM
Is the PNG font a recognized standard?
I don't believe so
QuoteIs it just a row of characters in a specific order?
Yes, 16 rows by 128 columns, supporting the first 2048 unicode characters.
QuoteAre only monospace fonts supported?
yes, all characters must have the same width and height.
QuoteDoes it have to be 8px?
no, the total image width is a multiple of 128 and total image height is a multiple of 16. The size of each character is thus fixed based on the size of the overall png.
QuoteAre there any examples?
yes, from the alttp resource pack: https://gitlab.com/solarus-games/solarus-alttp-pack/blob/master/data/fonts/alttp.png
Title: Re: How do PNG fonts work?
Post by: alexgleason on October 25, 2018, 03:17:58 AM
Thanks a lot to you both!!