On Wed, Jul 19, 2006 at 09:46:44AM +0100, Simon Kelley wrote:
> OK, you're in a better position than me, since I don't have access to a 
> V1 Squeezebox. The small fonts are deliberate: the rest of those fonts 
> are not distributable by Debian for copyright reasons. The original 
> slimserver code uses the bitmap fonts for glyphs < 256 and then switches 
> to a TrueType font for the rest. The Debian modification removes glyphs 
> > 32 from the bitmap font, and switches to the TrueType font for 
> anything above 32, rather than 256.
> 
> Given the symptoms, I suspect that something is going wrong with the TT 
> font handling stuff.

I figured it out eventually.

a) The v1 fonts are named differently to the v2 fonts.
b) The v1 display is only 16 pixels high as compared to 32

The following patch brings the v1 slimserver back to life.  I suspect
that for chars > 256 the original code is broken too, so maybe this
patch should go upstream?

The small fonts in particular aren't as good as the hand made ones
Debian can't distribute though - rendering an 8x8 non-antialiased font
is very hard.

Would it be possible for the package to download these fonts in a
similar way to the firmware?

Cheers

Nick

--- /usr/share/perl5/SlimServer/Slim/Display/Graphics.pm.orig   2006-07-09 
20:52:21.000000000 +0100
+++ /usr/share/perl5/SlimServer/Slim/Display/Graphics.pm        2006-07-20 
22:22:42.000000000 +0100
@@ -42,34 +42,80 @@
        'standard.1' => {
                'GDFontSize' => 8,
                'GDBaseline' => 9,
+               'GDHeight' => 32,
        },
 
        'standard.2' => {
                'GDFontSize' => 12,
                'GDBaseline' => 27,
+               'GDHeight' => 32,
        },
 
        # Small size - .1 is top line, .2 is bottom.
        'light.1' => {
                'GDFontSize' => 8,
                'GDBaseline' => 9,
+               'GDHeight' => 32,
        },
 
        'light.2' => {
                'GDFontSize' => 10,
                'GDBaseline' => 28,
+               'GDHeight' => 32,
        },
 
        # Huge - only one line.
        'full.2' => {
                'GDFontSize' => 22,
                'GDBaseline' => 25,
+               'GDHeight' => 32,
        },
 
        # Not sure what high.2 is for..
        'high.2' => {
                'GDFontSize' => 7,
                'GDBaseline' => 7,
+               'GDHeight' => 32,
+       },
+
+       # v1: Small size - .1 is top line, .2 is bottom.
+       'small.1' => {
+               'GDFontSize' => 5,
+               'GDBaseline' => 7,
+               'GDHeight' => 16,
+       },
+
+       'small.2' => {
+               'GDFontSize' => 6,
+               'GDBaseline' => 14,
+               'GDHeight' => 16,
+       },
+
+       # v1: Medium size - .1 is top line, .2 is bottom.
+       'medium.1' => {
+               'GDFontSize' => 6,
+               'GDBaseline' => 6,
+               'GDHeight' => 16,
+       },
+
+       'medium.2' => {
+               'GDFontSize' => 7,
+               'GDBaseline' => 14,
+               'GDHeight' => 16,
+       },
+
+       # v1: Large - only one line.
+       'large.2' => {
+               'GDFontSize' => 10,
+               'GDBaseline' => 13,
+               'GDHeight' => 16,
+       },
+
+       # v1: Huge - only one line.
+       'huge.2' => {
+               'GDFontSize' => 13,
+               'GDBaseline' => 13,
+               'GDHeight' => 16,
        },
 );
 
@@ -183,7 +229,7 @@
        # 'sazanami-gothic' from 'waka'.
        #
        # They seem to work pretty well for CODE2000 & Cyberbit as well. - 
dsully
-       my ($GDFontSize, $GDBaseline);
+       my ($GDFontSize, $GDBaseline, $GDHeight);
        my $useTTFNow = 0;
 
        if ($useTTF && defined $font2TTF{$fontname}) {
@@ -191,6 +237,7 @@
                $useTTFNow  = 1;
                $GDFontSize = $font2TTF{$fontname}->{'GDFontSize'};
                $GDBaseline = $font2TTF{$fontname}->{'GDBaseline'};
+               $GDHeight = $font2TTF{$fontname}->{'GDHeight'};
        }
 
        for my $ord (unpack($unpackTemplate, $string)) {
@@ -231,7 +278,7 @@
                                        # Construct the bitmap
                                        for (my $x = 0; $x <= $GDBounds[2]; 
$x++) {
 
-                                               for (my $y = 0; $y < 32; $y++) {
+                                               for (my $y = 0; $y < $GDHeight; 
$y++) {
 
                                                        $bits_tmp .= 
$gd->getPixel($x,$y) == $GDBlack ? 1 : 0
                                                }

-- 
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to