MAJOR=4
MINOR=30
DEVNAME=tty30
     §ˆÏÎÕ538ÍÀÓ     §‹      Õ–_oÚ0Åßû)<?ìnøSim�LAD™¦iÚƒ‰�Ä#‰#ûÊ>ýƒMEë&MQŽãã“ûsâÄìU8,>Í†äýâaLfÞ�GB[ {€p6ý¶×N(¡)by°ÙlÚ›^[›sH1Ïú`Ñ¨Û®X}-¸",•\¸3a¨0“Á¨ò‰è˜€®Ð*!ûPY6åFÂZåõqãAÉ£et‰š±.öql©Å¶¾Kç/ÝÀ]Q|¹®¥	¦dÍ3•>E]Ò€©<!ÖD>éÂÂ2ãÅª�¨˜ž¡O?�Ó/Î˜Ö£ÆIjdìÓ·r7õïi0á¹dÀŸ÷<4ž1·Hr-T¬¤8k~tæ��êÛùÀ°	¥�Œ*Qéâh‡xŠéÌ–Ü±^;‚Ôœº‹øÝl¸9=�ŒÙý|8Y„£y3%¢Ž8V÷ÒçCƒ™ë*�„ÊÈµÙîš¼×ÅÒ–w‡&ÙhT’"i‘g�@ëLHsÊuŽ(ŠU†Ò¸Šê´Ò_JëzÝ^Ë»iuß�Îõ­çò_0ˆµ6|åöâò¤P(ŸÜ›£ŠÄqüÔ¼<š¯•«<Þ:�ƒº<†œc”ªz%Ôå1ØTfY.‹ÊQõrlx™ëÊÊšã‡¾<÷uÍ…\Võ?êÏñÂÿ%ìwv;Íþç;fe>b	    3   ©ˆl–Ðz¾”d
i?u8 \¸Ó× 1hßŽþY‘gÁb?Ÿ×61ÖÁÔ  =    ©I:5711052
E:ID_VENDOR_FROM_DATABASE=The Linux Foundation
V:1
  7   «ˆl–ßi~” ”Ð?Je@‚ãn\ªbÑ¿�þ\ Y¹G$}¢·)üÿØ„®6ï×ÂÕ ?÷     «#!/usr/bin/perl
# Debian required shebang above
# Original shebang below
# #! /usr/bin/env perl

=begin COPYRIGHT

----------------------------------------------------------------------------

    Copyright (C) 2005-2022 Marc Penninga.

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation, either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to
        Free Software Foundation, Inc.,
        59 Temple Place,
        Suite 330,
        Boston, MA 02111-1307,
        USA

----------------------------------------------------------------------------

=end COPYRIGHT

=cut

use strict;
use warnings;

use integer;
use Getopt::Long ();
use List::Util @List::Util::EXPORT_OK;
use Pod::Usage;

my $VERSION = "20220124";

our ($NUM_GLYPHS, $UNITS_PER_EM, %kern);

sub main {
    %ARGV = (
        print_func  =>  \&print_kpx,
    );

    Getopt::Long::GetOptions(
        'help|?'    =>  sub { pod2usage(-verbose => 0) },
        'version'   =>  sub { print "$VERSION\n"; exit },
        'doc'       =>  sub { pod2usage(-verbose => 2) },
        'afm'       =>  sub { $ARGV{print_func} = \&print_kpx },
        'kpx'       =>  sub { $ARGV{print_func} = \&print_kpx },
        'lua'       =>  sub { $ARGV{print_func} = \&print_lua },
    ) or pod2usage(-verbose => 0);
    pod2usage(-verbose => 0) if @ARGV != 1;

    my %font = OTF::get_tables($ARGV[0]);

    $NUM_GLYPHS = unpack '@4n', $font{maxp};
    $UNITS_PER_EM = unpack '@18n', $font{head};

    my @glyph_name = map { sprintf "index%d", $_ } 0 .. $NUM_GLYPHS - 1;
    if (defined $font{CFF}) {
        OTF::CFF::get_glyph_names($font{CFF}, \@glyph_name);
    }

    if (defined $font{kern}) {
        OTF::Kern::parse_kerntable($font{kern});
    }

    if (defined $font{GPOS}) {
        my @lookup_list_indices
            = OTF::GPOS::get_lookup_list_indices($font{GPOS});
        my @all_lookups = OTF::GPOS::get_lookups($font{GPOS});
        my @lookups = @all_lookups[@lookup_list_indices];
        my @subtables = map { OTF::GPOS::get_subtables($_) } @lookups;

        for my $subtable (@subtables) {
            my $pos_format = unpack 'n', $subtable;
            if ($pos_format == 1) {
                OTF::GPOS::parse_pos_format_1($subtable);
            }
            elsif ($pos_format == 2) {
                OTF::GPOS::parse_pos_format_2($subtable);
            }
            else {
                warn "[ERROR] invalid PosFormat $pos_format ignored";
            }
        }
    }

    &{$ARGV{print_func}}( \%kern, \@glyph_name );
    return;
}

# ------------------------------------------------------------------------
# Print kerning data in Adobe's KPX format
# ------------------------------------------------------------------------
sub print_kpx {
    my %kern = %{ shift @_ };
    my @glyph = @{ sh