Bitbucket discussion here:
https://bitbucket.org/hudson/magic-lantern/pull-request/222/added-rbf-font-support/diffSource code here:
https://bitbucket.org/g3gg0/magic-lantern-rbfIf you don't see major issues (like significant slowdown, much higher memory usage, completely unreadable fonts on some displays, or everybody likes the old fonts), I'd say it can be merged (and g3gg0 said the same).
History:
[aug26] stevefal suggests (once again) to use proportional fonts.
[sep03] g3gg0 ported RBF font format from CHDK.
[sep07] proportional fonts are already usable (of course, ther's still a bunch of things to fine-tune)
Screenshots (may change, since stevefal is still fine-tuning the fonts)
New printing API:Centered text (example from spotmeter):
bmp_printf(
fnt | FONT_ALIGN_CENTER,
xcb, ycb,
"#%02x%02x%02x",
R,G,B
);
Right-aligned text, clipped if it exceeds some maximum width (example from module name in Modules tab):
int fg = COLOR_GRAY(40);
int bg = COLOR_BLACK;
int fnt = SHADOW_FONT(FONT(FONT_MED, fg, bg));
bmp_printf(fnt | FONT_ALIGN_RIGHT | FONT_TEXT_WIDTH(300), 690, info->y+5, name);
Justified text with manual line breaking (example from module README):
big_bmp_printf(FONT_MED | FONT_ALIGN_JUSTIFIED | FONT_TEXT_WIDTH(690), 10, 60, "%s", desc);
Special characters (ISO, small 1/ or f/, degree symbol)
bmp_printf( font, x, y,"T=%d"SYM_DEGREE"C", EFIC_CELSIUS);
-bmp_printf(..., "ISO %d 1/%d f/%d.%d %dK", iso, shutter, aperture, kelvin)
+bmp_printf(..., SYM_ISO"%d "SYM_1_SLASH"%d "SYM_F_SLASH"%d.%d %dK", iso, shutter, aperture, kelvin
#define SYM_DOTS "\x7F"
#define SYM_ISO "\x80"
#define SYM_F_SLASH "\x81"
#define SYM_1_SLASH "\x82"
#define SYM_DEGREE "\x83"
#define SYM_MICRO "\x84" /* maybe not needed */
#define SYM_PLUSMINUS "\x85"
#define SYM_LV "\x86"
#define SYM_BULLET "\x87"
#define SYM_EM_DASH "\x88"
Expanded/condensed text (not yet implemented):
FONT_EXPAND(x) /* range: -4 ... +3 pixels per character */