Skip to content

added RBF font support

Bitbucket Importer requested to merge bitbucket/merged-pr-222 into branch/unified

Created originally on Bitbucket by g3gg0 (Georg Hofstetter)

Was already merged in Bitbucket before import, marked as merged by the import user

Source changeset not longer availableat the time of import. Commit listwill look empty

with this code you can use RBF fonts (see http://chdk.wikia.com/wiki/RBF_fonts) along with normal fonts. this is primarily for testing the fonts without touching menus. there is also a hack in debug.c and bmp.c to remap all fonts to a previously loaded rbf font.

RBF is a small bitmap based font format used in some kind of ebooks. this code was copied from CHDK and ported/optimized to run in Magic Lantern.

to print text with any .rbf font you want it to use, just use

#!c
    bmp_printf(font_by_name("ml_40",COLOR_WHITE, COLOR_BLACK), 10, 300, "RBF Test");

this code will either load the file ML/FONTS/ml_40.rbf or uses the cached font if it was already loaded before. loading will take some miliseconds, once they are loaded it is much faster.

here some example fonts: http://upload.g3gg0.de/pub_files/9e61ce82bc45ae85bdfe662df929e54e/FONTS.zip

Merge request reports

Loading