| 1 | package Font::TTF::Cvt_; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | Font::TTF::Cvt_ - Control Value Table in a TrueType font | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | This is a minimal class adding nothing beyond a table, but is a repository | ||||||||||||||||||||||||||||
| 10 | for cvt type information for those processes brave enough to address hinting. | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =head1 INSTANCE VARIABLES | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | =over 4 | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =item val | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | This is an array of CVT values. Thus access to the CVT is via: | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | $f->{'cvt_'}{'val'}[$num]; | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | =back | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | =head1 METHODS | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | =cut | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 29 | 1 | ▶ | use vars qw(@ISA $VERSION); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 30 | 1 | ▶ | use Font::TTF::Utils; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 1 | @ISA = qw(Font::TTF::Table); | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | $VERSION = 0.0001; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head2 $t->read | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | Reads the CVT table into both the tables C<' dat'> variable and the C<val> | ||||||||||||||||||||||||||||
| 39 | array. | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =cut | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | sub read | ||||||||||||||||||||||||||||
| 44 | 2 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
read: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 45 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 2 | ▶ | $self->read_dat || return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 2 | $self->{' read'} = 1; | |||||||||||||||||||||||||||
| 49 | 2 | $self->{'val'} = [TTF_Unpack("s*", $self->{' dat'})]; | |||||||||||||||||||||||||||
| 50 | 2 | $self; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | =head2 $t->update | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | Updates the RAM file copy C<' dat'> to be the same as the array. | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =cut | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | sub update | ||||||||||||||||||||||||||||
| 61 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 62 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 0 | ▶ | return undef unless ($self->{' read'} && $#{$self->{'val'}} >= 0); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{" read"} and $#{$$self{"val"};} >= 0
MC/DC0%0/2
$self->{" read"} and $#{$$self{"val"};} >= 0
$self->{" read"}
$#{$$self{"val"};} >= 0
Truth table0%0/3
A and B
A= $self->{" read"}B= $#{$$self{"val"};} >= 0
| |||||||||||||||||||||||||||||
| 65 | 0 | $self->{' dat'} = TTF_Pack("s*", @{$self->{'val'}}); | |||||||||||||||||||||||||||
| 66 | 0 | $self; | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 1 | 1; | |||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | =head1 BUGS | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | None known | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | Martin Hosken L<http://scripts.sil.org/FontUtils>. | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | =head1 LICENSING | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | Copyright (c) 1998-2016, SIL International (http://www.sil.org) | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | This module is released under the terms of the Artistic License 2.0. | ||||||||||||||||||||||||||||
| 85 | For details, see the full text of the license in the file LICENSE. | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | =cut | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||