Skip to content

rayyee/convert2fnt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

一.使用

新版的工具已经不需要安装任何附属的东西了,只需两步,就可解脱~

1).修改图片名

这一步十分容易,我们约定一个规则,规定图片的命名为x_y.png,这样x就是最终.fnt.png的名字,而y就是对应字符的ASCII码,这样我的图片最后命名是这个样子的:

fighting_header_shuzi_48.png 	#0
fighting_header_shuzi_49.png 	#1
fighting_header_shuzi_50.png 	#2
fighting_header_shuzi_51.png 	#3
fighting_header_shuzi_52.png 	#4
fighting_header_shuzi_53.png 	#5
fighting_header_shuzi_54.png 	#6
fighting_header_shuzi_55.png 	#7
fighting_header_shuzi_56.png 	#8
fighting_header_shuzi_57.png 	#9
fighting_header_shuzi_109.png 	#m

最后一个m是因为我的图片中包含了一个m字样的图片,具体ascii码表可以在这里查.

2).下载可执行程序

windows:

bin/win32/images2fnt.exe拷贝至你的碎图目录,双击运行.

mac:

bin/mac/images2fnt拷贝至你的碎图目录,启动终端,键入./images2fnt.

然后...然后就神奇的东西出现了呢,在output目录下会找到你想要的东西~

二.项目

项目采用Python编写,主要依赖了这几个库:

  1. Pillow
  2. Pyinstaller

Pillow是Python的图片处理库,前身是Pil,项目使用Pillow拼接图片,获取图片信息.

Pyinstaller是Python的一个发布工具,会将代码打包成可执行文件,十分方便.

About

A fnt convert tools

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.3%
  • Batchfile 1.1%
  • Shell 0.6%