https://github.com/bri3d/mcm2img
Convert Maxim MAX7456 MCM OSD fonts to images
https://github.com/bri3d/mcm2img
Last synced: 2 months ago
JSON representation
Convert Maxim MAX7456 MCM OSD fonts to images
- Host: GitHub
- URL: https://github.com/bri3d/mcm2img
- Owner: bri3d
- Created: 2022-03-28T03:49:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-08T03:31:55.000Z (about 3 years ago)
- Last Synced: 2023-10-03T05:13:06.524Z (over 2 years ago)
- Language: Python
- Size: 11.7 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MCM2IMG
Converts Maxim analog video overlay (for example, Betaflight and iNAV OSD) fonts to desired image format.
The Maxim format is documented here: https://www.maximintegrated.com/en/design/technical-documents/app-notes/4/4117.html
Useful for: previewing fonts, converting fonts for use in other applications, etc.
# Usage
python3 mcm2img.py mcmfile.mcm font.bin [rawfmt] [R] [G] [B]
Example:
python3 mcm2img.py betaflight.mcm font.bin RGBA 0 255 0` for green font colour
mcmfile.mcm file can found in the Configurator for your flight controller of choice.
For Betaflight, this is at `betaflight-configurator*\resources\osd\1`
If rawfmt is specified, it's one of the (many) raw bitmap formats supported by Pillow: https://github.com/python-pillow/Pillow/blob/main/src/libImaging/Unpack.c#L1483 . RGBA is probably the most common thing you will want here.
# Docker
The docker container will automatically convert all .mcm fonts found in `/app/fonts` with mcm2img.py
## Volumes
| Volume | Path |
|:-------|-----------:|
| fonts | /app/fonts |
## Environment variables
| Variable | Comment | Default |
|:---------|---------------------------------------------------|------------:|
| RGB | Used to override the colour of the converted font | 255 255 255 |
## Building
To build the docker image locally please use the following command:
docker build . -t mcm2img:latest
## Running
Copy the font files (.mcm only) somewhere and execute the following command:
docker run -v ${PWD}/fonts:/app/fonts -it mcm2img:latest