Jump to content

generating bitmap font xml


feri
 Share

Recommended Posts

Hi All

I have characters in png file format (they are created in illustrator) and I wanna make bitmap font from them. I can create sprite sheet using texture packer but I need to create xml file for bitmap font. I am just wondering if there is a tool available to get png file and generates xml file that is supported by Phaser. I can do it manually but it is alot of work, I thought there might be some tools out there to automate some of the work for me.

Thanks

Link to comment
Share on other sites

Thanks for your reply. I think i wasnt clear enough. I have my png font file and i just need xml file for my png. Littera is a great tool to create png font file and its xml all together, it doesn't generate xml based on a font image.

thanks

Link to comment
Share on other sites

Hi, I had similar problem - I needed to create bitmap font xml from sprites I had.

What I did is I created excel file that helped me to create xml defs. In attachment you can download it. It is without support nor feature requests, but I will describe here, how it works:

 First create standard sprite atlas with your characters. Open .json and locate data for your chars. Open excel and copy chars data to cell N1 and bellow (you will probably be missing property "anchor" if you are using texture packer, so you will have to adjust either excel or your output to include empty line ... or you can use my atlas tool - it is reffered in this article: http://sbcgamesdev.blogspot.cz/2016/03/phaser-tutorial-merging-fonts-into.html)

 Next, put chars you need into column A - it must be in order of your json output! (not sure if Texturepacker guarantees order, but my tool does) - in case of need add lines. Formulas in column B extracts data and build xml entry. Finally, copy text in column B and save it as .xml. In cell L1 you can adjust how many pixels will be added between characters (characters spacing). This excel tool does not support kerning. Play with B2, B3 texts to adjust line height or default font height.

 

FONT_YELLOW.xlsx

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...