Author Topic: How do PNG fonts work?  (Read 2944 times)

0 Members and 1 Guest are viewing this topic.

alexgleason
  • Full Member
  • ***
  • Posts: 128
  • Vegan on a Desert Island
    • View Profile
    • Vegan on a Desert Island
How do PNG fonts work?
« 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.

  • Is the PNG font a recognized standard? Eg do multiple programs use the same format
  • Is it just a row of characters in a specific order?
  • Are only monospace fonts supported?
  • Does it have to be 8px?
  • Are there any examples?

Thanks!
RIP Aaron Swartz

froggy77

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: How do PNG fonts work?
« Reply #1 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

« Last Edit: October 25, 2018, 12:36:37 AM by froggy77 »

llamazing

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: How do PNG fonts work?
« Reply #2 on: October 25, 2018, 01:14:10 AM »
Is the PNG font a recognized standard?
I don't believe so
Quote
Is it just a row of characters in a specific order?
Yes, 16 rows by 128 columns, supporting the first 2048 unicode characters.
Quote
Are only monospace fonts supported?
yes, all characters must have the same width and height.
Quote
Does 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.
Quote
Are there any examples?
yes, from the alttp resource pack: https://gitlab.com/solarus-games/solarus-alttp-pack/blob/master/data/fonts/alttp.png

alexgleason
  • Full Member
  • ***
  • Posts: 128
  • Vegan on a Desert Island
    • View Profile
    • Vegan on a Desert Island
Re: How do PNG fonts work?
« Reply #3 on: October 25, 2018, 03:17:58 AM »
Thanks a lot to you both!!
RIP Aaron Swartz