Codebase list libfont-ttf-perl / e207c9c
New upstream version 1.06 Lucas Kanashiro 7 years ago
86 changed file(s) with 302 addition(s) and 232 deletion(s). Raw diff Collapse all Expand all
0 1.05 (r1069, 2015-01-26)
0 1.06 2016-08-17
1
2 * Source repo moved from Subversion to Github
3 * OpenType script and lang tags updated from ISO/IEC 14496-22:2015, draft amendment 2
4 * Various POD improvements
5 * Add deepcopy mode to Dumper::ttfdump()
6 * Bug fixes
7 * Wasn't installing on Windows Perl 5.22 and up
8 * Reading mark-to-ligature lookups would crash if anchors were omitted
9 * Incorrect extension lookup structure
10 * Multiple fixes in Silf table processing
11 * rt.cpan.org #106562 Uninitialized value warnings
12 * rt.cpan.org #106816 spelling errors in manpage
13
14 1.05 2015-01-26 r1069
115
216 * Add support for GSUB Type 8 Reverse-chaining substitution
317 * OpenType script/lang/feature tags now based on ISO/IEC 14496-22
4 * Remove deprecated GDL_old.pm
18 * Remove deprecated GDL_old.pm
519 *
620 * Bug fixes:
721 * Fix rt.cpan.org 92150, 93597
1024 * Fix various issues reading WOFF-compressed font tables
1125 * Fix reading DSIG
1226
13 1.04 (r994, 2014-01-09)
27 1.04 2014-01-09 r994
1428
1529 * Bug fixes:
1630 * Fix rt.cpan.org 80671, 80672; simplify fix for #42553 per OP
1832 * Quiet a cleanup warning in TTC processing
1933 * Update licensing info for test fonts to OFL
2034
21 1.03 (r969, 2013-11-10)
35 1.03 2013-11-10 r969
2236
2337 * Add $t->minsize() to all tables for assisting with font subsetting
2438 * Add deduping to Name table writing
2741 * Expunge notion of 'dflt' language tag from Ttopen.pm
2842 * Bug fixes
2943
30 1.02 (r862, 2012-08-30)
44 1.02 2012-08-30 r862
3145
3246 * Fix typo in Useall to get case right
3347
34 1.01 (r859, 2012-08-30)
48 1.01 2012-08-30 r859
3549
3650 * Add IO::String prerequisite to make BSD and other testing environments happy
3751
38 1.00 (r857, 2012-08-28)
52 1.00 2012-08-28 r857
3953
4054 * Major change to glyph creation/editing -- now utilizes ' isDirty' flag
4155 * Add support for:
4963 * Copyright and licensing updated to CPAN requirements
5064 * Bug fixes
5165
52 0.48 (r692, 2010-12-14)
66 0.48 2010-12-14 r692
5367
5468 * Ensure coverage tables are properly sorted
5569 * Additional OT tags (from OpenType 1.6)
5670 * Bug fixes
5771
58 0.47 (r649, 2009-08-10)
72 0.47 2009-08-10 r649
5973
6074 * Add support for Graphite Sill table
6175 * Handle kerning tables version > 0
6276 * Bug fixes
6377
64 0.46 (r577, 2009-01-26)
78 0.46 2009-01-26 r577
6579
6680 * Bug fixes
6781 * Change Copyright to Artistic License 2.0
6882
69 0.45 (r527, 2008-06-11)
83 0.45 2008-06-11 r527
7084
7185 * Introduce changelog
7286 * tidy up 0.44 package, fix README to be more accurate
8484 MANIFEST This list of files
8585 MANIFEST.SKIP
8686 README.TXT
87 t/changes.t
8788 t/OFL.txt
8889 t/tags.t
8990 t/testfont.ttf
1212 exes/
1313 \.cvsignore
1414 ^#
15 (^|/)\.git
1516 \.svn/
1617 Makefile$
1718 \.par$
1818 "inc"
1919 ]
2020 },
21 "prereqs" : {
22 "build" : {
23 "requires" : {
24 "ExtUtils::MakeMaker" : "0"
25 }
26 },
27 "configure" : {
28 "requires" : {
29 "ExtUtils::MakeMaker" : "0"
30 }
31 },
32 "runtime" : {
33 "requires" : {
34 "IO::String" : "0"
35 }
21 "release_status" : "stable",
22 "resources" : {
23 "repository" : {
24 "type" : "git",
25 "url" : "https://github.com/silnrsi/font-ttf.git",
26 "web" : "https://github.com/silnrsi/font-ttf"
3627 }
3728 },
38 "release_status" : "stable",
39 "version" : "1.05"
29 "version" : "1.06"
4030 }
11 abstract: 'TTF font support for Perl'
22 author:
33 - martin_hosken@sil.org
4 build_requires:
5 ExtUtils::MakeMaker: 0
6 configure_requires:
7 ExtUtils::MakeMaker: 0
4 build_requires: {}
85 dynamic_config: 1
96 generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921'
107 license: artistic_2
1613 directory:
1714 - t
1815 - inc
19 requires:
20 IO::String: 0
21 version: 1.05
16 resources:
17 repository: https://github.com/silnrsi/font-ttf.git
18 version: 1.06
55 getopts('d:rv:');
66
77 my %pbuilderopts = (
8 'gutsy' => '--bindmounts /media/hosk_1'
9 );
8 'gutsy' => '--bindmounts /media/hosk_1'
9 );
1010
1111 $opt_v ||= 1;
1212
2323 # incantation to enable MY::pm_to_blib later on
2424 if ($^O eq 'MSWin32')
2525 {
26 push(@ExtUtils::MakeMaker::Overridable, qw(pm_to_blib));
2726 @extras = ('dist' => { 'TO_UNIX' => 'perl -Mtounix -e "tounix(\"$(DISTVNAME)\")"' });
2827 }
2928
30 if ($^O eq 'MSWin32') {
31 # incantation to solve the problem of everyone's $Config{make} being 'nmake'
32 # when we want 'pmake'. And $Config{} is read only.
33 # actually, this is just a copy of the code from ExtUtiles::MM_Win32 tidied
34 # up (to expose tabs) and the dependency on Config removed
35 *MY::pm_to_blib = sub
36 {
37 my $self = shift;
38 my($autodir) = $self->catdir('$(INST_LIB)','auto');
39 return <<"EOT";
40
41 pm_to_blib: \$(TO_INST_PM)
42 \t$self->{NOECHO}\$(PERL) \"-I\$(INST_ARCHLINE)\" \"-I\$(INST_LIB)\" \\
43 \t\"-I\$(PERL_ARCHLIB)\" \"-I\$(PERL_LIB)\" -MExtUtils::Install \\
44 \t-e \"pm_to_blib({ qw[\$(PM_TO_BLIB)] }, '$autodir')
45 \t$self->{NOECHO}\$(TOUCH) \$@
46
47 EOT
48 };
49
50 }
51 elsif ($^O eq 'linux')
29 if ($^O eq 'linux')
5230 {
5331
54 *MY::postamble = sub
55 {
56 my ($self) = @_;
57 my ($res);
58 my ($package) = lc($self->{'NAME'});
59 my ($pversion) = $self->{'VERSION'};
60 my ($svn) = `svnversion`;
61 my ($sign) = '--auto-debsign' if ($opt_r);
62 my ($fpackage);
63
32 *MY::postamble = sub
33 {
34 my ($self) = @_;
35 my ($res);
36 my ($package) = lc($self->{'NAME'});
37 my ($pversion) = $self->{'VERSION'};
38 my ($svn) = `svnversion`;
39 my ($sign) = '--auto-debsign' if ($opt_r);
40 my ($fpackage);
41
6442 $svn =~ s/\s+$//o;
6543 if ($svn and $svn ne "exported")
6644 {
67 $svn =~ s/[0-9]*://og;
45 $svn =~ s/[0-9]*://og;
6846 }
6947 else
7048 {
7149 $svn = `hg identify -n`;
7250 $svn =~ s/\+?\s+$//o;
7351 }
74 $package =~ s/::/-/g;
75 $package = "lib${package}-perl";
76 $pversion .= "+$svn" unless ($opt_r);
77 $fpackage = "$package-$pversion";
78
79 $res = <<"EOT";
52 $package =~ s/::/-/g;
53 $package = "lib${package}-perl";
54 $pversion .= "+$svn" unless ($opt_r);
55 $fpackage = "$package-$pversion";
56
57 $res = <<"EOT";
8058 debsrc: dist
8159 rm -fr $self->{'DISTVNAME'}
8260 rm -fr $package
9169 # make deb builds an interim deb from svn source for release
9270 deb: deb-base
9371 EOT
94
95 foreach my $d (split(' ', $opt_d))
96 {
97 $res .= <<"EOT";
98 mkdir -p dists/$d
72
73 foreach my $d (split(' ', $opt_d))
74 {
75 $res .= <<"EOT";
76 mkdir -p dists/$d
9977 dch -D $d -v $pversion-$opt_v -m -b -c $fpackage/debian/changelog "Auto build from perl for $d"
10078 cd $fpackage && pdebuild --buildresult ../dists/$d -- --basetgz /var/cache/pbuilder/base-$d.tgz $pbuilderopts{$d}
10179 EOT
102 }
103
104 return $res;
105 };
106
80 }
81
82 return $res;
83 };
84
10785 }
10886
10987 my %makeinfo = (
11088 NAME => 'Font::TTF',
11189 VERSION_FROM => 'lib/Font/TTF.pm',
112 # VERSION => "0.38",
11390 # HTMLLIBPODS => {map {my $t = $_; $t=~s/\..*?$/.html/o; $t='blib/Html/'.$t; $_ => $t;} @theselibs},
11491 # HTMLSCRIPTPODS => {map {my $t=$_; $t=~s/\..*?$/.html/o; $t='blib/Html/'.$t; $_ => $t;} @scripts},
11592 AUTHOR => "martin_hosken\@sil.org",
11895 PREREQ_PM => {
11996 'IO::String' => 0
12097 },
98 META_MERGE => {
99 'meta-spec' => { version => 2 },
100 resources => {
101 repository => {
102 type => 'git',
103 url => 'https://github.com/silnrsi/font-ttf.git',
104 web => 'https://github.com/silnrsi/font-ttf',
105 }
106 }
107 },
121108 @extras
122109 );
123110
6969
7070 make realclean
7171
72 Win32 users should use pmake instead of make. Alternatively installation can be
73 done on Win32 by typing:
74
75 Setup
76
77 Or using the install feature in tools like WinZip.
72 Windows users should use dmake instead of make.
7873
7974 =head1 CHANGES
8075
9186
9287 =head1 LICENSING
9388
94 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
89 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
9590
9691 This module is released under the terms of the Artistic License 2.0.
9792 For details, see the full text of the license in the file LICENSE.
3232 my ($type, $name, $tag) = ($1, $2, $3);
3333 print "\n\n//$type\n\n" if $type != $which;
3434 $which = $type;
35 print " \"$name\" => \"$tag\",\n";
35 print " \"$name\" => '$tag',\n";
3636 }
3737
3838 elsif (/^'(.{1,4})'\s+(.*)$/o)
4040 # Special reverse formatting for feature names
4141 my ($name, $tag) = ($2, $1);
4242 $tag .= " " x (4 - length($tag)); # pad tag
43 print " \"$name\" => \"$tag\",\n";
43 print " \"$name\" => '$tag',\n";
4444 }
4545
4646 elsif (/^'(.{1,4})-(.{1,4})'\s+(.*)$/o)
5252 $tag =~ /(\d+)$/;
5353 my $index = $1;
5454 $tag .= " " x (4 - length($tag)); # pad tag
55 print " \"$name $index\" => \"$tag\",\n";
55 print " \"$name $index\" => '$tag',\n";
5656 }
5757 }
5858 elsif (/^([^\t]*)\t([\w]{2,4})(?: +(\([^\t]*\)))?(?:\t(.*))?$/o)
6262 $name =~ s/\s*\(Standard\)\s*//oi; # Remove "(Standard)" from French and German entries
6363 $name .= " $extra" if defined $extra; # Dhivehi has "(deprecated)" after the "DHV " tag -- move it to name.
6464 $tag .= " " x (4 - length($tag)); # pad tag
65 print " \"$name\" => \"$tag\",\n";
65 print " \"$name\" => '$tag',\n";
6666 if (defined $iso639list)
6767 {
6868 $iso639list =~ s/,//g;
7878 print "\n";
7979 foreach my $tag (sort keys(%iso639list))
8080 {
81 printf " \"$tag\" => \"$iso639list{$tag}\",\n";
81 printf " '$tag' => '$iso639list{$tag}',\n";
8282 }
8383
8484 =head1 AUTHOR
137137
138138 =head1 LICENSING
139139
140 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
140 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
141141
142142 This module is released under the terms of the Artistic License 2.0.
143143 For details, see the full text of the license in the file LICENSE.
700700
701701 =head1 LICENSING
702702
703 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
703 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
704704
705705 This module is released under the terms of the Artistic License 2.0.
706706 For details, see the full text of the license in the file LICENSE.
213213
214214 =head1 LICENSING
215215
216 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
216 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
217217
218218 This module is released under the terms of the Artistic License 2.0.
219219 For details, see the full text of the license in the file LICENSE.
164164
165165 =head1 LICENSING
166166
167 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
167 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
168168
169169 This module is released under the terms of the Artistic License 2.0.
170170 For details, see the full text of the license in the file LICENSE.
734734
735735 =head1 LICENSING
736736
737 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
737 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
738738
739739 This module is released under the terms of the Artistic License 2.0.
740740 For details, see the full text of the license in the file LICENSE.
339339
340340 =head1 LICENSING
341341
342 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
342 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
343343
344344 This module is released under the terms of the Artistic License 2.0.
345345 For details, see the full text of the license in the file LICENSE.
7878
7979 =head1 LICENSING
8080
81 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
81 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
8282
8383 This module is released under the terms of the Artistic License 2.0.
8484 For details, see the full text of the license in the file LICENSE.
7676
7777 =head1 LICENSING
7878
79 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
79 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
8080
8181 This module is released under the terms of the Artistic License 2.0.
8282 For details, see the full text of the license in the file LICENSE.
174174
175175 =head1 LICENSING
176176
177 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
177 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
178178
179179 This module is released under the terms of the Artistic License 2.0.
180180 For details, see the full text of the license in the file LICENSE.
1313 # Print font table with name
1414 print ttfdump($font->{'head'}, 'head');
1515
16 # Print font table with name and other options
17 print ttfdump($font->{'head'}, 'head', %opts);
18
1619 # Print one glyph's data:
1720 print ttfdump($font->{'loca'}->read->{'glyphs'}[$gid], "glyph_$gid");
1821
2326 many of the object structures have ' PARENT' links that refer back to the object's parent,
2427 which means that Data::Dumper ends up dumping the whole font no matter what.
2528
26 The purpose of this module is to do just one thing: invoke Data::Dumper with a
29 The main purpose of this module is to invoke Data::Dumper with a
2730 filter that skips over the ' PARENT' element of any hash.
2831
2932 To reduce output further, this module also skips over ' CACHE' elements and any
3033 hash element whose value is a Font::TTF::Glyph or Font::TTF::Font object.
3134 (Really should make this configurable.)
35
36 If $opts{'d'}, then set Deepcopy mode to minimize use of crossreferencing.
3237
3338 =cut
3439
4449
4550 sub ttfdump
4651 {
47 my ($var, $name) = @_;
52 my ($var, $name, %opts) = @_;
4853 my $res;
4954
5055 my $d = Data::Dumper->new([$var]);
5156 $d->Names([$name]) if defined $name;
5257 $d->Sortkeys(\&myfilter); # This is the trick to keep from dumping the whole font
58 $d->Deepcopy($opts{'d'}); # Caller controls whether to use crossreferencing
5359 $d->Indent(3); # I want array indicies
5460 $d->Useqq(1); # Perlquote -- slower but there might be binary data.
5561 $res = $d->Dump;
7985
8086 =head1 LICENSING
8187
82 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
88 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
8389
8490 This module is released under the terms of the Artistic License 2.0.
8591 For details, see the full text of the license in the file LICENSE.
298298
299299 =head1 LICENSING
300300
301 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
301 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
302302
303303 This module is released under the terms of the Artistic License 2.0.
304304 For details, see the full text of the license in the file LICENSE.
247247
248248 =head1 LICENSING
249249
250 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
250 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
251251
252252 This module is released under the terms of the Artistic License 2.0.
253253 For details, see the full text of the license in the file LICENSE.
126126
127127 =head1 LICENSING
128128
129 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
129 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
130130
131131 This module is released under the terms of the Artistic License 2.0.
132132 For details, see the full text of the license in the file LICENSE.
202202
203203 =head1 LICENSING
204204
205 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
205 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
206206
207207 This module is released under the terms of the Artistic License 2.0.
208208 For details, see the full text of the license in the file LICENSE.
156156
157157 =head1 LICENSING
158158
159 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
159 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
160160
161161 This module is released under the terms of the Artistic License 2.0.
162162 For details, see the full text of the license in the file LICENSE.
121121
122122 =head1 LICENSING
123123
124 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
124 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
125125
126126 This module is released under the terms of the Artistic License 2.0.
127127 For details, see the full text of the license in the file LICENSE.
9999
100100 =head1 LICENSING
101101
102 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
102 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
103103
104104 This module is released under the terms of the Artistic License 2.0.
105105 For details, see the full text of the license in the file LICENSE.
106106
107107 =head1 LICENSING
108108
109 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
109 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
110110
111111 This module is released under the terms of the Artistic License 2.0.
112112 For details, see the full text of the license in the file LICENSE.
915915
916916 =head1 LICENSING
917917
918 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
918 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
919919
920920 This module is released under the terms of the Artistic License 2.0.
921921 For details, see the full text of the license in the file LICENSE.
8484
8585 =head1 LICENSING
8686
87 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
87 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
8888
8989 This module is released under the terms of the Artistic License 2.0.
9090 For details, see the full text of the license in the file LICENSE.
290290 $loc = $fh->tell();
291291 if (defined $self->{'MARKSETS'} && @{$self->{'MARKSETS'}} > 0)
292292 {
293 $self->{'Version'} = 0x00010002;
293 $self->{'Version'} = 0x00010002 if ($self->{'Version'} < 0x00010002);
294294 $fh->print(TTF_Pack('LSSSSS', $self->{'Version'}, 0, 0, 0, 0, 0));
295295 }
296296 else
465465
466466 =head1 LICENSING
467467
468 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
468 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
469469
470470 This module is released under the terms of the Artistic License 2.0.
471471 For details, see the full text of the license in the file LICENSE.
318318 {
319319 my (@offs, $mloc, $thisloc, $ncomp, $k);
320320
321 $lookup->{'MATCH'} = [$lookup->{'COVERAGE'}];
322 $lookup->{'COVERAGE'} = $self->read_cover($count, $loc, $lookup, $fh, 1);
321 $lookup->{'MATCH'} = [$lookup->{'COVERAGE'}]; # Attaching mark
322 $lookup->{'COVERAGE'} = $self->read_cover($count, $loc, $lookup, $fh, 1); # base/lig/mark being attached to
323323 $fh->read($dat, 6);
324324 ($mcount, $moff, $boff) = TTF_Unpack('S*', $dat);
325 # Read MarkArray
325326 $fh->seek($loc + $moff, 0);
326327 $fh->read($dat, 2);
327328 $count = TTF_Unpack('S', $dat);
332333 $self->read_anchor(TTF_Unpack('S', substr($dat, 2, 2)) + $moff,
333334 $loc, $lookup, $fh)]);
334335 }
336 # Read BaseArray/LigatureArray/Mark2Array
335337 $fh->seek($loc + $boff, 0);
336338 $fh->read($dat, 2);
337339 $count = TTF_Unpack('S', $dat);
357359 $subst = [];
358360 $fh->read($dat, $mcount << 1);
359361 for ($k = 0; $k < $mcount; $k++)
360 { push (@$subst, $self->read_anchor(TTF_Unpack('S', substr($dat, $k << 1, 2)) + $thisloc - $loc,
361 $loc, $lookup, $fh)); }
362 { push (@$subst, $self->read_anchor(TTF_Unpack('S', substr($dat, $k << 1, 2)),
363 $thisloc, $lookup, $fh)); }
362364
363365 push (@{$lookup->{'RULES'}[$i]}, {'ACTION' => $subst});
364366 }
697699
698700 =head1 LICENSING
699701
700 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
702 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
701703
702704 This module is released under the terms of the Artistic License 2.0.
703705 For details, see the full text of the license in the file LICENSE.
287287
288288 =head1 LICENSING
289289
290 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
290 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
291291
292292 This module is released under the terms of the Artistic License 2.0.
293293 For details, see the full text of the license in the file LICENSE.
135135
136136 =head1 LICENSING
137137
138 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
138 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
139139
140140 This module is released under the terms of the Artistic License 2.0.
141141 For details, see the full text of the license in the file LICENSE.
107107
108108 =head1 LICENSING
109109
110 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
110 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
111111
112112 This module is released under the terms of the Artistic License 2.0.
113113 For details, see the full text of the license in the file LICENSE.
167167
168168 =head1 LICENSING
169169
170 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
170 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
171171
172172 This module is released under the terms of the Artistic License 2.0.
173173 For details, see the full text of the license in the file LICENSE.
266266 return $self if (defined $self->{' read'} && $self->{' read'} > 0);
267267 $self->{' read'} = 1;
268268 $fh->seek($self->{' LOC'} + $self->{' BASE'}, 0);
269 $fh->read($self->{' DAT'}, $self->{' LEN'});
270 TTF_Read_Fields($self, $self->{' DAT'}, \%fields);
269 $fh->read($dat, $self->{' LEN'});
270 TTF_Read_Fields($self, $self->{' DAT'} = $dat, \%fields);
271271 $self;
272272 }
273273
841841 is all the compounds and their references and so on. If this glyph is not a
842842 compound, then returns an empty array.
843843
844 Please note the warning about bad fonts that reference nonexistant glyphs
844 Please note the warning about bad fonts that reference nonexistent glyphs
845845 under INSTANCE VARIABLES above. This function will not attempt to
846 filter out nonexistant glyph numbers.
846 filter out nonexistent glyph numbers.
847847
848848 =cut
849849
890890
891891 =head1 LICENSING
892892
893 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
893 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
894894
895895 This module is released under the terms of the Artistic License 2.0.
896896 For details, see the full text of the license in the file LICENSE.
307307
308308 =head1 LICENSING
309309
310 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
310 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
311311
312312 This module is released under the terms of the Artistic License 2.0.
313313 For details, see the full text of the license in the file LICENSE.
159159
160160 =head1 LICENSING
161161
162 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
162 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
163163
164164 This module is released under the terms of the Artistic License 2.0.
165165 For details, see the full text of the license in the file LICENSE.
260260
261261 =head1 LICENSING
262262
263 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
263 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
264264
265265 This module is released under the terms of the Artistic License 2.0.
266266 For details, see the full text of the license in the file LICENSE.
169169
170170 =head1 LICENSING
171171
172 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
172 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
173173
174174 This module is released under the terms of the Artistic License 2.0.
175175 For details, see the full text of the license in the file LICENSE.
211211
212212 =head1 LICENSING
213213
214 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
214 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
215215
216216 This module is released under the terms of the Artistic License 2.0.
217217 For details, see the full text of the license in the file LICENSE.
150150
151151 =head1 LICENSING
152152
153 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
153 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
154154
155155 This module is released under the terms of the Artistic License 2.0.
156156 For details, see the full text of the license in the file LICENSE.
9090
9191 =head1 LICENSING
9292
93 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
93 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
9494
9595 This module is released under the terms of the Artistic License 2.0.
9696 For details, see the full text of the license in the file LICENSE.
106106
107107 =head1 LICENSING
108108
109 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
109 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
110110
111111 This module is released under the terms of the Artistic License 2.0.
112112 For details, see the full text of the license in the file LICENSE.
140140
141141 =head1 LICENSING
142142
143 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
143 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
144144
145145 This module is released under the terms of the Artistic License 2.0.
146146 For details, see the full text of the license in the file LICENSE.
172172
173173 =head1 LICENSING
174174
175 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
175 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
176176
177177 This module is released under the terms of the Artistic License 2.0.
178178 For details, see the full text of the license in the file LICENSE.
352352
353353 =head1 LICENSING
354354
355 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
355 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
356356
357357 This module is released under the terms of the Artistic License 2.0.
358358 For details, see the full text of the license in the file LICENSE.
9797
9898 =head1 LICENSING
9999
100 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
100 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
101101
102102 This module is released under the terms of the Artistic License 2.0.
103103 For details, see the full text of the license in the file LICENSE.
184184
185185 =head1 LICENSING
186186
187 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
187 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
188188
189189 This module is released under the terms of the Artistic License 2.0.
190190 For details, see the full text of the license in the file LICENSE.
207207 Martin Hosken L<http://scripts.sil.org/FontUtils>.
208208 (see CONTRIBUTORS for other authors).
209209
210
211
212210 =head1 LICENSING
213211
214 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
215
216 This module is released under the terms of the Artistic License 2.0.
212 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
213
214 This module is released under the terms of the Artistic License 2.0.
217215 For details, see the full text of the license in the file LICENSE.
218216
219
220
221217 =cut
222218
223 1;
219 1;
187187
188188 =head1 LICENSING
189189
190 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
190 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
191191
192192 This module is released under the terms of the Artistic License 2.0.
193193 For details, see the full text of the license in the file LICENSE.
193193
194194 =head1 LICENSING
195195
196 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
196 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
197197
198198 This module is released under the terms of the Artistic License 2.0.
199199 For details, see the full text of the license in the file LICENSE.
153153
154154 =head1 LICENSING
155155
156 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
156 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
157157
158158 This module is released under the terms of the Artistic License 2.0.
159159 For details, see the full text of the license in the file LICENSE.
176176
177177 =head1 LICENSING
178178
179 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
179 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
180180
181181 This module is released under the terms of the Artistic License 2.0.
182182 For details, see the full text of the license in the file LICENSE.
243243
244244 =head1 LICENSING
245245
246 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
246 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
247247
248248 This module is released under the terms of the Artistic License 2.0.
249249 For details, see the full text of the license in the file LICENSE.
9292
9393 =head1 LICENSING
9494
95 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
95 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
9696
9797 This module is released under the terms of the Artistic License 2.0.
9898 For details, see the full text of the license in the file LICENSE.
104104
105105 =head1 LICENSING
106106
107 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
107 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
108108
109109 This module is released under the terms of the Artistic License 2.0.
110110 For details, see the full text of the license in the file LICENSE.
197197
198198 =head1 LICENSING
199199
200 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
200 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
201201
202202 This module is released under the terms of the Artistic License 2.0.
203203 For details, see the full text of the license in the file LICENSE.
117117
118118 =head1 LICENSING
119119
120 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
120 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
121121
122122 This module is released under the terms of the Artistic License 2.0.
123123 For details, see the full text of the license in the file LICENSE.
904904
905905 =head1 LICENSING
906906
907 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
907 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
908908
909909 This module is released under the terms of the Artistic License 2.0.
910910 For details, see the full text of the license in the file LICENSE.
10241024
10251025 =head1 LICENSING
10261026
1027 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
1027 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
10281028
10291029 This module is released under the terms of the Artistic License 2.0.
10301030 For details, see the full text of the license in the file LICENSE.
5959 %tttags = (
6060
6161 'SCRIPT' => {
62 "Adlam" => 'adlm',
63 "Ahom" => 'ahom',
64 "Anatolian Hieroglyphs" => 'hluw',
6265 "Arabic" => 'arab',
6366 "Armenian" => 'armn',
6467 "Avestan" => 'avst',
6568 "Balinese" => 'bali',
6669 "Bamum" => 'bamu',
70 "Bassa Vah" => 'bass',
6771 "Batak" => 'batk',
6872 "Bengali" => 'beng',
6973 "Bengali v.2" => 'bng2',
74 "Bhaiksuki" => 'bhks',
7075 "Bopomofo" => 'bopo',
7176 "Brahmi" => 'brah',
7277 "Braille" => 'brai',
7580 "Byzantine Music" => 'byzm',
7681 "Canadian Syllabics" => 'cans',
7782 "Carian" => 'cari',
83 "Caucasian Albanian" => 'aghb',
7884 "Chakma" => 'cakm',
7985 "Cham" => 'cham',
8086 "Cherokee" => 'cher',
8692 "Deseret" => 'dsrt',
8793 "Devanagari" => 'deva',
8894 "Devanagari v.2" => 'dev2',
95 "Duployan" => 'dupl',
8996 "Egyptian hieroglyphs" => 'egyp',
97 "Elbasan" => 'elba',
9098 "Ethiopic" => 'ethi',
9199 "Georgian" => 'geor',
92100 "Glagolitic" => 'glag',
93101 "Gothic" => 'goth',
102 "Grantha" => 'gran',
94103 "Greek" => 'grek',
95104 "Gujarati" => 'gujr',
96105 "Gujarati v.2" => 'gjr2',
99108 "Hangul" => 'hang',
100109 "Hangul Jamo" => 'jamo',
101110 "Hanunoo" => 'hano',
111 "Hatran" => 'hatr',
102112 "Hebrew" => 'hebr',
103113 "Hiragana" => 'kana',
104114 "Imperial Aramaic" => 'armi',
112122 "Kayah Li" => 'kali',
113123 "Kharosthi" => 'khar',
114124 "Khmer" => 'khmr',
125 "Khojki" => 'khoj',
126 "Khudawadi" => 'sind',
115127 "Lao" => 'lao ',
116128 "Latin" => 'latn',
117129 "Lepcha" => 'lepc',
118130 "Limbu" => 'limb',
131 "Linear A" => 'lina',
119132 "Linear B" => 'linb',
120133 "Lisu (Fraser)" => 'lisu',
121134 "Lycian" => 'lyci',
122135 "Lydian" => 'lydi',
136 "Mahajani" => 'mahj',
137 "Marchen" => 'marc',
123138 "Malayalam" => 'mlym',
124139 "Malayalam v.2" => 'mlm2',
125140 "Mandaic, Mandaean" => 'mand',
141 "Manichaean" => 'mani',
126142 "Mathematical Alphanumeric Symbols" => 'math',
127143 "Meitei Mayek (Meithei, Meetei)" => 'mtei',
144 "Mende Kikakui" => 'mend',
128145 "Meroitic Cursive" => 'merc',
129146 "Meroitic Hieroglyphs" => 'mero',
130147 "Miao" => 'plrd',
148 "Modi" => 'modi',
131149 "Mongolian" => 'mong',
150 "Mro" => 'mroo',
151 "Multani" => 'mult',
132152 "Musical Symbols" => 'musc',
133153 "Myanmar" => 'mymr',
134154 "Myanmar v.2" => 'mym2',
155 "Nabataean" => 'nbat',
156 "Newa" => 'newa',
135157 "New Tai Lue" => 'talu',
136158 "N'Ko" => 'nko ',
159 "Odia (formerly Oriya)" => 'orya',
160 "Odia (formerly Oriya) v.2" => 'ory2',
137161 "Ogham" => 'ogam',
138162 "Ol Chiki" => 'olck',
139163 "Old Italic" => 'ital',
164 "Old Hungarian" => 'hung',
165 "Old North Arabian" => 'narb',
166 "Old Permic" => 'perm',
140167 "Old Persian Cuneiform" => 'xpeo',
141168 "Old South Arabian" => 'sarb',
142169 "Old Turkic, Orkhon Runic" => 'orkh',
143 "Odia (formerly Oriya)" => 'orya',
144 "Odia (formerly Oriya) v.2" => 'ory2',
170 "Osage" => 'osge',
145171 "Osmanya" => 'osma',
172 "Pahawh Hmong" => 'hmng',
173 "Palmyrene" => 'palm',
174 "Pau Cin Hau" => 'pauc',
146175 "Phags-pa" => 'phag',
147176 "Phoenician" => 'phnx',
177 "Psalter Pahlavi" => 'phlp',
148178 "Rejang" => 'rjng',
149179 "Runic" => 'runr',
150180 "Samaritan" => 'samr',
151181 "Saurashtra" => 'saur',
152182 "Sharada" => 'shrd',
153183 "Shavian" => 'shaw',
184 "Siddham" => 'sidd',
185 "Sign Writing" => 'sgnw',
154186 "Sinhala" => 'sinh',
155187 "Sora Sompeng" => 'sora',
156188 "Sumero-Akkadian Cuneiform" => 'xsux',
165197 "Takri" => 'takr',
166198 "Tamil" => 'taml',
167199 "Tamil v.2" => 'tml2',
200 "Tangut" => 'tang',
168201 "Telugu" => 'telu',
169202 "Telugu v.2" => 'tel2',
170203 "Thaana" => 'thaa',
171204 "Thai" => 'thai',
172205 "Tibetan" => 'tibt',
173206 "Tifinagh" => 'tfng',
207 "Tirhuta" => 'tirh',
174208 "Ugaritic Cuneiform" => 'ugar',
175209 "Vai" => 'vai ',
210 "Warang Citi" => 'wara',
176211 "Yi" => 'yi ',
177212 },
178213
248283 "Bugis" => 'BUG ',
249284 "Bulgarian" => 'BGR ',
250285 "Burmese" => 'BRM ',
286 "Burushaski" => 'BSK ',
251287 "Cajun French" => 'FRC ',
252288 "Carrier" => 'CRR ',
253289 "Catalan" => 'CAT ',
318354 "Fang" => 'FAN0',
319355 "Fanti" => 'FAT ',
320356 "Faroese" => 'FOS ',
357 "Fe'fe'" => 'FMP ',
321358 "Fijian" => 'FJI ',
322359 "Filipino" => 'PIL ',
323360 "Finnish" => 'FIN ',
422459 "Khanty-Vakhi" => 'KHV ',
423460 "Khasi" => 'KSI ',
424461 "Khmer" => 'KHM ',
462 "Khorasani Turkic" => 'KMZ ',
425463 "Khowar" => 'KHW ',
426464 "Khutsuri Georgian" => 'KGE ',
427465 "Kikongo" => 'KON ',
451489 "Kpelle (Liberia)" => 'XPE ',
452490 "Kpelle" => 'KPL ',
453491 "Krio" => 'KRI ',
492 "Krymchak" => 'JCT ',
454493 "Kuanyama" => 'KUA ',
455494 "Kui" => 'KUI ',
456495 "Kulvi" => 'KUL ',
525564 "Marwari" => 'MAW ',
526565 "Mayan" => 'MYN ',
527566 "Mazanderani" => 'MZN ',
567 "Mbembe Tigon" => 'NZA ',
568 "Mbo" => 'MBO ',
528569 "Mbundu" => 'MBN ',
529570 "Me'en" => 'MEN ',
571 "Medumba" => 'BYV ',
530572 "Mende" => 'MDE ',
531573 "Meru" => 'MER ',
532574 "Mewati" => 'WTM ',
567609 "Niuean" => 'NIU ',
568610 "Nogai" => 'NOG ',
569611 "Norfolk" => 'PIH ',
612 "North Slavey" => 'SCS ',
570613 "Northern Sami" => 'NSM ',
571614 "Northern Thai" => 'NTA ',
572615 "Norway House Cree" => 'NHC ',
10691112 'BRM ' => 'mya',
10701113 'BRX ' => 'brx',
10711114 'BSH ' => 'bak',
1115 "BSK " => 'bsk',
10721116 'BTI ' => 'btb',
10731117 'BTS ' => 'bts',
10741118 'BUG ' => 'bug',
1119 "BYV " => 'byv',
10751120 'CAK ' => 'cak',
10761121 'CAT ' => 'cat',
10771122 'CBK ' => 'cbk',
11441189 'FIN ' => 'fin',
11451190 'FJI ' => 'fij',
11461191 'FLE ' => 'vls',
1192 "FMP " => 'fmp',
11471193 'FNE ' => 'enf',
11481194 'FON ' => 'fon',
11491195 'FOS ' => 'fao',
12201266 'JAN ' => 'jpn',
12211267 'JAV ' => 'jav',
12221268 'JBO ' => 'jbo',
1269 "JCT " => 'jct',
12231270 'JII ' => 'yid',
12241271 'JUD ' => 'lad',
12251272 'JUL ' => 'dyu',
12551302 'KMN ' => 'kfy',
12561303 'KMO ' => 'kmw',
12571304 'KMS ' => 'kxc',
1305 "KMZ " => 'kmz',
12581306 'KNR ' => 'kau',
12591307 'KOD ' => 'kfa',
12601308 'KOH ' => 'okm',
13311379 'MAR ' => 'mar',
13321380 'MAW ' => 'mwr dhd rwr mve wry mtr swv',
13331381 'MBN ' => 'kmb',
1382 "MBO " => 'mbo',
13341383 'MCH ' => 'mnc',
13351384 'MCR ' => 'crm',
13361385 'MDE ' => 'men',
13981447 'NTO ' => 'epo',
13991448 'NYM ' => 'nym',
14001449 'NYN ' => 'nno',
1450 "NZA " => 'nza',
14011451 'OCI ' => 'oci',
14021452 'OCR ' => 'ojs',
14031453 'OJB ' => 'oji',
14611511 'SAY ' => 'chp',
14621512 'SCN ' => 'scn',
14631513 'SCO ' => 'sco',
1514 "SCS " => 'scs',
14641515 'SEK ' => 'xan',
14651516 'SEL ' => 'sel',
14661517 'SGA ' => 'sga',
14731524 'SIG ' => 'xst',
14741525 'SKS ' => 'sms',
14751526 'SKY ' => 'slk',
1476 'SLA ' => 'scs',
1527 "SLA " => 'scs xsl',
14771528 'SLV ' => 'slv',
14781529 'SML ' => 'som',
14791530 'SMO ' => 'smo',
16361687
16371688 =head1 LICENSING
16381689
1639 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
1690 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
16401691
16411692 This module is released under the terms of the Artistic License 2.0.
16421693 For details, see the full text of the license in the file LICENSE.
357357
358358 =head1 LICENSING
359359
360 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
360 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
361361
362362 This module is released under the terms of the Artistic License 2.0.
363363 For details, see the full text of the license in the file LICENSE.
711711
712712 =head1 LICENSING
713713
714 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
714 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
715715
716716 This module is released under the terms of the Artistic License 2.0.
717717 For details, see the full text of the license in the file LICENSE.
130130
131131 =head1 LICENSING
132132
133 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
133 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
134134
135135 This module is released under the terms of the Artistic License 2.0.
136136 For details, see the full text of the license in the file LICENSE.
44454445
44464446 =head1 LICENSING
44474447
4448 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
4448 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
44494449
44504450 This module is released under the terms of the Artistic License 2.0.
44514451 For details, see the full text of the license in the file LICENSE.
316316
317317 =head1 LICENSING
318318
319 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
319 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
320320
321321 This module is released under the terms of the Artistic License 2.0.
322322 For details, see the full text of the license in the file LICENSE.
8686
8787 =head1 LICENSING
8888
89 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
89 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
9090
9191 This module is released under the terms of the Artistic License 2.0.
9292 For details, see the full text of the license in the file LICENSE.
167167
168168 =head1 LICENSING
169169
170 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
170 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
171171
172172 This module is released under the terms of the Artistic License 2.0.
173173 For details, see the full text of the license in the file LICENSE.
373373
374374 =head1 LICENSING
375375
376 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
376 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
377377
378378 This module is released under the terms of the Artistic License 2.0.
379379 For details, see the full text of the license in the file LICENSE.
300300 ["pop_ret", 0, ""], ["ret_zero", 0, ""], ["ret_true", 0, ""], ["iattr_set", 2, "Sn"], # 48
301301 ["iattr_add", 2, "Sn"], ["iattr_sub", 2, "Sn"], ["push_proc_state", 1, "n"], ["push_version", 0, ""],
302302 ["put_subs", 5, "sCcCc"], ["put_subs2", 4, "cscc"], ["put_subs3", 7, "scscscc"], ["put_glyph", 2, "Cc"],
303 ["push_glyph_attr", 3, "Ggs"], ["push_att_to_glyph_attr", 3, "Ggs"] );
303 ["push_glyph_attr", 3, "Ggs"], ["push_att_to_glyph_attr", 3, "Ggs"], ["bitand", 0, ""], ["bitor", 0, ""],
304 ["bitnot", 0, ""], ["setbits", 4, "NnNn"], ["setfeat", 2, "fs"] ); # 64
304305
305306 my ($i) = 0;
306307 our %opnames = map {$_->[0] => $i++} @opcodes;
365366 }
366367 $fh->read($dat, 10);
367368 ($silf->{'numLigComp'}, $silf->{'numUserAttr'}, $silf->{'maxCompPerLig'}, $silf->{'direction'},
368 $d, $d, $d, $d, $numCritFeatures) = TTF_Unpack("SCCCCCCCC", $dat);
369 $silf->{'attCollisions'}, $d, $d, $d, $numCritFeatures) = TTF_Unpack("SCCCCCCCC", $dat);
369370 if ($numCritFeatures)
370371 {
371372 $fh->read($dat, $numCritFeatures * 2);
398399 $fh->read($dat, 4);
399400 my ($numClasses, $numLinearClasses) = TTF_Unpack("SS", $dat);
400401 $silf->{'numLinearClasses'} = $numLinearClasses;
401 $fh->read($dat, $numClasses * 2 + 2);
402 @classo = unpack("n*", $dat);
402 $fh->read($dat, ($numClasses + 1) * ($self->{'Version'} >= 4 ? 4 : 2));
403 @classo = unpack($self->{'Version'} >= 4 ? "N*" : "n*", $dat);
403404 $fh->read($dat, $classo[-1] - $classo[0]);
404405 for ($i = 0; $i < $numLinearClasses; $i++)
405406 {
422423
423424 sub chopcode
424425 {
425 my ($dest, $dat, $offsets) = @_;
426 my ($dest, $dat, $offsets, $isconstraint) = @_;
426427 my ($last) = $offsets->[-1];
427428 my ($i);
428429
429430 for ($i = $#{$offsets} - 1; $i >= 0; $i--)
430431 {
431 if ($offsets->[$i] or $i == 0)
432 if ((!$isconstraint || $offsets->[$i]) && $offsets->[$i] != $last)
432433 {
433434 unshift(@{$dest}, substr($dat, $offsets->[$i], $last - $offsets->[$i]));
434435 $last = $offsets->[$i];
446447 my ($d, $dat, $i, @orulemap, @oconstraints, @oactions, $numRanges);
447448
448449 $fh->seek($offset + $base, 0);
450 # printf "pass base = %04X\n", $offset;
449451 push (@{$silf->{'PASS'}}, $pass);
450452 $fh->read($dat, 40);
451453 ($pass->{'flags'}, $pass->{'maxRuleLoop'}, $pass->{'maxRuleContext'}, $pass->{'maxBackup'},
473475 $fh->read($dat, $pass->{'numRules'});
474476 $pass->{'rulePreContexts'} = [unpack('C*', $dat)];
475477 $fh->read($dat, 3);
476 ($d, $pass->{'passConstraintLen'}) = TTF_Unpack("CS", $dat);
478 ($pass->{'collisionThreshold'}, $pass->{'passConstraintLen'}) = TTF_Unpack("CS", $dat);
477479 $fh->read($dat, ($pass->{'numRules'} + 1) * 2);
478480 @oconstraints = unpack('n*', $dat);
479481 $fh->read($dat, ($pass->{'numRules'} + 1) * 2);
488490 { $fh->read($pass->{'passConstraintCode'}, $pass->{'passConstraintLen'}); }
489491 $fh->read($dat, $oconstraints[-1]);
490492 $pass->{'constraintCode'} = [];
491 chopcode($pass->{'constraintCode'}, $dat, \@oconstraints);
493 chopcode($pass->{'constraintCode'}, $dat, \@oconstraints, 1);
492494 $fh->read($dat, $oactions[-1]);
493495 $pass->{'actionCode'} = [];
494 chopcode($pass->{'actionCode'}, $dat, \@oactions);
496 chopcode($pass->{'actionCode'}, $dat, \@oactions, 0);
495497 return $pass;
496498 }
497499
604606
605607 sub packcode
606608 {
607 my ($code) = @_;
609 my ($code, $isconstraint) = @_;
608610 my ($dat, $c, $res);
609611
612 $c = 1;
613 $dat = "\000";
610614 foreach (@{$code})
611615 {
612616 if ($_)
616620 $c += length($_);
617621 }
618622 else
619 { push(@{$res}, 0); }
623 { push(@{$res}, $isconstraint ? 0 : $c); }
620624 }
621625 push(@{$res}, $c);
622626 return ($res, $dat);
629633 my (@offsets, $res, $pbase);
630634
631635 $pbase = $fh->tell();
632 # printf "pass base = %04X, ", $pbase - $subbase;
636 # printf "pass base = %04X, ", $pbase - $subbase;
633637 $fh->print(TTF_Pack("CCCCSSLLLLSSSS", $pass->{'flags'}, $pass->{'maxRuleLoop'}, $pass->{'maxRuleContext'},
634638 $pass->{'maxBackup'}, $pass->{'numRules'}, 24, 0, 0, 0, 0, $pass->{'numRows'},
635639 $pass->{'numTransitional'}, $pass->{'numSuccess'}, $pass->{'numColumns'}));
666670 $fh->print(pack("C*", @{$pass->{'rulePreContexts'}}));
667671 $fh->print(TTF_Pack("CS", 0, $pass->{'passConstraintLen'}));
668672 my ($oconstraints, $oactions);
669 ($oconstraints, $dat) = packcode($pass->{'constraintCode'});
670 ($oactions, $actiondat) = packcode($pass->{'actionCode'});
673 ($oconstraints, $dat) = packcode($pass->{'constraintCode'}, 1);
674 ($oactions, $actiondat) = packcode($pass->{'actionCode'}, 0);
671675 # printf "constraint offsets @ %X\n", $fh->tell();
672676 $fh->print(pack("n*", @{$oconstraints}));
673677 # printf "action offsets @ %X\n", $fh->tell();
676680 foreach (@{$pass->{'fsm'}})
677681 { $fh->print(pack("n*", @{$_})); }
678682 # printf "end of fsm @ %X\n", $fh->tell();
679 $fh->print(pack("C", 0));
683 $fh->print(pack("C", $pass->{'collisionThreshold'}));
680684 push(@offsets, $fh->tell() - $subbase);
681685 $fh->print($pass->{'passConstraintCode'});
682686 push(@offsets, $fh->tell() - $subbase);
684688 push(@offsets, $fh->tell() - $subbase);
685689 $fh->print($actiondat);
686690 push(@offsets, 0);
691 print join(", ", @offsets) . "\n";
687692 $res = $fh->tell();
688693 $fh->seek($pbase + 8, 0);
689694 $fh->print(pack("N*", @offsets));
714719 {
715720 my ($subbase) = $fh->tell();
716721 my ($numlin, $i, @opasses, $oPasses, $oPseudo, $ooPasses);
717 if ($self->{'Version'} > 3)
722 if ($self->{'Version'} >= 3)
718723 {
719724 $fh->seek($base + 12 + $silfc * 4, 0);
720725 $fh->print(pack('N', $subbase - $base));
721726 $fh->seek($subbase, 0);
722 $fh->print(TTF_Pack("vSS", $silf->{'Version'}, $oPasses, $oPseudo));
727 $fh->print(TTF_Pack("vSS", $silf->{'Version'}, $ooPasses, $oPseudo));
723728 }
724729 else
725730 {
737742 $_->{'attrWeight'}, $_->{'runto'}, 0, 0, 0)); }
738743
739744 $fh->print(TTF_Pack("SCCCCCCCC", $silf->{'numLigComp'}, $silf->{'numUserAttr'}, $silf->{'maxCompPerLig'},
740 $silf->{'direction'}, 0, 0, 0, 0, $#{$silf->{'CRIT_FEATURE'}} + 1));
745 $silf->{'direction'}, $silf->{'attCollisions'}, 0, 0, 0, $#{$silf->{'CRIT_FEATURE'}} + 1));
741746 $fh->print(pack("n*", @{$silf->{'CRIT_FEATURE'}}));
742747 $fh->print(TTF_Pack("CC", 0, $#{$silf->{'scripts'}} + 1));
743748 foreach (@{$self->{'scripts'}})
745750 $fh->print(TTF_Pack("S", $silf->{'lbGID'}));
746751 $ooPasses = $fh->tell();
747752 if ($silf->{'PASS'}) { $fh->print(pack("N*", (0) x (@{$silf->{'PASS'}} + 1)));}
753 $oPseudo = $fh->tell() - $subbase;
748754 my (@pskeys) = keys %{$silf->{'pseudos'}};
749755 $fh->print(TTF_Pack("SSSS", TTF_bininfo(scalar @pskeys, 6)));
750 $oPseudo = $fh->tell() - $subbase;
751756 foreach my $k (sort {$a <=> $b} @pskeys)
752757 { $fh->print(TTF_Pack("Ls", $k, $silf->{'pseudos'}{$k})); }
753758 $numlin = $silf->{'numLinearClasses'};
754759 $fh->print(TTF_Pack("SS", scalar @{$silf->{'classes'}}, $numlin));
755760 my (@coffsets);
761 # printf "%X, ", $fh->tell() - $base;
756762 my ($cbase) = (scalar @{$silf->{'classes'}} + 1) * ($self->{'Version'} >= 4 ? 4 : 2) + 4;
757763 for ($i = 0; $i < $numlin; $i++)
758764 {
759765 push (@coffsets, $cbase);
760766 $cbase += 2 * scalar @{$silf->{'classes'}[$i]};
761767 }
768 my (@nonlinclasses);
762769 for ($i = $numlin; $i < @{$silf->{'classes'}}; $i++)
763770 {
771 my (@c, $d, @d);
772 my $c = $silf->{'classes'}[$i];
764773 push (@coffsets, $cbase);
765 my ($len) = scalar @{$silf->{'classes'}[$i]};
766 $cbase += 8 + 4 * $len;
774 @c = sort {$c->[$a] <=> $c->[$b]} (0 .. $#{$c});
775 foreach $d (@c)
776 { push (@d, $c->[$d], $d); }
777 push (@nonlinclasses, [@d]);
778 my ($len) = scalar @d;
779 $cbase += 8 + 2 * $len;
767780 }
768781 push (@coffsets, $cbase);
769782 $fh->print(pack(($self->{'Version'} >= 4 ? 'N*' : 'n*'), @coffsets));
770783 for ($i = 0; $i < $numlin; $i++)
771784 { $fh->print(pack("n*", @{$silf->{'classes'}[$i]})); }
785 # printf "%X, ", $fh->tell() - $base;
772786 for ($i = $numlin; $i < @{$silf->{'classes'}}; $i++)
773787 {
774 my ($num) = scalar @{$silf->{'classes'}[$i]};
775 my (@bin) = TTF_bininfo($num, 1);
788
789 my ($num) = scalar @{$nonlinclasses[$i-$numlin]};
790 my (@bin) = TTF_bininfo($num/2, 1);
776791 $fh->print(TTF_Pack("SSSS", @bin));
777 my ($j) = 0;
778 my (@dat) = map {[$_, $j++]} @{$silf->{'classes'}[$i]};
779 foreach (sort {$a->[0] <=> $b->[0] || $a->[1] <=> $b->[1]} @dat)
780 { $fh->print(TTF_Pack("SS", $_->[0], $_->[1])); }
792 $fh->print(pack("n*", @{$nonlinclasses[$i-$numlin]}));
781793 }
782794 $oPasses = $fh->tell() - $subbase;
783795 # printf "original pass = %04X\n", $oPasses;
790802 if ($self->{'Version'} >= 3)
791803 {
792804 $fh->seek($subbase + 4, 0);
793 $fh->print(TTF_Pack("SS", $oPasses, $oPseudo));
805 $fh->print(TTF_Pack("SS", $ooPasses - $subbase, $oPseudo));
794806 }
795807 $fh->seek($end, 0);
796808 $silfc++;
877889
878890 =head1 LICENSING
879891
880 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
892 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
881893
882894 This module is released under the terms of the Artistic License 2.0.
883895 For details, see the full text of the license in the file LICENSE.
131131
132132 =head1 LICENSING
133133
134 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
134 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
135135
136136 This module is released under the terms of the Artistic License 2.0.
137137 For details, see the full text of the license in the file LICENSE.
451451
452452 =head1 LICENSING
453453
454 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
454 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
455455
456456 This module is released under the terms of the Artistic License 2.0.
457457 For details, see the full text of the license in the file LICENSE.
163163
164164 =head1 LICENSING
165165
166 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
166 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
167167
168168 This module is released under the terms of the Artistic License 2.0.
169169 For details, see the full text of the license in the file LICENSE.
650650 $tag->{' OFFSET'} = $fh->tell() - $base - $oLook; # offset to this extension lookup
651651 # LookupTable (including actual offsets to subtables)
652652 $fh->print(pack("nnn", $ext, $tag->{'FLAG'}, $nSub));
653 $fh->print(pack("n*", map {6 + $nSub * 2 + $_ * 8 + $tag->{'FLAG'} & 0x0010 ? 2 : 0 } (0 .. $nSub-1)));
653 $fh->print(pack("n*", map {6 + $nSub * 2 + $_ * 8 + ($tag->{'FLAG'} & 0x0010 ? 2 : 0) } (0 .. $nSub-1)));
654654 $fh->print(pack("n", $tag->{'FILTER'})) if $tag->{'FLAG'} & 0x0010;
655655 $tag->{' EXT_OFFSET'} = $fh->tell(); # = first extension lookup subtable
656656 for ($k = 0; $k < $nSub; $k++)
13331333
13341334 =head1 LICENSING
13351335
1336 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
1336 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
13371337
13381338 This module is released under the terms of the Artistic License 2.0.
13391339 For details, see the full text of the license in the file LICENSE.
9191
9292 =head1 LICENSING
9393
94 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
94 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
9595
9696 This module is released under the terms of the Artistic License 2.0.
9797 For details, see the full text of the license in the file LICENSE.
139139 {
140140 ($res, $frac) = unpack("nn", $dat);
141141 substr($dat, 0, 4) = "";
142 $res -= 65536 if $res > 32767;
143 $res = sprintf("%d.%X", $res, $frac);
142 $res = sprintf("%d.%04X", $res, $frac);
144143 }
145144 elsif ($type eq "F")
146145 {
239238 }
240239 elsif ($type eq "v")
241240 {
242 if ($res =~ s/\.(\d+)$//o)
241 if ($res =~ s/\.([0-9a-f]+)$//oi)
243242 {
244243 $frac = $1;
245244 $frac .= "0" x (4 - length($frac));
627626
628627 =head1 LICENSING
629628
630 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
629 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
631630
632631 This module is released under the terms of the Artistic License 2.0.
633632 For details, see the full text of the license in the file LICENSE.
168168
169169 =head1 LICENSING
170170
171 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
171 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
172172
173173 This module is released under the terms of the Artistic License 2.0.
174174 For details, see the full text of the license in the file LICENSE.
8383
8484 =head1 LICENSING
8585
86 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
86 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
8787
8888 This module is released under the terms of the Artistic License 2.0.
8989 For details, see the full text of the license in the file LICENSE.
3838
3939 =head1 LICENSING
4040
41 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
41 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
4242
4343 This module is released under the terms of the Artistic License 2.0.
4444 For details, see the full text of the license in the file LICENSE.
2222
2323 =head1 LICENSING
2424
25 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
25 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
2626
2727 This module is released under the terms of the Artistic License 2.0.
2828 For details, see the full text of the license in the file LICENSE.
2222
2323 =head1 LICENSING
2424
25 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
25 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
2626
2727 This module is released under the terms of the Artistic License 2.0.
2828 For details, see the full text of the license in the file LICENSE.
5050
5151 =head1 LICENSING
5252
53 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
53 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
5454
5555 This module is released under the terms of the Artistic License 2.0.
5656 For details, see the full text of the license in the file LICENSE.
181181
182182 =head1 LICENSING
183183
184 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
184 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
185185
186186 This module is released under the terms of the Artistic License 2.0.
187187 For details, see the full text of the license in the file LICENSE.
00 package Font::TTF;
11
2 $VERSION = '1.05'; # MJPH 19-Jan-2015 Bug fixes; updated OT tags; GSUB Lookup Type 8 support
2 $VERSION = '1.06'; # RMH 02-Aug-2016 Bug fixes; updated OT tags;
3 # $VERSION = '1.05'; # MJPH 19-Jan-2015 Bug fixes; updated OT tags; GSUB Lookup Type 8 support
34 # $VERSION = '1.04'; # MJPH 8-Jan-2014 License, POD, and perl -w tidying; bug fixes
45 # $VERSION = '1.03'; # MJPH 5-Sep-2013 Add $t->minsize()
56 # $VERSION = '1.02'; # MJPH 30-Aug-2012 Fix case typo in Useall
3435 Martin Hosken L<http://scripts.sil.org/FontUtils>.
3536 (see CONTRIBUTORS for other authors).
3637
38 Repository available at L<https://github.com/silnrsi/font-ttf.git>
39
40 =head1 HISTORY
41
42 See F<Changes> file for a change log.
43
3744 =head1 LICENSING
3845
39 Copyright (c) 1998-2015, SIL International (http://www.sil.org)
46 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
4047
4148 This module is released under the terms of the Artistic License 2.0.
4249 For details, see the full text of the license in the file LICENSE.
4350
44 .
51 The fonts in the test suite are released under the Open Font License 1.1, see F<t/OFL.txt>.
52
53
54 =head1 SEE ALSO
55
56 L<Font::TTF::Font>
4557
4658 =cut
178178
179179 =head1 LICENSING
180180
181 Copyright (c) 1998-2014, SIL International (http://www.sil.org)
181 Copyright (c) 1998-2016, SIL International (http://www.sil.org)
182182
183183 This script is released under the terms of the Artistic License 2.0.
184184 For details, see the full text of the license in the file LICENSE.
0 #!/usr/bin/perl
1 use strict;
2 use Test::More;
3
4 eval 'use Test::CPAN::Changes';
5 plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
6 changes_ok();