1
0
Fork 0
forked from len0rd/rockbox

Use a different remote font than the main LCD font

Works for both wps config and settings
Only change targets with LCD_REMOTE_HEIGHT <= 64 (irivers) to use
08-Rockfont

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26505 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-06-03 07:30:01 +00:00
parent 8be2a90d78
commit 1dc7f490c9
3 changed files with 33 additions and 4 deletions

View file

@ -223,6 +223,14 @@ static const char graphic_numeric[] = "graphic,numeric";
#define DEFAULT_FONTNAME "" #define DEFAULT_FONTNAME ""
#endif #endif
#ifdef HAVE_REMOTE_LCD
#if LCD_REMOTE_HEIGHT <= 64
#define DEFAULT_REMOTE_FONTNAME "08-Rockfont"
#else
#define DEFAULT_REMOTE_FONTNAME "-"
#endif
#endif /* HAVE_REMOTE_LCD */
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
#define DEFAULT_ICONSET "tango_small" #define DEFAULT_ICONSET "tango_small"
#define DEFAULT_VIEWERS_ICONSET "tango_small_viewers" #define DEFAULT_VIEWERS_ICONSET "tango_small_viewers"
@ -1564,7 +1572,7 @@ const struct settings_list settings[] = {
#endif #endif
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
TEXT_SETTING(F_THEMESETTING, remote_font_file, "remote font", TEXT_SETTING(F_THEMESETTING, remote_font_file, "remote font",
"-", FONT_DIR "/", ".fnt"), DEFAULT_REMOTE_FONTNAME, FONT_DIR "/", ".fnt"),
#endif #endif
TEXT_SETTING(F_THEMESETTING,wps_file, "wps", TEXT_SETTING(F_THEMESETTING,wps_file, "wps",
DEFAULT_WPSNAME, WPS_DIR "/", ".wps"), DEFAULT_WPSNAME, WPS_DIR "/", ".wps"),

View file

@ -308,6 +308,9 @@ Font.132x80x16: 11-Sazanami-Mincho.fnt
Font.128x64x1: 08-Rockfont.fnt Font.128x64x1: 08-Rockfont.fnt
Font.112x64x1: 08-Rockfont.fnt Font.112x64x1: 08-Rockfont.fnt
# Remote font for iriver
Remote Font.128x64x1: 08-Rockfont.fnt
#misc settings that should be ignored on grayscale targets #misc settings that should be ignored on grayscale targets
foreground color: CCCCCC foreground color: CCCCCC
background color: 000000 background color: 000000

View file

@ -47,6 +47,7 @@ my $rsbs_w_size;
my $width; my $width;
my $height; my $height;
my $font; my $font;
my $remotefont;
my $fgcolor; my $fgcolor;
my $bgcolor; my $bgcolor;
my $statusbar; my $statusbar;
@ -160,11 +161,11 @@ sub copybackdrop
sub copythemefont sub copythemefont
{ {
#copy the font specified by the theme #copy the font specified by the theme
my $o = $_[0];
my $o=$font;
$o =~ s/\.fnt/\.bdf/; $o =~ s/\.fnt/\.bdf/;
mkdir "$rbdir/fonts"; mkdir "$rbdir/fonts";
my $cmd ="$ROOT/tools/convbdf -f -o \"$rbdir/fonts/$font\" \"$ROOT/fonts/$o\" "; my $cmd ="$ROOT/tools/convbdf -f -o \"$rbdir/fonts/$_[0]\" \"$ROOT/fonts/$o\" ";
`$cmd`; `$cmd`;
} }
@ -288,6 +289,13 @@ MOO
push @out, "font: /$rbdir/fonts/$font\n"; push @out, "font: /$rbdir/fonts/$font\n";
} }
} }
if(defined($remotefont) && $has_remote) {
if ($remotefont eq '') {
push @out, "remote font: -\n";
} else {
push @out, "remote font: /$rbdir/fonts/$remotefont\n";
}
}
if($fgcolor && $main_depth > 2) { if($fgcolor && $main_depth > 2) {
push @out, "foreground color: $fgcolor\n"; push @out, "foreground color: $fgcolor\n";
} }
@ -405,6 +413,7 @@ while(<WPS>) {
undef $width; undef $width;
undef $height; undef $height;
undef $font; undef $font;
undef $remotefont;
undef $fgcolor; undef $fgcolor;
undef $bgcolor; undef $bgcolor;
undef $statusbar; undef $statusbar;
@ -492,7 +501,10 @@ while(<WPS>) {
copythemeviewericon(); copythemeviewericon();
} }
if ($font) { if ($font) {
copythemefont(); copythemefont($font);
}
if ($remotefont) {
copythemefont($remotefont);
} }
if(!$isrwps) { if(!$isrwps) {
# We only make .cfg files for <wps> sections: # We only make .cfg files for <wps> sections:
@ -554,6 +566,12 @@ while(<WPS>) {
elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: *(.*)/i) { elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$font = $1; $font = $1;
} }
elsif($l =~ /^Remote Font\.${remote_width}x${remote_height}x$remote_depth: *(.*)/i) {
$remotefont = $1;
}
elsif($l =~ /^Remote Font: *(.*)/i) {
$remotefont = $1;
}
elsif($l =~ /^Foreground Color: *(.*)/i) { elsif($l =~ /^Foreground Color: *(.*)/i) {
$fgcolor = $1; $fgcolor = $1;
} }