Feat/ssd1306 bigfont#7241
Conversation
Added self.font_profile, glyphs and profile fallback character as new parameters of the DisplayBase class to wire up the added display_font config section. Signed-off-by: Christian Hofbauer <chof@gmx.at>
Added the following classes following the strategy pattern to customize font source loading, swizzling and font cache building: - FontSourceStrategy: Loads the font and return font parameters - SwizzleStrategy: Convert from "rows of pixels" format to display native format - FontCacheBuilder: Combines the sourcing with swizzling to load a font ready for the display Signed-off-by: Christian.Hofbauer <chof@gmx.at>
…EDs with klippy - introduce font rading and swizzling strategies - add `BuiltinVGAFontSource` and `PageSwizzleStrategy` to provide builtin and external font loading - refactor `uc1701.DisplayBase` to use swizzled `FontObject` rendering (dynamic glyph width/pages) instead of hardcoded VGA tuples - add SSD1306 panel `height` support (`32|64`) and select mux/COM init commands from configured panel height to allow customizable line heights - move `DisplayFont` config parsing into `klippy/extras/display/fonts` and wire `[display] font` to OLED chips in `display.py` - rename and integrate BDF loader as `BdfFontSource` with strategy registration in `DISPLAY_FONT_SourcingStrategies` Signed-off-by: Christian.Hofbauer <chof@gmx.at>
…tion out of the repository Signed-off-by: Christian.Hofbauer <chof@gmx.at>
Includes sample configuration, trouble shooting in the FAQ and entry into the config change log Signed-off-by: Christian.Hofbauer <chof@gmx.at>
Signed-off-by: Christian.Hofbauer <chof@gmx.at>
Signed-off-by: Christian.Hofbauer <chof@gmx.at>
Signed-off-by: Christian.Hofbauer <chof@gmx.at>
Signed-off-by: Christian.Hofbauer <chof@gmx.at>
|
Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html There are some steps that you can take now:
Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available. Best regards, PS: I'm just an automated script, not a human being. |
Intent
Extends the build-in VGA fonts with configurable text fonts for OLED displays. To enable larger/custom fonts on SSD1306/SH1106 displays.
High-Level Solution
Introduce a pluggable font pipeline in Klipper display code.
A new
[display_font <name>]section defines external font profiles (currentlybdf), and[display]can select one viafont: <name>. OLED rendering is updated to use dynamic font metrics and panel height (32/64) instead of fixed assumptions.High-Level Changes
Code
klippy/extras/display/fonts/(using the strategy pattern to load different font file formats and use adequate swizzle algorithms).klippy/extras/display/display.pyto:[display_font <name>]sectionsfont:in[display]klippy/extras/display/uc1701.pyto:height(32/64) in init/config logic.vscode/to.gitignoreto allow cuatomized vscode local dev setups.Docs
config/sample-display-font.cfgexample.docs/Config_Reference.mdwith:[display_font]section[display] fontoptionheightoption detailsdocs/FAQ.mdwith custom-font troubleshooting.docs/Config_Changes.md.Tests