Image format for get_font_id(<file_name>)

Tyrus
Tyrus Member Posts: 6 Member

Does someone have an example of what the format of an image is supposed to be for use with get_font_id(<file_name>)? My text shows up as thin vertical slices of random characters instead of the characters I type. I assume it's a problem with my .png image and/or the .txt file that accompanies the image. Here's what I did:

  1. Made an image with of the characters in windows-1252 order: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
  2. I omitted control characters and any characters after 126, since I wasn't sure how to render them
  3. I Put a single red (#FF0000) pixel in the top left corner of each character in the image
  4. I made a .txt file to accompany the image just like other images. I don't know if it needs special content for fonts.

fontimage.txt:

Has Alpha Channel: yes
Number of Animations: 94
Horizontal Animation: yes
Vertical Resizable: no
Horizontal Resizable: no
Fixed Top: 0
Fixed Bottom: 0
Fixed Left: 0
Fixed Right: 0

What am I doing wrong?

Best Answer

  • EvilDragon
    EvilDragon Moderator Posts: 1,021 mod
    edited February 2022 Answer ✓

    Number of animations needs to be 1. The PNG absolutely has to have 256 #FF0000 dots. So first 32 chars also need 32 red dots, and anything after ~ also needs their red dots.

    Also, this plugin for Figma could be useful!

Answers

  • EvilDragon
    EvilDragon Moderator Posts: 1,021 mod
    edited February 2022 Answer ✓

    Number of animations needs to be 1. The PNG absolutely has to have 256 #FF0000 dots. So first 32 chars also need 32 red dots, and anything after ~ also needs their red dots.

    Also, this plugin for Figma could be useful!

Back To Top