A command line tool to generate bitmap font (as a comply format to what BMFont outputs) from given PCF file.
pcf2bmfont [-W width] [-H height] [-n atlas_file] [-x xml_file] [-C] -i char_selection_file pcf_file
- -W, -H : Control the dimensions of the output atlas (as PNG)
- -x, -n : Specify the filename of the output XML atlas description file and the bitmap
- -C : Translate unicde to multi-bytes based on the Active Code Page of current OS before querying to PCF for glyph.
- -i : A text file in UTF-8 listing all needed chars. [Required]
Example:
pcf2bmfont -W 1024 -H 1024 -n atlas.png -x myfont.fnt -C -i chars.txt some_cool_font.pcf
The source code of the PCF parser used in this command-line tool can work out of the project -- just take the 'PCFFont.h' and 'PCFFont.cpp' out and add them in your project.
Some useful document for parsing PCF:
https://fontforge.github.io/en-US/documentation/reference/pcf-format/
- bmfm: Sister project. Deal with bitmap font generation.
- zlib and libpng: To read/write PNGs
- rapidxml: To parse and generate the XML atlas description files
- RectangleBinPack: A versatile rectangle packing algorithm with many variants.
- xgetopt: A cross-platform implementation of getopt().
zlib