package Font::TTF::Vmtx;

=head1 NAME

Font::TTF::Vmtx - Vertical Metrics


Contains the advance height and top side bearing for each glyph. Given the
compressability of the data onto disk, this table uses information from
other tables, and thus must do part of its output during the output of
other tables


The vertical metrics are kept in two arrays by glyph id. The variable names
do not start with a space

=over 4

=item advance

An array containing the advance height for each glyph

=item top

An array containing the top side bearing for each glyph


=head1 METHODS


use strict;
use vars qw(@ISA);
require Font::TTF::Hmtx;

@ISA = qw(Font::TTF::Hmtx);

=head2 $t->read

Reads the vertical metrics from the TTF file into memory


sub read
    my ($self) = @_;
    my ($numh, $numg);

    $numh = $self->{' PARENT'}{'vhea'}->read->{'numberOfVMetrics'};
    $numg = $self->{' PARENT'}{'maxp'}{'numGlyphs'};
    $self->_read($numg, $numh, "advance", "top");

=head2 $t->out($fh)

Writes the metrics to a TTF file. Assumes that the C<vhea> has updated the
numVMetrics from here


sub out
    my ($self, $fh) = @_;
    my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'};
    my ($numh) = $self->{' PARENT'}{'vhea'}{'numberOfVMetrics'};
    $self->_out($fh, $numg, $numh, "advance", "top");


=head1 BUGS

None known

=head1 AUTHOR

Martin Hosken L<>. 


Copyright (c) 1998-2016, SIL International ( 

This module is released under the terms of the Artistic License 2.0. 
For details, see the full text of the license in the file LICENSE.