Skip to main content

A small command line tool to convert PixelForge font files into c-arrays for the electrosmith daisy

Project description

daisy font converter

A small command line tool to convert PixelForge font files into c-arrays for the electrosmith daisy.

Usage

daisyfontconverter --input pat/to/my_font.pxf --width 4 --height g

Example output

static const uint16_t Font4x6[] = {
    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Space
    0x0000, 0x4000, 0x4000, 0x4000, 0x0000, 0x4000, // !
    0x0000, 0xA000, 0xA000, 0x0000, 0x0000, 0x0000, // "
    ...
    0x0000, 0x0000, 0xE000, 0x2000, 0x4000, 0xE000, // z
    0x0000, 0x6000, 0x4000, 0xC000, 0x4000, 0x6000, // {
    0x0000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, // |
    0x0000, 0xC000, 0x4000, 0x6000, 0x4000, 0xC000, // }
    0x0000, 0x0000, 0x2000, 0xE000, 0x8000, 0x0000, // ~ Tilde
};

FontDef Font_4x6 = {4, 6, Font4x6};

The result of that output should go into oled_fonts.c in libDaisy. Additionally put a extern FontDef Font_4x6; into oled_fonts.h

Run task build_all in VSCode and use your font as usually

Installation

Option A: just download the python script in the daisyfontconverter directory (no external dependencies) and run it with python:

python3 cli.py -input pat/to/my_font.pxf --width 4 --height g

Option B: Install via pip using

pip install daisyfontconverter

and run via

daisyfontconverter --input pat/to/my_font.pxf --width 4 --height g

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daisyfontconverter-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

daisyfontconverter-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file daisyfontconverter-0.1.0.tar.gz.

File metadata

  • Download URL: daisyfontconverter-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for daisyfontconverter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 289d8346cb7bd46a73224ee486cc6b7202444ce41112ef84277b44c11c4fa52f
MD5 a647ca8a38ff02a5d3a4ea83cbc9d2da
BLAKE2b-256 3145312db80faa1735319b92f5f4aab699fa5e9f216d99759191bd20ff218701

See more details on using hashes here.

File details

Details for the file daisyfontconverter-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: daisyfontconverter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for daisyfontconverter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9600ac2619750843149cf1079cab7aace21e9170ff39612ee8c8a01a45bf135a
MD5 22e46c717d47d728ed8ae72783bfa7f6
BLAKE2b-256 1acfeb78ecbcf03a4753e8ac12e743b17768649958cc1bc6bed0771a86fe326c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page