Bitmap Font Generator Windows 10

Bitmap font generator This program will allow you to generate bitmap fonts from TrueType fonts. The application generates both image files and character descriptions that can be read by a game for easy rendering of fonts. Bitmap font generator. Does everything you need to produce new bitmap fonts. New System Fonts — Make your own Windows screen fonts by creating a new TrueType or Type 1 font in any outline font editor (FontLab, TypeTool or AsiaFont Studio). Then use FONmaker to make it into a screen font. Peter17 Peter17.

This program will allow you to generate bitmap fonts from TrueType fonts. The application generates both image files and character descriptions that can be read by a game for easy rendering of fonts.

The program is freeware and open source, but a donation is greatly appreciated.

If you don't have an image viewer capable of reading TGA, PNG, or DDS files, I recommend PUPP, another free product from AngelCode.

Downloads

Free bitmap fonts

Features

  • Support for complete Unicode 13.0 character set, as well as 8 bit OEM character sets
  • Optimal use of texture space, i.e. as little unused area as possible
  • Support for kerning pairs
  • Easy to use file format, either normal text file or xml files. Binary format is available for those that prefer that
  • 8bit or 32bit texture output (TGA, PNG, and DDS files)
  • Option for packing 4 layers of font images into 1 32bit texture. Needs special shader to render with, but saves a lot of memory
  • Anti-aliasing, both through Windows native font smoothing and super sampling
  • Configurable padding and spacing between characters
  • Select characters from text file, supports both UTF8 and UTF16 encoded files
  • Generate bitmap font from command line
  • Import colored images as characters, supports: bmp, jpg, tga, dds, png
  • Optional outline to font characters
  • Optional packing of characters with outline into 1 channel. Needs special shader to unpack during rendering, but saves a lot of memory
  • Use TrueType fonts directly from the file without installing them first
  • Autofit font size for target texture size
Bitmap

Documentation

The manual is included with the tool, but for those who wish to take a look at it without installing the tool first it is also available here. The manual describes bothhow to use the tool and the file format of the generated files.

Source code

Windows bitmap font

The source code is available under the widely known zlib license. The svn repositoryis hosted at SourceForge.net

Get the code by pointing your svn client at: http://svn.code.sf.net/p/bmfont/code/trunk.

If you want any support with the code, then please visit the forums.

Observation on virus alert

Avira anti-virus has been known to give a virus alert when scanning bmfont.exe or the installer. This is a falsepositive generated by their heuristic functions that tries to predict and catch unknown viruses. I've already reportedthis false positive to Avira a few times and each time they recognize it as a false positive, however for some reasonthe problem comes back months later (presumably when they update the heuristic functions).

If anyone has any idea what I need to change in the code to prevent this false alert I would very much like to know.

Tutorials & Resources

Here are a some links to other resources that provide information or tools that are useful for those interested in bitmap fonts.

Bitmap Font Generator Windows 10
  • Bitmap Fonts by Andreas Jönsson
  • Bitmap Fonts by Chad Vernon
  • Quick tutorial: Variable width bitmap fonts by Promit
  • BMFont OpenGL Implementation by legolas558
  • bmfont BlitzMax module by Mike Wiering
  • C# XML serializer for font loading by DeadlyDan
  • C# XML BMFont reader by Antoine Guilbaud
  • BMFont to C source code converter by Lars Ole Pontoppidan
  • PlayOnLinux - can be used to run BMFont on Linux
  • GlyphCombiner - a Mac OS X tool by Binary Blobs for combining multiple bitmap fonts into a single atlas

The following are some other tools that also generate output in the same format that I came up with for BMFont and that is widely usedin the industry today.

  • Littera - free web application
  • Glyph Designer - paid app for Mac
  • ShoeBox - free tool written with Adobe Air
  • Hiero - open source tool written in Java

Changes

  • 1.14 - 2021/01/05
    • Fixed crash with large fonts when Windows API incorrectly reported negative width for glyphs.
    • Improved handling of out-of-memory conditions.
    • Fixed crash that could occur when exporting unicode characters above 0x10000 with kerning pairs.
    • Fixed crash when command line argument -c was a relative path and the configuration included font file or image files.
    • Fixed crash when saving configuration file with added font file from the same directory.
    • Corrected the cell height when using fixed height and supersampling.
    • Fixed compatibility with Windows XP.
    • Fixed scaling issues and cropping when using height scale with render from outline.
    • Fixed application freeze when generating very large fonts.
    • The source code is now available under the zlib license.
    • Converted application to compile for Windows with Unicode to better support file and font names with international characters.
    • Updated libpng to 1.6.19.
    • Updated zlib to 1.2.8.
    • Updated libjpeg to 9a.
    • Updated libsquish to 1.13.
    • Fixed a problem with exporting glyphs for some international languages.
    • Added support for Unicode 13.0.
    • A 64bit build is now available to support huge bitmap fonts that require more than 2GB of memory to generate.
    • The default glyph for invalid characters is now properly rasterized when not rendered from outline too.
    • The status bar now shows the glyph id for the characters.
    • Fixed corrupt glyphs when rendering very large fonts (1000+ px) from glyph outline.
    • Added autofit that automatically determines the max font size that fits in defined texture size.
    • Fixed crash on startup if default font doesn't have the Unicode chars in range 0-255.
    • Added support for file paths with Unicode characters.
    • Improved support for kerning pairs in true type fonts that store them as ranges.
  • 1.13 - 2012/08/12
    • Added option to export fonts using fixed cell heights for easier post processing.
    • Improved support for exporting kerning pairs for true types that use the GPOS table instead of KERN table.
    • Kerning pairs are no longer exported for char ids that have been overridden with imported icons.
    • Improved glyph packing when there are large out of proportion images.
    • The final texture no longer has boxes around glyphs when a channel is inverted or set to one.
    • Fixed subpixel clipping in supersampled glyphs.
    • Implemented an alternative glyph rasterization based on the true type outline.
    • The rasterization from true type outline doesn't clip glyphs that extend above or below cell height.
    • Allow disabling hinting when rasterizing from true type outline.
    • Re-added option for rendering with ClearType with native Windows font engine.
    • Fixed bug where saved XML format sometimes didn't close the 'kernings' tag if there were no kerning pairs.
    • Fixed bug with duplicate kerning pairs in non-unicode font output.
    • Fixed problem where double-clicking in file dialog would sometimes change the selected characters under the mouse.
    • Enabled run-length encoding for TGA output.
    • Added option to force xoffset and yoffset to 0, and xadvance to width.
    • It's now possible to open the app directly with a configuration file from the file explorer.
    • When loading a bmfc file the characters are now selected accordingly.
    • The font dialog no longer lists rotated fonts, i.e. those prefixed with @.
    • Added support for working with a font from a file so it is no longer necessary to install it first.
    • Imported images are now stored with a relative path in the configuration file.
    • Fixed clipping that could occur on left and right edges when generating a font in italic mode.
    • Kerning pairs can now be optionally left out in case they are defunct in the TrueType font.
    • The save and load configuration dialogs will now initiate where the last configuration file was loaded or saved.
  • 1.12 - 2009/08/02
    • Added presets to the export options to aid choosing the correct values for the texture channels.
    • Fixed bug when generating font from command line where the page files in the font descriptor would have the incorrect name.
    • Added ability to invert individual texture channels for more export options.
    • Added command line tool that will wait for the generation to complete before exiting.
    • Fixed the yoffset when the font height was scaled.
    • Fixed bug in select chars from file for non-unicode with characters above ASCII 127.
    • The number of digits for the page id in the texture files is now adapted to the number of generated pages.
    • Added support for adjusting xoffset, yoffset, and advance for imported icons.
  • 1.11b - 2009/03/08
    • Fixed a bug in the select chars from file with UTF16 encoded files.
    • Fixed a bug in the packing routine that could make characters overlap in rare situations.
    • Fixed the selection of unicode ranges by clicking on the check mark in the list.
  • 1.11a - 2008/12/06
    • Fixed the subpixel misalignment in the glyph height caused by supersampling.
    • Worked around a bug in GDI where the returned glyph height is smaller than the actual glyph bitmap.
  • 1.11 - 2008/10/11
    • Fixed a freeze that could happen while selecting characters from file.
    • Fixed cropping in some true type fonts.
    • Fixed the 'Select All Chars' option in ASCII mode.
    • Added option 'Output invalid char glyph'.
    • Removed the 'Disable unavailable chars' option.
    • Fixed problem where characters not defined in the unicode standard could be selected when selecting chars from file.
    • An indicator is now displayed in the character grid where images are imported.
    • Fixed bug where main window is moved behind other windows when closing image manager.
    • Fixed bug where cancelling the icon image dialog would still effectivate the changes.
    • It's now possible to select font size by character height, rather than line height.
  • 1.10b - 2008/06/15
    • Fixed the channel indicator in the font descriptor for colored icons.
    • Fixed cropping of characters in small fonts.
    • Fixed bug with black 8bit textures when the check box for pack chars is checked.
  • 1.10a - 2008/06/08
    • Corrected the documentation in regards to the block size value in the binary file format.
    • Fixed a bug with the 'Select chars from file' where some character might be skipped between reading blocks of 1kb.
    • Fixed a rounding problem with supersampling that made the exported line height be one less than the largest character height.
    • Removed the external dependency on the Microsoft DLLs.
    • Upgraded libpng to 1.2.29.
  • 1.10 - 2008/05/11
    • Selecting characters from file now supports both UTF-8 and UTF-16, with automatic detection via byte-order-mark.
    • Fixed a bug where unicode subsets where not shown when disable undefined characters was unselected.
    • Status bar shows character id for the character under the mouse cursor.
    • Added 'clear all' option.
    • Preview window is now automatically resized to fit the texture when scaling.
    • Added support for unicode characters above 0xFFFF.
    • Added support for generating textures with DXT1, DXT3, and DXT5 compression.
    • Split the font settings dialog in two dialogs, one for the font graphics and one for export options.
    • The content of each texture channel can now be customized.
    • File format updated to accomodate new feature.
  • 1.9c - 2007/11/16
    • Fixed the reversed spacing values in the font settings dialog.
    • The font generation can now be aborted while the characters are being added to the texture.
    • Greatly improved the speed of generating textures.
  • 1.9b - 2007/10/28
    • Fixed the padding
    • Improved documentation
  • 1.9a - 2007/09/16
    • Allowing unicode for all fonts, even fonts that have only one code page
    • Fixed the status messages when generating fonts
  • 1.9 - 2007/08/19
    • Added support for importing colored icons
    • Supported input image formats are: bmp, tga, png, jpg, dds
    • Added support for giving a black outline to characters
    • Characters with outline may be encoded in 1 channel to save space
    • Outline is generated with rounded corners
    • Increased the binary file version because there is new information
  • 1.8c - 2007/01/25
    • Fixed a bug where the font saver got confused with the 4 chnl packed flag set, even though saving in 8bit format
  • 1.8b - 2007/01/06
    • Fixed kerning amount in binary file format when using super sampling
  • 1.8a - 2006/11/23
    • Fixed alignment bug with 8bit TGA and DDS files with non-power-of-4 widths
    • Fixed crash on Windows with installed Input Method Editors, e.g. Japanese and Chinese Windows
  • 1.8 - 2006/11/11
    • Added support for binary font descriptor file
    • Added support for saving PNG texture files
    • The application now remembers the configuration from last execution
    • Improved useability for selecting characters in unicode mode
    • Added option to select all characters from a text file
    • Kerning pairs with amount 0 are no longer output
    • XML font descriptor file now groups the pages, chars, and kerning pairs
    • The font configuration can be saved to disk, and later reloaded
    • Added support for generating fonts via command line using a saved configuration.
    • Added support for saving DDS texture files (no compression)
  • 1.7a - 2006/09/12
    • Fixed the creation of non-unicode fonts
  • 1.7 - 2006/09/08
    • Added the standard xml header
    • Added support for unicode charsets
    • Added the option to pack monochrome characters into each of the 4 channels of a 32 bit texture
    • Added tag with texture file names in the font descriptor file
    • The generation of textures is now done in a background thread
  • 1.6 - 2006/02/18
    • It's now possible to choose between XML and text for the format of the font descriptor file.
    • Fixed kerning sizes with super-sampling
  • 1.5 - 2005/10/01
    • Implemented stretching so that fonts can now be non-uniformly scaled (only works on Win2K or later).
  • 1.4a - 2005/08/26
    • Non-TrueType fonts, such as Script and System, are now supported as well.
    • Minor fix to rendering when padding is used.
  • 1.4 - 2005/07/17
    • The preview window now shows the page number in the title.
    • Characters without a defined glyph may now be automatically removed (only works on Win2K or later).
    • Kerning pairs are now saved as well.
    • Added support for chooseable charset, e.g. arabic and hebrew fonts.
  • 1.3 - 2005/05/08
    • Added support for italic fonts.
    • Application no longer crashes when visualizing with no characters selected.
  • 1.2 - 2005/03/09
    • User can now choose to generate the bitmap font with or without font smoothing.
    • Font smoothing is now done without ClearType, so that artifacts are no longer generated in the output texture.
    • Added program icon.
  • 1.1 - 2005/03/05
    • User can now choose to save in 32bit and 8bit TGAs.
    • The spacing between characters can now be manually set.
    • Fixed the bug where some fonts weren't visible in the font list.
  • 1.0a - 2004/11/27
    • Fixed a problem with values that where not adjusted to compensate for antialiasing level.
  • 1.0 - 2004/02/14
    • First public version.

Special thanks to

Some of the things that will be implemented in future versions:

  • Improved font generation
    • Support for drop shadow.
    • Support for blurring.
    • Colored glyphs.
  • Improve the useability.
    • Add a help command that opens the manual installed with the application
    • Add tooltips for dialogs and controls
    • Selecting characters from a file could support a drag-and-drop interface.
    • Importing images over characters could also support a drag-and-drop interface.
    • Add logfile output for missing glyphs when scanning text files for used characters.
    • Allow selecting font from the windows common font dialog
  • Add font preview
    • Allow user to write text and see the outcome. It should be possible to encode special characters as icons are usually imported over non-visible glyphs
  • Improve icon import
    • Allow importing grayscale images into a single channel, rather than full 32bit.
    • Warn if imported icon is larger than output texture.
    • Context menu in character window to import directly to a specific character.
  • Add plugin support for output formats.
    • Allow the plugins to format both font descriptor and image files.
  • Signed distance fields for improved quality zooming on bitmap fonts. Here's a tool that convert BMFont output to distance field fonts.
  • Support multiple fonts and different font sizes in a single output.
Bitmap

The Dot Factory is a small open source tool (MIT licensed) intended to generate the required C language information to store many fonts and images, as efficiently as possible, on a microcontroller. These fonts are then uploaded via the LCD driver (see the Drivers and Modules page for a few) to the actual dot matrix LCD. It is written in C# for Visual Studio 2008 and has been tested on Windows XP, 2003, Vista, 7 and Linux via Mono.

Working with dot matrix LCDs with microcontrollers, while not difficult, is tedious. The actual LCD controller allows us to upload simple visual data (dot on or dot off) into the LCD’s dot matrix, but not much else. It is up to our software to decide what to upload when we want to draw lines, circles and more importantly – text.

While there are software graphic libraries that allow us to generate a character “on the fly” using vector graphics (the character is described as a series of drawing commands that allow scaling and decoration) – these are much too complex and large to integrate in a microcontroller environment. Consequently, we must store the exact appearance of a character as a series of 1s and 0s, equivalent to a “dot on” “dot off” on the LCD, and upload this as a bitmap when we want to display text. While it is possible to generate this manually, it is desired to have a tool to do our grunt work by converting windows fonts (given a size and decoration) into a series of bitmaps.

Using The Dot Factory

TDF is comprised of two panes – the input pane on the left (what you want to generate) and the output pane on the right (the generated output, in C code). The input pane can accept either a font of your choice (for writing text to the LCD) or an image. When generating a font, you have the option of either generating all the available letters (by selecting “All” in the Insert Text box and clicking the plus button) or by typing in which letters, numbers or symbols you are actually using in your application (for example: 0123abcd). If you are writing a simple application that has only a few sentences, you can type them wholly in this box without fear of duplicating letters – TDF takes care of that by discarding any duplicates. This way only the letters you use will take up space.

Once you have completed setting up what it is you’d like to generate (be it an image or font), select the output method in the output pane. If you are using the LCD drivers on this website, you want it to generate an MSb first output, otherwise images will come out wrong. If you have a compiler that supports the “0b” binary specifier, you can select “binary” rather than “hex”. This will allow you to visually see the pixels you will set and allow for manual touch up by the user without having to calculate hex and experimentation. Click generate and your C code will be outputted to the text box below. Copy paste this into your application (it is recommended to put this in a separate module, not your LCD driver module, for organizational reasons).

Note that 5×7 and 5×8 fonts cannot be generated using this tool. While some TTF fonts can render characters this small they are usually distorted to the point of uselessness. You can download a ready made five by seven font here. I ripped this font from text file a while ago, so apologies to the uncredited author.

What does it generate?
For font generation, three entities are generated.

  • The character bitmap array: This holds the actual characters as a bitmap (only the characters selected in the input pane). Each byte represents a single vertical page sent to the LCD. All vertical padding is removed from the characters
  • The character descriptor array: Allows O(1) mapping between a character’s ASCII value and required meta information about the character – namely its width in bits and its offset into the character bitmap array. When the LCD driver needs to find where character X is located in the bitmap array, it will jump to index [X - font.startCharacter] in the descriptor array. The startCharacter is the first character (that is, the character with the lowest ASCII value) used for this font. By defining a startCharacter we can reduce the number of elements in the descriptor array.
  • The font information: This element is essentially the font descriptor for this font. It holds information regarding this font like the name of the character bitmap and descriptor arrays, the font start character and how many pixels wide a space character is for this font. The LCD driver will replace the space character with empty pixels (this saves both processing time, space in the character bitmap array and space in the character descriptor array – since the space is the first ASCII character and is commonly used).

Bitmap Font Generator Windows 10 Copy

The generated structures are generated with documentation, but you may want to see a sample bitmapDb header file for detailed info on the character descriptor array and font information structures. For image generation, only the image’s bitmap array and size descriptors are generated. Note that the height value is pixels (bits) and width values are in pages.

Revision history

I usually release versions according to user demand. If you think TDF can use whatever feature, drop me a line. When enough users request something I invest the time to add it.

  • Version 0.1.4 (2jun12): Support for “Column Major” mode where each byte represents a column rather than a row – contribution by Paul Ryland
  • Version 0.1.3 (31mar12): Linux support with Mono – contribution by mru00
  • Version 0.1.2 (29may11): Fixed width/height being swapped. Added support for configuring image descriptor format (bits/bytes). Thanks geo for the heads up and suggestion
  • Version 0.1.1 (25may11): Added support for multiple descriptor arrays with a double lookup. Before this version TheDotFactory could generate Unicode characters but the lookup tables were usually too huge to be of any use. Using this feature, a double lookup is employed, allowing for fast lookups for characters residing at disparate ranges. See the video for an explanation (will be posted in the next few days). In addition to this, added support for specifying character ranges instead of inputing the actual characters. For example, <<100-120>> will generate characters for ASCII characters 100 to 120. Thanks a bunch to Archis Bhave for inputs and testing. Source is now distributed via github.
  • Version 0.1.0 (15dec10): Added support to format the generated variable names (thanks SpiralBrain), added end character indication to font information (thanks Nick Jensen), added the ability to save to clipboard from File menu and added the ability to save the source/header to file via file menu (don’t remember who, but someone wondered why this wasn’t in. I personally think all fonts should be in a single module and so I opted for copy/paste, but to each his own)
  • Version 0.0.9 (06jun10): Fixed a bug that prevents the space character from being generated (broken in 0.0.8 – thanks Thomas Kibalo)
  • Version 0.0.8 (29may10): Fixed two unreported crashes (clicking generate without entering any text and when a newline existed in generated text), added the ability to copy the outputted text by using a context menuVersion 0.0.7 (28may10): Added ability to select whether character descriptor array is to be created and which character will be used to visualize the font (thanks Christian Treczoks), syntax coloring automatically disabled when generating large amounts of text (will be fixed properly next version), properly handled bitmaps with no black pixels in them (displays error instead of a crash), some minor cosmetics
  • Version 0.0.6 (03mar10): Bug fix for image generation (tried to save a temporary file for debugging in a custom directory) – thanks to Nir Shemeshfor pointhing this out!
  • Version 0.0.5 (23dec09): Added support for rotation (90 degree increments), space character generation, width (bit/byte) selection of character width and font height, optional generation of character height/width and font height, structures are now generated with documention, input text and font is persisted throughout invokations of the application, persistent preset management – add, edit, delete output configuration presets
  • Version 0.0.4 (31jul09): Added a space to end of comments in the char descriptor array to prevent preprocessor misinterpreting ‘’ as a newline
  • Version 0.0.3 (30jul09): Added output configuration: hex/binary, MSb First/LSb first, configurable padding removal, comment control, flip X/Y and more
  • Version 0.0.2 (28jul09): Vista support
  • Version 0.0.1 (25jul09): Initial release (flip not supported, output format not supported, not tested on Vista)

Bitmap Font Generator Windows 10 Online

Download

To run this executable, you must have the .NET framework installed. The stable binary has been in the wild for a month at least with no major bugs reported. Non stable binary contains new features and bug fixes (see revision history).

Bitmap Font Generator Windows 10 Free

  • Latest binary (0.1.4): Windows 7/Vista/XP/2003, requires .NET framework 3.5

Bitmap Font Download

Up to date source can be found at Github.