Font::TTF::LTSH - Linear Threshold table


Font-TTF documentation Contained in the Font-TTF distribution.

Index


Code Index:

NAME

Top

Font::TTF::LTSH - Linear Threshold table

DESCRIPTION

Top

Holds the linear threshold for each glyph. This is the ppem value at which a glyph's metrics become linear. The value is set to 1 if a glyph's metrics are always linear.

INSTANCE VARIABLES

Top

glyphs

An array of ppem values. One value per glyph

METHODS

Top

$t->read

Reads the table

$t->out($fh)

Outputs the LTSH to the given fh.

BUGS

Top

None known

AUTHOR

Top

Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright and licensing.


Font-TTF documentation Contained in the Font-TTF distribution.
package Font::TTF::LTSH;

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

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

sub read
{
    my ($self) = @_;
    my ($fh) = $self->{' INFILE'};
    my ($numg, $dat);

    $self->SUPER::read or return $self;

    $fh->read($dat, 4);
    ($self->{'Version'}, $numg) = unpack("nn", $dat);
    $self->{'Num'} = $numg;

    $fh->read($dat, $numg);
    $self->{'glyphs'} = [unpack("C$numg", $dat)];
    $self;
}


sub out
{
    my ($self, $fh) = @_;
    my ($numg) = $self->{' PARENT'}{'maxp'}{'numGlyphs'};

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

    $fh->print(pack("nn", 0, $numg));
    $fh->print(pack("C$numg", @{$self->{'glyphs'}}));
    $self;
}
    

1;