<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Font::TTF::Name;

=head1 NAME

Font::TTF::Name - String table for a TTF font

=head1 DESCRIPTION

Strings are held by number, platform, encoding and language. Strings are
accessed as:

    $f-&gt;{'name'}{'strings'}[$number][$platform_id][$encoding_id]{$language_id}

Notice that the language is held in an associative array due to its sparse
nature on some platforms such as Microsoft ($pid = 3). Notice also that the
array order is different from the stored array order (platform, encoding,
language, number) to allow for easy manipulation of strings by number (which is
what I guess most people will want to do).

By default, C&lt;$Font::TTF::Name::utf8&gt; is set to 1, and strings will be stored as UTF8 wherever
possible. The method C&lt;is_utf8&gt; can be used to find out if a string in a particular
platform and encoding will be returned as UTF8. Unicode strings are always
converted if utf8 is requested. Otherwise, strings are stored according to platform:

You now have to set &lt;$Font::TTF::Name::utf8&gt; to 0 to get the old behaviour.

=over 4

=item Apple Unicode (platform id = 0)

Data is stored as network ordered UCS2. There is no encoding id for this platform
but there are language ids as per Mac language ids.

=item Mac (platform id = 1)

Data is stored as 8-bit binary data, leaving the interpretation to the user
according to encoding id.

=item Unicode (platform id = 2)

Currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this
will change to utf8 assuming current UCS2 semantics for all encoding ids.

=item Windows (platform id = 3)

As per Unicode, the data is currently stored as 16-bit network ordered UCS2. Upon
release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for
all encoding ids.

=back

=head1 INSTANCE VARIABLES

=over 4

=item strings

An array of arrays, etc.

=back

=head1 METHODS

=cut

use strict;
use vars qw(@ISA $VERSION @apple_encs @apple_encodings $utf8 $cp_1252 @cp_1252 %win_langs %langs_win %langs_mac @ms_langids @mac_langs);
use Font::TTF::Table;
use Font::TTF::Utils;
@ISA = qw(Font::TTF::Table);

$utf8 = 1;

{
    my ($count, $i);
    eval {require Compress::Zlib;};
    unless ($@)
    {
        for ($i = 0; $i &lt;= $#apple_encs; $i++)
        {
            $apple_encodings[0][$i] = [unpack("n*", Compress::Zlib::uncompress(unpack("u", $apple_encs[$i])))]
                if (defined $apple_encs[$i]);
            foreach (0 .. 127)
            { $apple_encodings[0][$i][$_] = $_; }
            $count = 0;
            $apple_encodings[1][$i] = {map {$_ =&gt; $count++} @{$apple_encodings[0][$i]}};
        }
        $cp_1252[0] = [unpack("n*", Compress::Zlib::uncompress(unpack("u", $cp_1252)))];
        $count = 0;
        $cp_1252[1] = {map({$_ =&gt; $count++} @{$cp_1252[0]})};
    }
    for ($i = 0; $i &lt; $#ms_langids; $i++)
    {
        if (defined $ms_langids[$i][1])
        {
            my ($j);
            for ($j = 0; $j &lt; $#{$ms_langids[$i][1]}; $j++)
            {
                my ($v) = $ms_langids[$i][1][$j];
                if ($v =~ m/^-/o)
                { $win_langs{(($j + 1) &lt;&lt; 10) + $i} = $ms_langids[$i][0] . $v; }
                else
                { $win_langs{(($j + 1) &lt;&lt; 10) + $i} = $v; }
            }
        }
        else
        { $win_langs{$i + 0x400} = $ms_langids[$i][0]; }
    }
    %langs_win = map {my ($t) = $win_langs{$_}; my (@res) = ($t =&gt; $_); push (@res, $t =&gt; $_) if ($t =~ s/-.*$//o &amp;&amp; ($_ &amp; 0xFC00) == 0x400); @res} keys %win_langs;
    $i = 0;
    %langs_mac = map {$_ =&gt; $i++} @mac_langs;
}
    

$VERSION = 1.1;             # MJPH  17-JUN-2000     Add utf8 support
# $VERSION = 1.001;           # MJPH  10-AUG-1998     Put $number first in list

=head2 $t-&gt;read

Reads all the names into memory

=cut

sub read
{
    my ($self) = @_;
    my ($fh) = $self-&gt;{' INFILE'};
    my ($dat, $num, $stroff, $i, $pid, $eid, $lid, $nid, $len, $off, $here);

    $self-&gt;SUPER::read or return $self;
    $fh-&gt;read($dat, 6);
    ($num, $stroff) = unpack("x2nn", $dat);
    for ($i = 0; $i &lt; $num; $i++)
    {
        use bytes;              # hack to fix bugs in 5.8.7
        read($fh, $dat, 12);
        ($pid, $eid, $lid, $nid, $len, $off) = unpack("n6", $dat);
        $here = $fh-&gt;tell();
        $fh-&gt;seek($self-&gt;{' OFFSET'} + $stroff + $off, 0);
        $fh-&gt;read($dat, $len);
        if ($utf8)
        {
            if ($pid == 1 &amp;&amp; defined $apple_encodings[0][$eid])
            { $dat = TTF_word_utf8(pack("n*", map({$apple_encodings[0][$eid][$_]} unpack("C*", $dat)))); }
            elsif ($pid == 2 &amp;&amp; $eid == 2 &amp;&amp; defined @cp_1252)
            { $dat = TTF_word_utf8(pack("n*", map({$cp_1252[0][$_]} unpack("C*", $dat)))); }
            elsif ($pid == 0 || $pid == 3 || ($pid == 2 &amp;&amp; $eid == 1))
            { $dat = TTF_word_utf8($dat); }
        }
        $self-&gt;{'strings'}[$nid][$pid][$eid]{$lid} = $dat;
        $fh-&gt;seek($here, 0);
    }
    $self;
}


=head2 $t-&gt;out($fh)

Writes out all the strings

=cut

sub out
{
    my ($self, $fh) = @_;
    my ($pid, $eid, $lid, $nid, $todo, @todo);
    my ($len, $offset, $loc, $stroff, $endloc, $str_trans);

    return $self-&gt;SUPER::out($fh) unless $self-&gt;{' read'};

    $loc = $fh-&gt;tell();
    $fh-&gt;print(pack("n3", 0, 0, 0));
    foreach $nid (0 .. $#{$self-&gt;{'strings'}})
    {
        foreach $pid (0 .. $#{$self-&gt;{'strings'}[$nid]})
        {
            foreach $eid (0 .. $#{$self-&gt;{'strings'}[$nid][$pid]})
            {
                foreach $lid (sort keys %{$self-&gt;{'strings'}[$nid][$pid][$eid]})
                {
                    $str_trans = $self-&gt;{'strings'}[$nid][$pid][$eid]{$lid};
                    if ($utf8)
                    {
                        if ($pid == 1 &amp;&amp; defined $apple_encodings[1][$eid])
                        { $str_trans = pack("C*",
                                map({$apple_encodings[1][$eid]{$_} || 0x3F} unpack("n*",
                                TTF_utf8_word($str_trans)))); }
                        elsif ($pid == 2 &amp;&amp; $eid == 2 &amp;&amp; defined @cp_1252)
                        { $str_trans = pack("C*",
                                map({$cp_1252[1][$eid]{$_} || 0x3F} unpack("n*",
                                TTF_utf8_word($str_trans)))); }
                        elsif ($pid == 2 &amp;&amp; $eid == 0)
                        { $str_trans =~ s/[\xc0-\xff][\x80-\xbf]+/?/og; }
                        elsif ($pid == 0 || $pid == 3 || ($pid == 2 &amp;&amp; $eid == 1))
                        { $str_trans = TTF_utf8_word($str_trans); }
                    }
                    push (@todo, [$pid, $eid, $lid, $nid, $str_trans]);
                }
            }
        }
    }

    $offset = 0;
    @todo = (sort {$a-&gt;[0] &lt;=&gt; $b-&gt;[0] || $a-&gt;[1] &lt;=&gt; $b-&gt;[1] || $a-&gt;[2] &lt;=&gt; $b-&gt;[2]
            || $a-&gt;[3] &lt;=&gt; $b-&gt;[3]} @todo);
    foreach $todo (@todo)
    {
        $len = length($todo-&gt;[4]);
        $fh-&gt;print(pack("n6", @{$todo}[0..3], $len, $offset));
        $offset += $len;
    }
    
    $stroff = $fh-&gt;tell() - $loc;
    foreach $todo (@todo)
    { $fh-&gt;print($todo-&gt;[4]); }

    $endloc = $fh-&gt;tell();
    $fh-&gt;seek($loc, 0);
    $fh-&gt;print(pack("n3", 0, $#todo + 1, $stroff));
    $fh-&gt;seek($endloc, 0);
    $self;
}


=head2 $t-&gt;XML_element($context, $depth, $key, $value)

Outputs the string element in nice XML (which is all the table really!)

=cut

sub XML_element
{
    my ($self) = shift;
    my ($context, $depth, $key, $value) = @_;
    my ($fh) = $context-&gt;{'fh'};
    my ($nid, $pid, $eid, $lid);

    return $self-&gt;SUPER::XML_element(@_) unless ($key eq 'strings');

    foreach $nid (0 .. $#{$self-&gt;{'strings'}})
    {
        next unless ref($self-&gt;{'strings'}[$nid]);
#        $fh-&gt;print("$depth&lt;strings id='$nid'&gt;\n");
        foreach $pid (0 .. $#{$self-&gt;{'strings'}[$nid]})
        {
            foreach $eid (0 .. $#{$self-&gt;{'strings'}[$nid][$pid]})
            {
                foreach $lid (sort {$a &lt;=&gt; $b} keys %{$self-&gt;{'strings'}[$nid][$pid][$eid]})
                {
                    my ($lang) = $self-&gt;get_lang($pid, $lid) || $lid;
                    $fh-&gt;printf("%s&lt;string id='%s' platform='%s' encoding='%s' language='%s'&gt;\n%s%s%s\n%s&lt;/string&gt;\n",
                            $depth, $nid, $pid, $eid, $lang, $depth,
                            $context-&gt;{'indent'}, $self-&gt;{'strings'}[$nid][$pid][$eid]{$lid}, $depth);
                }
            }
        }
#        $fh-&gt;print("$depth&lt;/strings&gt;\n");
    }
    $self;
}


=head2 $t-&gt;XML_end($context, $tag, %attrs)

Store strings in the right place

=cut

sub XML_end
{
    my ($self) = shift;
    my ($context, $tag, %attrs) = @_;

    if ($tag eq 'string')
    {
        my ($lid) = $self-&gt;find_name($attrs{'platform'}, $attrs{'language'}) || $attrs{'language'};
        $self-&gt;{'strings'}[$attrs{'id'}][$attrs{'platform'}][$attrs{'encoding'}]{$lid}
            = $context-&gt;{'text'};
        return $context;
    }
    else
    { return $self-&gt;SUPER::XML_end(@_); }
}

=head2 is_utf8($pid, $eid)

Returns whether a string of a given platform and encoding is going to be in UTF8

=cut

sub is_utf8
{
    my ($self, $pid, $eid) = @_;

    return ($utf8 &amp;&amp; ($pid == 0 || $pid == 3 || ($pid == 2 &amp;&amp; ($eid != 2 || defined @cp_1252))
            || ($pid == 1 &amp;&amp; defined $apple_encodings[$eid])));
}


=head2 find_name($nid)

Hunts down a name in all the standard places and returns the string and for an
array context the pid, eid &amp; lid as well

=cut

sub find_name
{
    my ($self, $nid) = @_;
    my ($res, $pid, $eid, $lid, $look, $k);

    my (@lookup) = ([3, 1, 1033], [3, 1, -1], [3, 0, 1033], [3, 0, -1], [2, 1, -1], [2, 2, -1], [2, 0, -1],
                    [0, 0, 0], [1, 0, 0]);
    foreach $look (@lookup)
    {
        ($pid, $eid, $lid) = @$look;
        if ($lid == -1)
        {
            foreach $k (keys %{$self-&gt;{'strings'}[$nid][$pid][$eid]})
            {
                if (($res = $self-&gt;{strings}[$nid][$pid][$eid]{$k}) ne '')
                {
                    $lid = $k;
                    last;
                }
            }
        } else
        { $res = $self-&gt;{strings}[$nid][$pid][$eid]{$lid} }
        if ($res ne '')
        { return wantarray ? ($res, $pid, $eid, $lid) : $res; }
    }
    return '';
}


=head2 set_name($nid, $str[, $lang[, @cover]])

Sets the given name id string to $str for all platforms and encodings that
this module can handle. If $lang is set, it is interpretted as a language
tag and if the particular language of a string is found to match, then
that string is changed, otherwise no change occurs.

If supplied, @cover should be a list of references to two-element arrays 
containing pid,eid pairs that should added to the name table if not already present.

This function does not add any names to the table unless @cover is supplied. 

=cut

sub set_name
{
    my ($self, $nid, $str, $lang, @cover) = @_;
    my ($pid, $eid, $lid, $c);

    foreach $pid (0 .. $#{$self-&gt;{'strings'}[$nid]})
    {
        my $strNL = $str;
        $strNL =~ s/\n/\r\n/og  if $pid == 3;
        $strNL =~ s/\n/\r/og    if $pid == 1;
        foreach $eid (0 .. $#{$self-&gt;{'strings'}[$nid][$pid]})
        {
            foreach $lid (keys %{$self-&gt;{'strings'}[$nid][$pid][$eid]})
            {
                next unless (!defined $lang || $self-&gt;match_lang($pid, $lid, $lang));
                $self-&gt;{'strings'}[$nid][$pid][$eid]{$lid} = $strNL;
                foreach $c (0 .. scalar @cover)
                {
                    next unless ($cover[$c][0] == $pid &amp;&amp; $cover[$c][1] == $eid);
                    delete $cover[$c];
                    last;
                }
            }
        }
    }
    foreach $c (@cover)
    {
        my ($pid, $eid) = @{$c};
        my ($lid) = $self-&gt;find_lang($pid, $lang);
        my $strNL = $str;
        $strNL =~ s/\n/\r\n/og  if $pid == 3;
        $strNL =~ s/\n/\r/og    if $pid == 1;
        $self-&gt;{'strings'}[$nid][$pid][$eid]{$lid} = $strNL;
    }
    return $self;
}

=head2 Font::TTF::Name-&gt;match_lang($pid, $lid, $lang)

Compares the language associated to the string of given platform and language
with the given language tag. If the language matches the tag (i.e. is equal
or more defined than the given language tag) returns true. This is calculated
by finding whether the associated language tag starts with the given language
tag.

=cut

sub match_lang
{
    my ($self, $pid, $lid, $lang) = @_;
    my ($langid) = $self-&gt;get_lang($pid, $lid);

    return ($lid == $lang) if ($lang != 0 || $lang eq '0');
    return !index(lc($langid), lc($lang));
}

=head2 Font::TTF::Name-&gt;get_lang($pid, $lid)

Returns the language tag associated with a particular platform and language id

=cut

sub get_lang
{
    my ($self, $pid, $lid) = @_;

    if ($pid == 3)
    { return $win_langs{$lid}; }
    elsif ($pid == 1)
    { return $mac_langs[$lid]; }
    return '';
}


=head2 Font::TTF::Name-&gt;find_lang($pid, $lang)

Looks up the language name and returns a lang id if one exists

=cut

sub find_lang
{
    my ($self, $pid, $lang) = @_;

    if ($pid == 3)
    { return $langs_win{$lang}; }
    elsif ($pid == 1)
    { return $langs_mac{$lang}; }
    return undef;
}


BEGIN {
@apple_encs = (
&lt;&lt;'EOT',
M&gt;)RES==NCW$`@.'G_S5Q*L(!#?+K1VO4:.W6IJA-:\^BM?&gt;L&gt;1&amp;NP(A0Q$BL
M&lt;*!62ZV8Z1)[K]BE$MR#O,=/7OW]7T&amp;*6"NMI4K31EOMM)&gt;N@XXZZ2Q#IBZZ
MZJ:['GKJ)4NVWOKHJ]\_/\!`@PR68XBAALDUW`@CC3+:&amp;&amp;.-,UZ&gt;?!-,-,ED
M4TPUS70SS#3+;`7FF&amp;N&gt;0D7F6V"A119;8JEEEEMAI5566V.M==;;H-A&amp;FVRV
MQ5;;_OTONJ3&lt;%;?&lt;5^NQ1YYXYJGG7GKME3?&gt;&gt;N^=#S[ZY(O/OOKNFU]^JO&lt;[
M!$?LLMO&gt;$#OAH4-*4F+'[(L+E*F,6SH:%\9%]C@&gt;1W&amp;CN&amp;%2:9QNO]-))5ZH
M&lt;]9.!^/DQ/8X-V[@@#,AS0ZE+KB7R$ODA\:A26@&gt;6H2FH9D?J17^)(I#3C@8
MLD)V?:(^"BE.AN30,F0XK\(Y5UUVW0TW77/'W;H_;JM6HRJ1&amp;95%M0Y'E5%5
.5.U4]""JB&lt;K_`B&gt;`?E$`
EOT

undef,
undef,
undef,
&lt;&lt;'EOT',
M&gt;)RES[=/%```1O$WO8G_@$'J';W70Z2WHS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
M(OX!?T/"`0&lt;=&lt;MB1$Q?R0KXIDB%NK?TVV&amp;B3S:?RG)`;]?&lt;\YWDO&gt;-$T+WG9
M*U[UFNEF&gt;%V]X4TSO666V=[VCG?-,==[WC?/?!_XT&amp;#,N`466F3"8DLLM&lt;QR
M*ZRTRFIK(GJ=]?_Y+;;:]N\HI(&gt;LD&amp;W2#COMLML&gt;&gt;^V+=IX\2&lt;7BCCGNA)-.
0.&gt;V,L\XY[P*'[!\#D^='L@``
EOT

undef,
undef,
undef,
undef,
undef,
undef,
undef,
undef,
undef,
);

$cp_1252 = (
&lt;&lt;'EOT',
M&gt;)P-SD-B'5```,#YJ6VE&gt;DEM&amp;[\VD]JVF?H./4'-U+93V[9M:SV;$141(Y74
MTD@KG?0RR"B3S++(*IOL&lt;L@IE]SRR"N?_`J(55`AA1515!`G7C'%E5!2*:65
M458YY550426555%5-=754%,MM=515SWU-=!05".--=%4,\VUT%(KK;715COM
M==!1)YTE2-1%5]UTUT-/O?361U_]]#?`0(,,-L10PPPWPDBCC#;&amp;6..,-\%$
MDTPVQ5333)=DAIEFF6V.N&gt;:%9-$0&amp;YD?BH22(82XF)10.3(@U(DDB$;F_/]%
M0_Y0(!0*A4-\R!5RQ]R*BX\,#'4CB?]];B3)`@LMLM@22RVSW`HKK;):LC76
M6F&gt;]#3;:9+,MMMIFNQUVVF6W/?;:9[\##CKDL"-2''7,&lt;2&gt;&lt;=,II9YQUSGD7
M7'3)95=&lt;=&lt;UU-]QTRVUWW'7/?0\\],AC3SSUS',OO/3*:V^\]&lt;Y['WSTR6=?
1?/7-=S_\],MO?_S]!Y==&gt;0@`
EOT
);
#'

@ms_langids = ( [""],
    ['ar', ["-SA", "-IQ", "-EG", "-LY", "-DZ", "-MA", "-TN", 
            "-OM", "-YE", "-SY", "-JO", "-LB", "-KW", "-AE",
            "-BH", "-QA"]],
    ['bg-BG'],
    ['ca-ES'],
    ['zh', ['-TW', 'CN', '-HK', '-SG', '-MO']],
    ["cs-CZ"],
    ["da-DK"],
    ["de", ["-DE", "-CH", "-AT", "-LU", "-LI"]],
    ["el-GR"],
    ["en", ["-US", "-UK", "-AU", "-CA", "-NZ", "-IE", "-ZA",
            "-JM", "029", "-BZ", "-TT", "-ZW", "-PH", "-ID",
            "-HK", "-IN", "-MY", "-SG"]],
    ["es", ["-ES", "-MX", "-ES", "-GT", "-CR", "-PA", "-DO",
            "-VE", "-CO", "-PE", "-AR", "-EC", "-CL", "-UY",
            "-PY", "-BO", "-SV", "-HN", "-NI", "-PR", "-US"]],
    ["fi-FI"],
    ["fr", ["-FR", "-BE", "-CA", "-CH", "-LU", "-MC", "",
            "-RE", "-CG", "-SN", "-CM", "-CI", "-ML", "-MA",
            "-HT"]],
    ["he-IL"],
    ["hu-HU"],
    ["is-IS"],
# 0010
    ["it", ["-IT", "-CH"]],
    ["ja-JP"],
    ["ko-KR"],
    ["nl", ["-NL", "-BE"]],
    ["no", ["-bok-NO", "-nyn-NO"]],
    ["pl-PL"],
    ["pt", ["-BR", "-PT"]],
    ["rm-CH"],
    ["ro", ["-RO", "_MD"]],
    ["ru-RU"],
    ["hr", ["-HR", "-Latn-CS", "Cyrl-CS", "-BA", "", "-Latn-BA", "-Cyrl-BA"]],
    ["sk-SK"],
    ["sq-AL"],
    ["sv", ["-SE", "-FI"]],
    ["th-TH"],
    ["tr-TR"],
# 0020
    ["ur", ["-PK", "tr-IN"]],
    ["id-ID"],
    ["uk-UA"],
    ["be-BY"],
    ["sl-SL"],
    ["et-EE"],
    ["lv-LV"],
    ["lt-LT"],
    ["tg-Cyrl-TJ"],
    ["fa-IR"],
    ["vi-VN"],
    ["hy-AM"],
    ["az", ["-Latn-AZ", "-Cyrl-AZ"]],
    ["eu-ES"],
    ["wen". ["wen-DE", "dsb-DE"]],
    ["mk-MK"],
# 0030
    ["st"],
    ["ts"],
    ["tn-ZA"],
    ["ven"],
    ["xh-ZA"],
    ["zu-ZA"],
    ["af-ZA"],
    ["ka-GE"],
    ["fo-FO"],
    ["hi-IN"],
    ["mt"],
    ["se", ["-NO", "-SE", "-FI", "smj-NO", "smj-SE", "sma-NO", "sma-SE",
            "", "smn-FI"]],
    ["ga-IE"],
    ["yi"],
    ["ms", ["-MY", "-BN"]],
    ["kk-KZ"],
# 0040
    ["ky-KG"],
    ["sw-KE"],
    ["tk-TM"],
    ["uz", ["-Latn-UZ", "-Cyrl-UZ"]],
    ["tt-RU"],
    ["bn", ["-IN", "-BD"]],
    ["pa", ["-IN", "-Arab-PK"]],
    ["gu-IN"],
    ["or-IN"],
    ["ta-IN"],
    ["te-IN"],
    ["kn-IN"],
    ["ml-IN"],
    ["as-IN"],
    ["mr-IN"],
    ["sa-IN"],
# 0050
    ["mn", ["-Cyrl-MN", "-Mong-CN"]],
    ["bo", ["-CN", "-BT"]],
    ["cy-GB"],
    ["km-KH"],
    ["lo-LA"],
    ["my"],
    ["gl-ES"],
    ["kok-IN"],
    ["mni"],
    ["sd", ["-IN", "-PK"]],
    ["syr-SY"],
    ["si-LK"],
    ["chr"],
    ["iu", ["-Cans-CA", "-Latn-CA"]],
    ["am-ET"],
    ["tmz", ["-Arab", "tmz-Latn-DZ"]],
# 0060
    ["ks"],
    ["ne", ["-NP", "-IN"]],
    ["fy-NL"],
    ["ps-AF"],
    ["fil-PH"],
    ["dv-MV"],
    ["bin-NG"],
    ["fuv-NG"], 
    ["ha-Latn-NG"],
    ["ibb-NG"],
    ["yo-NG"],
    ["quz", ["-BO", "-EC", "-PE"]],
    ["ns-ZA"],
    ["ba-RU"],
    ["lb-LU"],
    ["kl-GL"],
# 0070
    ["ig-NG"],
    ["kau"],
    ["om"],
    ["ti", ["-ET". "-ER"]],
    ["gn"],
    ["haw"],
    ["la"],
    ["so"],
    ["ii-CN"],
    ["pap"],
    ["arn-CL"],
    [""],           # (unassigned)
    ["moh-CA"],
    [""],           # (unassigned)
    ["br-FR"],
    [""],           # (unassigned)
# 0080
    ["ug-CN"],
    [""],           # (unassigned)
    ["oc-FR"],
    ["gsw-FR"],
    [""],           # (unassigned)
    ["sah-RU"],
    ["qut-GT"],
    ["rw-RW"],
    ["wo-SN"],
    [""],           # (unassigned)
    [""],           # (unassigned)
    [""],           # (unassigned)
    ["gbz-AF"],
);

@mac_langs = (
    'en', 'fr', 'de', 'it', 'nl', 'sv', 'es', 'da', 'pt', 'no',
    'he', 'ja', 'ar', 'fi', 'el', 'is', 'mt', 'tr', 'hr', 'zh-Hant',
    'ur', 'hi', 'th', 'ko', 'lt', 'pl', 'hu', 'et', 'lv', 'se',
    'fo', 'ru' ,'zh-Hans', 'nl', 'ga', 'sq', 'ro', 'cs', 'sk',
    'sl', 'yi', 'sr', 'mk', 'bg', 'uk', 'be', 'uz', 'kk', 'az-Cyrl',
    'az-Latn', 'hy', 'ka', 'mo', 'ky', 'abh', 'tuk', 'mn-Mong', 'mn-Cyrl', 'pst',
    'ku', 'ks', 'sd', 'bo', 'ne', 'sa', 'mr', 'bn', 'as', 'gu',
    'pa', 'or', 'ml', 'kn', 'ta', 'te', 'si', 'my', 'km', 'lo',
    'vi', 'id', 'tl', 'ms-Latn', 'ms-Arab', 'am', 'ti', 'tga', 'so', 'sw',
    'rw', 'rn', 'ny', 'mg', 'eo', '', '', '', '', '',
    '', '', '', '', '', '', '', '', '', '',
    '', '', '', '', '', '', '', '', '', '',
    '', '', '', '', '', '', '', '', 'cy', 'eu',
    'la', 'qu', 'gn', 'ay', 'tt', 'ug', 'dz', 'jv-Latn', 'su-Latn',
    'gl', 'af', 'br', 'iu', 'gd', 'gv', 'gd-IR-x-dotabove', 'to', 'el-polyton', 'kl',
    'az-Latn'
);

}

1;

=head1 BUGS

=over 4

=item *

Unicode type strings will be stored in utf8 for all known platforms,
once Perl 5.6 has been released and I can find all the mapping tables, etc.

=back

=head1 AUTHOR

Martin Hosken Martin_Hosken@sil.org. See L&lt;Font::TTF::Font&gt; for copyright and
licensing.

=cut

</pre></body></html>