Reported by pylint's 'bad-whitespace' warning.
Not gonna enable this warning in the CI check, because it flags stuff
like deliberately aligning assignments and gets too cultish. Just a
cleanup pass.
For whatever reason, the common convention in Python is to skip spaces
around '=' when passing keyword arguments and giving default arguments:
f(x=3, y=4)
def f(x, y=8):
...
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The content of subsys/fb/cfb_fonts cannot be replicated by the existing
script due to lack of positioning options and use of a full-color frame
buffer, which affects the generated bitmap. Switch to the solution used
in the original script, add the required options, and document the
process of regenerating the fonts.
This commit also determines the required bounding box for the glyphs to
be sure that the user-provided value is sufficient to avoid partial
characters. Ideally the calculated width and height would be used for
font characters, but this would require significant restructuring of the
script to make calculated values available at the point where the
arguments are used to produce output.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The output of this script is intended to be put into an implementation
file, where the font data is accessed by index to an array maintained by
the linker script. There is no need for protection against multiple
includes, and the font data array should not be a global symbol.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The code to sanitize the generated font path by removing bindir
improperly stripped the first character of every argument when --bindir
was not provided, corrupting the command documentation when fonts are
generated manually. Only sanitize if --bindir was provided with
non-empty content.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The start of generated/cfb_font_dice.h looked like this:
/*
* This file was automatically generated using the following command:
* /home/john/zephyrproject/zephyr/scripts/gen_cfb_font_header.py
* --input fonts/dice.png --output
* /home/john/tmp/build/zephyr/include/generated//cfb_font_dice.h
* --width 32 --height 32 --first 49 --last 54
*/
For build reproduction and "privacy" reasons, change it to this:
/*
* This file was automatically generated using the following command:
* ${ZEPHYR_BASE}/scripts/gen_cfb_font_header.py
* --input fonts/dice.png --output
* zephyr/include/generated//cfb_font_dice.h
* --width 32 --height 32 --first 49 --last 54
*/
Test with:
sanitycheck -p reel_board \
-T $ZEPHYR_BASE/samples/display/cfb_custom_font/
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add script and cmake functions for automatically generating Character
Frame Buffer (CFB) font header files from image files, TrueType, or
OpenType font files.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>