I have just made a QA upload for this package fixing this bug; please
see the attached diff; serious thanks to "K.-M. Hansche"
<debian...@hansche.de> for doing most of the grunt work on this,
though I modified his patch a bit.


Don Armstrong

-- 
[T]he question of whether Machines Can Think, [...] is about as
relevant as the question of whether Submarines Can Swim.
 -- Edsger W. Dijkstra "The threats to computing science"

http://www.donarmstrong.com              http://rzlab.ucr.edu
diff -Nru defoma-0.11.10/debian/changelog defoma-0.11.10/debian/changelog
--- defoma-0.11.10/debian/changelog	2008-02-01 14:19:15.000000000 -0800
+++ defoma-0.11.10/debian/changelog	2009-08-18 16:16:20.000000000 -0700
@@ -1,3 +1,10 @@
+defoma (0.11.10-1) unstable; urgency=low
+
+  * QA upload.
+  * Fix dependency on libftp-perl (Closes: #514635, #285653)
+
+ -- Don Armstrong <d...@debian.org>  Tue, 18 Aug 2009 16:15:28 -0700
+
 defoma (0.11.10-0.2) unstable; urgency=high
 
   * Non-maintainer upload.
diff -Nru defoma-0.11.10/debian/control defoma-0.11.10/debian/control
--- defoma-0.11.10/debian/control	2008-02-01 14:14:37.000000000 -0800
+++ defoma-0.11.10/debian/control	2009-08-18 16:17:54.000000000 -0700
@@ -1,7 +1,7 @@
 Source: defoma
 Section: admin
 Priority: optional
-Maintainer: Angus Lees <g...@debian.org>
+Maintainer: Debian QA Group <packa...@qa.debian.org>
 Build-Depends-Indep: debiandoc-sgml
 Build-Depends: debhelper (>= 4)
 Standards-Version: 3.6.2.0
@@ -11,7 +11,7 @@
 Depends: whiptail | dialog, file, ${perl:Depends}
 Enhances: debhelper
 Suggests: defoma-doc, psfontmgr, x-ttcidfont-conf, dfontmgr
-Recommends: libft-perl
+Recommends: libfont-freetype-perl
 Conflicts: defoma-x, defoma-ps, defoma-gs, psfontmgr (<< 0.5.0), x-ttcidfont-conf (<< 5), dfontmgr (<< 0.10.0)
 Description: Debian Font Manager -- automatic font configuration framework
  Defoma, which stands for DEbian FOnt MAnager, provides a framework
diff -Nru defoma-0.11.10/libs/libhint-truetype.pl defoma-0.11.10/libs/libhint-truetype.pl
--- defoma-0.11.10/libs/libhint-truetype.pl	2006-06-17 08:54:22.000000000 -0700
+++ defoma-0.11.10/libs/libhint-truetype.pl	2009-08-18 16:33:27.000000000 -0700
@@ -3,8 +3,8 @@
 my %ID_Region;
 
 BEGIN {
-    eval ("use FreeType");
-    exitfunc(255, "libft-perl is needed.") if ($@ ne '');
+    eval ("use Font::FreeType");
+    exitfunc(255, "libfont-freetype-perl is needed.") if ($@ ne '');
 
     @ENCODING = qw(Symbol Unicode ShiftJIS GB2312 BIG5 WanSung Johab);
 
@@ -54,34 +54,18 @@
     return '';
 }
 
-my $Engine;
-my $Face;
-my $Prop;
-
 sub freetype_init {
     my $fontpath = shift;
     my $facenum;
 
-    undef $Engine;
-    undef $Face;
-    undef $Prop;
-    
-  FreeType::TT_Init_FreeType($Engine);
-  FreeType::TT_Open_Face($Engine, $fontpath, $Face);
-  FreeType::TT_Get_Face_Properties($Face, $Prop);
+    my $Face=Font::FreeType->new->face($fontpath);
+    $facenum=$Face->number_of_faces;
 
-    $facenum = $Prop->{num_Faces};
     $facenum = 1 if ($facenum == 0);
 
-  FreeType::TT_Close_Face($Face);
-
     return $facenum;
 }
 
-sub freetype_term {
-  FreeType::TT_Done_FreeType($Engine);
-}
-
 sub sethint_truetype {
     my $font = shift;
     my $fontfile = $font;
@@ -108,54 +92,17 @@
     for (my $j = 0; $j < $facenum; $j++) {
 	my $fname = ($facenum > 1) ? "$fontfile,face\#$j" : "$fontfile";
 	my $cnt;
-	
-      FreeType::TT_Open_Collection($Engine, $font, $j, $Face);
-	$cnt = FreeType::TT_Get_Name_Count($Face);
+
+	my $Face=Font::FreeType->new->face($font, index => $j);
+	$cnt = 1; #One name
 
 	my %langs = ();
-	my @family_list = ();
-	my @subfamily_list = ();
-	my @psfontname_list = ();
+	my @family_list = $Face->family_name;
+	my @subfamily_list = $Face->style_name;
+	my @psfontname_list = $Face->postscript_name;
 	my @encoding_list = ();
 	my @foundry_list = ();
 
-	for (my $i = 0; $i < $cnt; $i++) {
-	    my $plat;
-	    my $enc;
-	    my $lang;
-	    my $name;
-	    my $str;
-
-	  FreeType::TT_Get_Name_ID($Face, $i, $plat, $enc, $lang, $name);
-	  FreeType::TT_Get_Name_String($Face, $i, $str);
-
-	    my $pattern;
-	    $str =~ s/\0//g;
-	    $str =~ s/[^a-zA-Z0-9_-]/./g;
-
-	    if ($name == 1) {
-		push(@family_list, $str) unless (grep($_ eq $str,
-						      @family_list));
-	    } elsif ($name == 2) {
-		push(@subfamily_list, $str) unless (grep($_ eq $str,
-							 @subfamily_list));
-	    } elsif ($name == 6) {
-		push(@psfontname_list, $str) unless (grep($_ eq $str,
-							  @psfontname_list));
-	    } elsif ($name == 8) {
-		$str =~ s/\..*//;
-		push(@foundry_list, $str) unless (grep($_ eq $str,
-						       @foundry_list));
-	    }
-
-	    if ($plat == 3) {
-		push(@encoding_list, $ENCODING[$enc])
-		    unless (grep($_ eq $ENCODING[$enc], @encoding_list));
-
-		$langs{"$lang"} = 1;
-	    }
-	}
-
 	$text = <<EOF
 Choose the Family of $fname.
 * Family of the font is similar to a family name of a person. A font
@@ -170,7 +117,7 @@
 	my $subfamily = '';
 	my $psfontname;
 
-	foreach $i (@psfontname_list) {
+	foreach my $i (@psfontname_list) {
 	    $psfontname = $i;
 	    $psfontname =~ s/-.*//;
 
@@ -254,7 +201,7 @@
 	my %location = ();
 	my $loc = '';
 
-	foreach $i (keys(%langs)) {
+	foreach my $i (keys(%langs)) {
 	    my $lang_id = $i & 0xff;
 	    my $region_id = ($i & 0xff00) >> 11;
 	    
@@ -337,8 +284,7 @@
 	$weight = input_weight($fname, $weight);
 	return if ($result != 0);
 
-	my $width = input_width($fname, 'Variable');
-	return if ($result != 0);
+	my $width = ($Face->is_fixed_width) ? 'Fixed' : 'Variable';
 
 	my $shape = $slant;
 	$shape .= " $subfamily" if ($subfamily ne '');
@@ -368,7 +314,6 @@
 	$hints .= " --Priority$m $priority";
     }
     
-    freetype_term();
 
     return $hints;
 }

Reply via email to