Coder Social home page Coder Social logo

benbaker76 / fontbm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vladimirgamalyan/fontbm

1.0 1.0 0.0 2.55 MB

BMFont compatible, cross-platform (Linux/macOS/Windows) command line bitmap font generator (FreeType2 based) including the Adobe OpenType-SVG format.

License: MIT License

C++ 81.87% Python 12.91% C 0.06% CMake 5.16%

fontbm's Introduction

fontbm

BMFont compatible, cross-platform (Linux/macOS/Windows) command line bitmap font generator (FreeType2 based renderer) including the Adobe OpenType-SVG format.

sample sample sample

Status

Linux macOS Windows
Actions Status Actions Status Build status

Usage

Download compiled version (fontbm.zip for Windows, fontbm for Linux) from Releases. Run:

fontbm --font-file FreeSans.ttf --output myfont

It will produce myfont.fnt (file format) and myfont_0.png (how to render text).

Available options (bold options are required):

option default comment
--font-file path to ttf file, required
--output output files name without extension, required
--font-size 32 font size (it matches to BMFont size, when "Match char height" option in Font Settings dialog is ticked)
--chars 32-126 required characters, for example 32-64,92,120-126 (without spaces), default value is 32-126 if 'chars-file' option is not defined
--texture-size 32x32,64x32,64x64,128x64, 128x128,256x128,256x256, 512x256,512x512,1024x512, 1024x1024,2048x1024,2048x2048 comma separated list of allowed texture sizes (without spaces), the first suitable size will be used
--texture-crop-width crop unused parts of output textures (width)
--texture-crop-height crop unused parts of output textures (height)
--color 255,255,255 foreground RGB color, for example: 32,255,255 (without spaces)
--background-color background RGB color, for example: 0,0,128 (without spaces), transparent by default
--chars-file optional path to UTF-8 text file with additional required characters (will be combined with 'chars' option), can be set multiple times
--data-format txt output data file format: txt, xml, bin, json, cbor
--kerning-pairs disabled generate kerning pairs: disabled, basic, regular (tuned by hinter), extended (bigger output size, but more precise)
--padding-up 0 padding up
--padding-right 0 padding right
--padding-down 0 padding down
--padding-left 0 padding left
--spacing-vert 0 spacing vertical
--spacing-horiz 0 spacing horizontal
--monochrome disable anti-aliasing
--extra-info write extra information to data file
--max-texture-count maximum generated texture count (unlimited if not set)
--texture-name-suffix index_aligned texture name suffix: "index_aligned", "index" or "none"

Building Linux

Dependencies:

Build:

cmake .  
make

Building Windows (using vcpkg)

Download and install vcpkg and CMake 3.10.2 (or above). Run:

vcpkg install freetype
cmake -G "Visual Studio 14 2015" -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg dir>/scripts/buildsystems/vcpkg.cmake

Open .sln in Visual Studio 2015 and rebuild all.

Building Windows

Download and install CMake 3.0 (or above) and FreeType. Run:

cmake -G "Visual Studio 14 2015"

Open .sln file in Visual Studio 2015, configure paths to FreeType and rebuild all.

Building macOS

(thanx to andycarle Moddable-OpenSource/moddable#325 (comment))

brew install freetype
git clone https://github.com/vladimirgamalyan/fontbm.git
cd fontbm
cmake .
make

Contributors

Special thanks

License

MIT License

The project also bundles third party software under its own licenses:

fontbm's People

Contributors

vladimirgamalyan avatar karjonas avatar phoddie avatar benbaker76 avatar

Stargazers

Emilio P Egido avatar

Watchers

 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.