Giter Club home page Giter Club logo

adafruitgfxfonttools's Introduction

AdafruitGFXFontTools

A small collection of command-line utilities to work with the Adafruit GFX font format.

Written in C# and targets .NET 4.7. A port to .NET Standard would probably be quite easy but I couldn't be bothered. Windows builds are available on the Releases page.

All contents are released under the Unlicense. Help yourself!

Note that all utilities assume the font files are generated in a format compatible with Adafruit's fontconvert tool. Tested against all the standard included fonts, your mileage may vary for other fonts.

Usage

AdafruitGFXFontToBitmap

Produces a Windows bitmap (.bmp) file for one or more font (.h) files. Useful for creating UI mockups.

The output bitmap contains all glyphs in order from left to right as white text on a black background, with grey lines separating each glyph.

Multiple files can be specified on the command line, as well as wildcards. The output filename will have the ".bmp" extension added to the original filename.

Examples

  AdafruitGFXFontToBitmap.exe FreeMono9pt7b.h
  AdafruitGFXFontToBitmap.exe FreeSans9pt7b.h FreeSans12pt7b.h
  AdafruitGFXFontToBitmap.exe Fonts\*.h

AdafruitGFXFontTrim

Creates a "trimmed" version of a font, where only the data for the characters you are interested in will be kept. For example, if you want to use FreeSansBold24pt7b but only need the digits, the trimmed version of the font will save around 7kb of storage (from approximately 8815 bytes to 1034 bytes).

The first parameter is a regular expression to match the characters to keep. All remaining parameters are filenames, and may include wildcards.

Be aware that this can reduce the range of valid characters! Attempting to display characters outside of the range will use whatever program memory is at that location and the results are unpredictable at best! Intermediate characters are encoded as having a width and height of 0 and are relatively safe.

Examples

  AdafruitGFXFontTrim.exe [0-9] FreeMono9pt7b.h
  AdafruitGFXFontTrim.exe [\w] FreeSans9pt7b.h FreeSans12pt7b.h
  AdafruitGFXFontTrim.exe "[0-9,\.:]" Fonts\\*.h

adafruitgfxfonttools's People

Contributors

mvrens avatar

Watchers

 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.