| 1 | package Font::TTF::Features::Sset; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Font::TTF::Features::Sset - Class for Stylistic Set Feature Parameters | ||
| 6 | |||
| 7 | =head1 DESCRIPTION | ||
| 8 | |||
| 9 | Handles the Feature Parameters valus for Stylistic Sets | ||
| 10 | |||
| 11 | =head1 INSTANCE VARIABLES | ||
| 12 | |||
| 13 | =over 4 | ||
| 14 | |||
| 15 | =item INFILE | ||
| 16 | |||
| 17 | The read file handle | ||
| 18 | |||
| 19 | =item OFFSET | ||
| 20 | |||
| 21 | Location of the file in the input file | ||
| 22 | |||
| 23 | =item Version | ||
| 24 | |||
| 25 | The minor version number, currently always 0 | ||
| 26 | |||
| 27 | =item UINameID | ||
| 28 | |||
| 29 | The 'name' table name ID that specifies a string (or strings, for multiple | ||
| 30 | languages) for a user-interface label for this feature | ||
| 31 | |||
| 32 | =back | ||
| 33 | |||
| 34 | =head1 METHODS | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | use Font::TTF::Utils; | ||
| 39 | use strict; | ||
| 40 | |||
| 41 | =head2 $t->read | ||
| 42 | |||
| 43 | Reads the Feature Params | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | sub read | ||
| 48 | { | ||
| 49 | my ($self) = @_; | ||
| 50 | my ($fh) = $self->{' INFILE'}; | ||
| 51 | my ($off) = $self->{' OFFSET'}; | ||
| 52 | my $dat; | ||
| 53 | $fh->seek($off, 0); | ||
| 54 | $fh->read($dat, 4); | ||
| 55 | ($self->{'Version'}, $self->{'UINameID'}) = TTF_Unpack("SS", $dat); | ||
| 56 | |||
| 57 | return $self; | ||
| 58 | } | ||
| 59 | |||
| 60 | =head2 $t->out($fh) | ||
| 61 | |||
| 62 | Writes the FeatureParams table to the output | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | sub out | ||
| 67 | { | ||
| 68 | my ($self, $fh) = @_; | ||
| 69 | $fh->print(TTF_Pack("S", $self->{'Version'})); | ||
| 70 | $fh->print(TTF_Pack("S", $self->{'UINameID'})); | ||
| 71 | $self; | ||
| 72 | } | ||
| 73 | |||
| 74 | =head2 Font::TTF::Features::Sset->new() | ||
| 75 | |||
| 76 | Creates a new FeatureParams object. | ||
| 77 | Values for INFILE and OFFSET canbe passed as parameters | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | sub new | ||
| 82 | { | ||
| 83 | my ($class,%parms) = @_; | ||
| 84 | my ($self) = {}; | ||
| 85 | my ($p); | ||
| 86 | foreach $p (keys %parms) | ||
| 87 | { $self->{" $p"} = $parms{$p}; } | ||
| 88 | bless $self, $class; | ||
| 89 | } | ||
| 90 | |||
| 91 | sub out_xml | ||
| 92 | { | ||
| 93 | } | ||
| 94 | |||
| 95 | 1; | ||
| 96 | |||
| 97 | =head1 AUTHOR | ||
| 98 | |||
| 99 | David Raymond L<http://scripts.sil.org/FontUtils>. | ||
| 100 | |||
| 101 | =head1 LICENSING | ||
| 102 | |||
| 103 | Copyright (c) 1998-2016, SIL International (http://www.sil.org) | ||
| 104 | |||
| 105 | This module is released under the terms of the Artistic License 2.0. | ||
| 106 | For details, see the full text of the license in the file LICENSE. | ||
| 107 | |||
| 108 | =cut |