From 3613c550fa9a48934515b6a71e2e96fecc3c6d7e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Apr 2016 14:35:26 -0700 Subject: [PATCH] Rename README file for fonts --- Marlin/fonts/README.fonts | 23 ----------------------- Marlin/fonts/README.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 23 deletions(-) delete mode 100644 Marlin/fonts/README.fonts create mode 100644 Marlin/fonts/README.md diff --git a/Marlin/fonts/README.fonts b/Marlin/fonts/README.fonts deleted file mode 100644 index 7ae6e4242..000000000 --- a/Marlin/fonts/README.fonts +++ /dev/null @@ -1,23 +0,0 @@ -The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience). -In Fony export the fonts to bdf-format. Maybe another one can edit them with Fontforge. -Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to produce the .h files. -The .h files must be edited to replace '#include "u8g.h"' with '#include ', replace 'U8G_FONT_SECTION' with 'U8G_SECTION', insert '.progmem.' right behind the first '"' and moved to the main directory. - -How to integrate a new font: -Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixel for a line. To have some space in between the lines we can't use more than 10 pixel height for the symbols. For up to 11 pixel set TALL_FONT_CORRECTION 1 when loading the font. -To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols. -For the second half of the font we now support up to 11x11 pixel. - - * Get 'Fony.exe' - * Copy one of the existing *.fon files and work with this. - * Change the pixels. Don't change width or height. - * Export as *.bdf - * Use 'bdf2u8g.exe' to produce the *.h file. Examples for the existing fonts are in 'make_fonts.bat' - * Edit the produced .h file to match our needs. See hints in 'README.fonts' or the other 'dogm_font_data_.h' files. - * Make a new entry in the font list in 'dogm_lcd_implementation.h' before the '#else // fall back' - #elif ENABLED(DISPLAY_CHARSET_NEWNAME) - #include "dogm_font_data_yourfont.h" - #define FONT_MENU_NAME YOURFONTNAME - #else // fall-back - * Add your font to the list of permitted fonts in 'language_en.h' - ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) diff --git a/Marlin/fonts/README.md b/Marlin/fonts/README.md new file mode 100644 index 000000000..86e54929b --- /dev/null +++ b/Marlin/fonts/README.md @@ -0,0 +1,30 @@ +The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience). + +In Fony export the fonts to bdf-format. (Maybe another one can edit them with Fontforge.) Then run `make_fonts.bat` which calls `bdf2u8g.exe` with the parameters needed to produce the `.h` files. The `.h` files must be edited and moved: +- Replace `#include "u8g.h"` with `#include `, +- Replace `U8G_FONT_SECTION` with `U8G_SECTION`, +- Insert `.progmem.` right after the first quote `"`, +- Move the file to the main directory. + +How to integrate a new font: +Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixels per line. So to have any space between the lines we can use no more than 10 pixel height for the symbols. For up to 11 pixels set TALL_FONT_CORRECTION 1 when loading the font. +To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols. +For the second half of the font we now support up to 11x11 pixel. + +- Get `Fony.exe` from [hukka.ncn.fi](http://hukka.ncn.fi/?fony) +- Copy one of the existing `*.fon` files and use the copy for your work. +- Only change the pixels. Don't change width or height. +- Export as a `*.bdf` file +- Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`. +- Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files. +- Make a new entry in the font list in `dogm_lcd_implementation.h` before the `#else // fall-back` line: +```cpp + #elif ENABLED(DISPLAY_CHARSET_NEWNAME) + #include "dogm_font_data_yourfont.h" + #define FONT_MENU_NAME YOURFONTNAME + #else // fall-back +``` +- Add your font to the list of permitted fonts in 'language_en.h' +```cpp + ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... ) +``` \ No newline at end of file