r3183 - in /packages/libfont-ttf-perl/branches/upstream/current:
MANIFEST
MANIFEST.SKIP META.yml Makefile.PL README.TXT lib/Font/TTF.pm
lib/Font/TTF/Changes lib/Font/TTF/Font.pm lib/Font/TTF/OS_2.pm
lib/Font/TTF/Table.pm lib/Font/TTF/Ttopen.pm
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Wed Jun 28 11:58:29 UTC 2006
Author: eloy
Date: Wed Jun 28 11:58:28 2006
New Revision: 3183
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3183
Log:
Load /tmp/tmp.BQAym15262/libfont-ttf-perl-0.39a into
packages/libfont-ttf-perl/branches/upstream/current.
Added:
packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF.pm
Removed:
packages/libfont-ttf-perl/branches/upstream/current/Makefile.PL
Modified:
packages/libfont-ttf-perl/branches/upstream/current/MANIFEST
packages/libfont-ttf-perl/branches/upstream/current/MANIFEST.SKIP
packages/libfont-ttf-perl/branches/upstream/current/META.yml
packages/libfont-ttf-perl/branches/upstream/current/README.TXT (props changed)
packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Changes (props changed)
packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Font.pm
packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/OS_2.pm
packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Table.pm
packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Ttopen.pm
Modified: packages/libfont-ttf-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/MANIFEST?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/MANIFEST (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/MANIFEST Wed Jun 28 11:58:28 2006
@@ -1,4 +1,5 @@
COPYING
+lib/Font/TTF.pm
lib/Font/TTF/AATKern.pm
lib/Font/TTF/AATutils.pm
lib/Font/TTF/Anchor.pm
@@ -60,7 +61,6 @@
lib/Font/TTF/Win32.pm
lib/Font/TTF/XMLparse.pm
lib/ttfmod.pl
-Makefile.PL
MANIFEST This list of files
MANIFEST.SKIP
META.yml
Modified: packages/libfont-ttf-perl/branches/upstream/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/MANIFEST.SKIP?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/MANIFEST.SKIP (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/MANIFEST.SKIP Wed Jun 28 11:58:28 2006
@@ -10,5 +10,10 @@
\.cvsignore
^#
\.svn/
-^Makefile$
-~$
+Makefile
+\.par$
+-stamp$
+debian/
+pm_to_blib
+\~$
+dev/
Modified: packages/libfont-ttf-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/META.yml?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/META.yml (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/META.yml Wed Jun 28 11:58:28 2006
@@ -1,8 +1,8 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Font-TTF
-version: 0.38
-version_from:
+version: 0.39
+version_from: lib/Font/TTF.pm
installdirs: site
requires:
Propchange: packages/libfont-ttf-perl/branches/upstream/current/README.TXT
------------------------------------------------------------------------------
svn:executable = *
Added: packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF.pm?rev=3183&op=file
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF.pm (added)
+++ packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF.pm Wed Jun 28 11:58:28 2006
@@ -1,0 +1,15 @@
+package Font::TTF;
+
+$VERSION = 0.39;
+
+1;
+
+=head1 NAME
+
+Font::TTF - Perl module for TrueType Font hacking
+
+=head1 DESCRIPTION
+
+This module allows you to do almost anything to a TrueType/OpenType Font
+including modify and inspect nearly all tables.
+
Propchange: packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Changes
------------------------------------------------------------------------------
svn:executable = *
Modified: packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Font.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Font.pm?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Font.pm (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Font.pm Wed Jun 28 11:58:28 2006
@@ -615,21 +615,23 @@
sub dirty
{ $_[0]->tables_do(sub { $_[0]->dirty; }); $_[0]; }
-=head2 $f->tables_do(&func)
+=head2 $f->tables_do(&func [, tables])
Calls &func for each table in the font. Calls the table in alphabetical sort
order as per the order in the directory:
&func($table, $name);
+May optionally take a list of table names in which case func is called
+for each of them in the given order.
=cut
sub tables_do
{
- my ($self, $func) = @_;
+ my ($self, $func, @tables) = @_;
my ($t);
- foreach $t (sort grep {length($_) == 4} keys %$self)
+ foreach $t (@tables ? @tables : sort grep {length($_) == 4} keys %$self)
{ &$func($self->{$t}, $t); }
$self;
}
Modified: packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/OS_2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/OS_2.pm?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/OS_2.pm (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/OS_2.pm Wed Jun 28 11:58:28 2006
@@ -60,7 +60,7 @@
breakChar
maxLookups
-Notice that versions 0, 1 & 2 of the table are supported. Notice also that the
+Notice that versions 0, 1, 2 & 3 of the table are supported. Notice also that the
Panose variable has been broken down into its elements.
=head1 METHODS
@@ -119,7 +119,9 @@
'CapHeight' => 's',
'defaultChar' => 'S',
'breakChar' => 'S',
- 'maxLookups' => 's');
+ 'maxLookups' => 's',
+ '' => '', # i.e. v3 is basically same as v2
+ );
@weights = qw(64 14 27 35 100 20 14 42 63 3 6 35 20 56 56 17 4 49 56 71 31 10 18 3 18 2 166);
@@ -130,7 +132,7 @@
my ($k, $v, $c, $n, $i, $t, $j);
$n = 0;
- @lens = (76, 84, 94);
+ @lens = (76, 84, 94, 94);
for ($j = 0; $j < $#field_info; $j += 2)
{
if ($field_info[$j] eq '')
@@ -140,7 +142,7 @@
}
($k, $v, $c) = TTF_Init_Fields($field_info[$j], $c, $field_info[$j+1]);
next unless defined $k && $k ne "";
- for ($i = $n; $i < 3; $i++)
+ for ($i = $n; $i < 4; $i++)
{ $fields[$i]{$k} = $v; }
}
}
@@ -163,7 +165,7 @@
$self->{' INFILE'}->read($dat, 2);
$ver = unpack("n", $dat);
$self->{'Version'} = $ver;
- if ($ver < 3)
+ if ($ver < 4)
{
$self->{' INFILE'}->read($dat, $lens[$ver]);
TTF_Read_Fields($self, $dat, $fields[$ver]);
@@ -293,10 +295,25 @@
$self->{'sTypoLineGap'} = $table->{'LineGap'} = 0;
}
- for ($i = 0; $i < 26; $i++)
- { $avg += $hmtx->{'advance'}[$map->{'val'}{$i + 0x0061}] * $weights[$i]; }
- $avg += $hmtx->{'advance'}[$map->{'val'}{0x0020}] * $weights[-1];
- $self->{'xAvgCharWidth'} = $avg / 1000;
+ if ($self->{'Version'} < 3)
+ {
+ for ($i = 0; $i < 26; $i++)
+ { $avg += $hmtx->{'advance'}[$map->{'val'}{$i + 0x0061}] * $weights[$i]; }
+ $avg += $hmtx->{'advance'}[$map->{'val'}{0x0020}] * $weights[-1];
+ $self->{'xAvgCharWidth'} = $avg / 1000;
+ }
+ elsif ($self->{'Version'} > 2)
+ {
+ $i = 0; $avg = 0;
+ foreach (@{$hmtx->{'advance'}})
+ {
+ next unless ($_);
+ $i++;
+ $avg += $_;
+ }
+ $avg /= $i if ($i);
+ $self->{'xAvgCharWidth'} = $avg;
+ }
foreach $i (keys %{$map->{'val'}})
{
Modified: packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Table.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Table.pm?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Table.pm (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Table.pm Wed Jun 28 11:58:28 2006
@@ -317,7 +317,7 @@
Releases ALL of the memory used by this table, and all of its component/child
objects. This method is called automatically by
-'C<Font::TTF::Font-E<GT>release>' (so you don't have to call it yourself).
+'C<Font::TTF::Font-E<gt>release>' (so you don't have to call it yourself).
B<NOTE>, that it is important that this method get called at some point prior
to the actual destruction of the object. Internally, we track things in a
Modified: packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Ttopen.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Ttopen.pm?rev=3183&op=diff
==============================================================================
--- packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Ttopen.pm (original)
+++ packages/libfont-ttf-perl/branches/upstream/current/lib/Font/TTF/Ttopen.pm Wed Jun 28 11:58:28 2006
@@ -1041,13 +1041,13 @@
$r = $lookup->{'RULES'}[0][0];
$out .= pack('n2', $fmt, scalar @{$r->{'PRE'}});
foreach $t (@{$r->{'PRE'}})
- { $out .= Font::TTF::Ttopen::ref_cache($t, $ctables, length($out)); }
+ { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out))); }
$out .= pack('n', scalar @{$r->{'MATCH'}});
foreach $t (@{$r->{'MATCH'}})
- { $out .= Font::TTF::Ttopen::ref_cache($t, $ctables, length($out)); }
+ { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out))); }
$out .= pack('n', scalar @{$r->{'POST'}});
foreach $t (@{$r->{'POST'}})
- { $out .= Font::TTF::Ttopen::ref_cache($t, $ctables, length($out)); }
+ { $out .= pack('n', Font::TTF::Ttopen::ref_cache($t, $ctables, length($out))); }
$out .= pack('n', scalar @{$r->{'ACTION'}});
foreach $t (@{$r->{'ACTION'}})
{ $out .= pack('n2', @$t); }
More information about the Pkg-perl-cvs-commits
mailing list