Giter VIP home page Giter VIP logo

ubfg's Introduction

Ultimate Bitmap Font Generator

Ultimate bitmap font generator - useful tool to create compact font textures for games

If you know Russian - welcome: http://www.gamedev.ru/projects/forum/?id=152527

Feature list:

  • multiple fonts may be packed into one texture
  • extremely effective packing algorithm + subcharacters merging
  • optimizied not only for English: generate Russian, Japanese, Chinese fonts
  • easy-to-create characters list from text
  • distance fields for easy OpenGL scalable fonts
  • exporting kerning pairs
  • free and open-source project

UBFG can export font into XML format (image in base64 format also stored in XML) or into it's own .fnt format, - ready to use with Cheetah 2D engine. XML format is self-described, .fnt format uses following spec.

UBFG generates two files: font.png and font.fnt.

  • font.png is an image, that represents your font texture. You must load it as texture.
  • font.fnt is a text file, that contains information about all chars on font.png.

This information looks like:

Arial 9pt -- font name and size
Char  X pos   Y pos   Width   Height   Xoffset  Yoffset  Orig W   Orig H
32    0       0       0       0        3        14       3        14
97    90      36      5       7        1        4        7        14
98    0       41      5       9        1        2        7        14
kerning pairs:
32 97 -1
32 98 -0.5

Here:

  • Char - UNICODE number of your char (codepage varies and may be specified before export). For example, 32 is a 'space'
  • X pos - x position of glyph on texture
  • Y pos - y position of glyph on texture
  • Width - width of glyph on texture (glyphs are cropped and Width and Orig Width aren't equal)
  • Height - height of glyph on texture
  • Xoffset - distance on the x-axis, on which glyph must be shifted
  • Yoffset - distance on the y-axis, on which glyph must be shifted
  • Orig W - original width of glyph
  • Orig H - original height of glyph

Also fnt format may have kerning pairs: a set of kerning pairs listed after phrase "kerning pairs:". First number if a first character in pair, second number - second character in pair, third number - kerning value. Note: this value may be with floating point if you use distance fields.

Help image

Screenshot:

Screenshot

ubfg's People

Contributors

scriptum avatar ardy123 avatar nikolaybespalov avatar kodemeister avatar

Watchers

James Cloos avatar  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.