Additional options and C++ output support - #7
Open
alexwarg wants to merge 11 commits into
Open
Conversation
added 11 commits
March 11, 2026 20:01
Allow generation of all files into one flat directory with --nosubdirs. With --nospaces file names will get spaces replaced by underscores.
The new option --vertical allows to generate the bytes for the bitmap in vertical first order. Normally bytes are ordered in rows from left to right. With this option enabled bytes are ordered each column top-down and all rows left to right at once. This allows for vertical addressing mode in OLED display which sometimes simplifies left and right padding when drawing directly to the display without an additional frame buffer.
The option --usebbox switches from fixed form-factor bitmaps with a fix width to height ratio to using the fonts bounding boxes for calculating each glyph size according to the font. This allows for a better rendering and kerning result.
The new option --hex generates the bitmap data in the for of 2 digit hex numbers in a nice grid instead of a one-line decimal array.
Compactify code generation.
With the new option --cpp the output is C++ header files with a struct with static constexpr data members for all the data. This avoids global namespace pollution with 'bitmap...' variables and allows also additional metadata for the fonts, like narrower bitmaps for wider glyphs etc.
This fixes an undefined variable with the --fh option
This is actually two 8bit rows on monochrome OLEDs
The new --autosize option in combination with the usebbox option allows to scale the selected font to fill the full desired height of the bitmap font keeping the given margin equally split top and bottom. The algorithm takes the full list of characters and keeps relative size and position correct. However, the font might end up smaller or bigger if some glyphs that go below the base line are missing or added (such as y, p, q etc.). The rest is cleanup of the C++ code generation and.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The changes are to provide a wider variety of options for bitmap and code generation. As well as generating C++ header files with structures for different fonts.
In addition the C++ headers allow for fonts with variable bitmap width while providing information for left and right padding of glyphs.