GithubHelp home page GithubHelp logo

bitmap-font-generator's Introduction

Fast and easy way to generate BMFont with images

Usage

  1. Create a directory and use the name of the font you are generating
  2. Prepare character images for the BMFont, you should name the images with the corresponding character, like 1.png, 好.png, a.png in the following figure, or alternately you can name the image file with two underscores followed by the unicode of the character(decimal base), like __35.png, __37.png, __46.png .
  3. If necessary change some configurations in gen_fnt.py, and the parameters are in class FntConfig
  4. Put the character images for generating font and the script gen_fnt.py in the directory created in step 1, and then run the script you will get the BMFont including a fnt description file and one or more image(s) as texture

source_images.png

Requirement

Python 3.x Pillow


方便快捷地用图片生成BMFont字体文件

使用方法

  1. 新建目录,目录名称为将要生成的字体的名称
  2. 准备用于生成字体的字符图片文件,注意将图片命名为字符,如下图中的1.png, 好.png, a.png,或将图片命名为双下划线加对应字符的unicode编码值(十进制),如下图中的__35.png, __37.png, __46.png
  3. 根据需要,在gen_fnt.py中修改配置参数,位于类FntConfig
  4. 把用于生成字体的字符图片文件与gen_fnt.py放置于第1步新建的目录下,运行脚本,即可生成字体文件,包含一个fnt字体描述文件及一个或多个图片纹理

source_images.png

运行需要

Python 3.x Pillow

bitmap-font-generator's People

Contributors

aillieo avatar wenlong66 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.