.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Font::TTF::GPOS 3pm" .TH Font::TTF::GPOS 3pm "2022-06-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Font::TTF::GPOS \- Support for Opentype GPOS tables in conjunction with TTOpen .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \s-1GPOS\s0 table is one of the most complicated tables in the \s-1TTF\s0 spec and the corresponding data structure abstraction is also not trivial. While much of the structure of a \s-1GPOS\s0 is shared with a \s-1GSUB\s0 table via the Font::TTF::Ttopen .SH "INSTANCE VARIABLES" .IX Header "INSTANCE VARIABLES" Here we describe the additions and lookup specific information for \s-1GPOS\s0 tables. Unfortunately there is no one abstraction which seems to work comfortable for all \s-1GPOS\s0 tables, so we will also examine how the variables are used for different lookup types. .PP The following are the values allowed in the \s-1ACTION_TYPE\s0 and \s-1MATCH_TYPE\s0 variables: .IP "\s-1ACTION_TYPE\s0" 4 .IX Item "ACTION_TYPE" This can take any of the following values .RS 4 .IP "a" 8 .IX Item "a" The \s-1ACTION\s0 is an array of anchor tables .IP "o" 8 .IX Item "o" Offset. There is no \s-1RULE\s0 array. The \s-1ADJUST\s0 variable contains a value record (see later in this description) .IP "v" 8 .IX Item "v" The \s-1ACTION\s0 is a value record. .IP "p" 8 .IX Item "p" Pair adjustment. The \s-1ACTION\s0 contains an array of two value records for the matched two glyphs. .IP "e" 8 .IX Item "e" Exit and Entry records. The \s-1ACTION\s0 contains an array of two anchors corresponding to the exit and entry anchors for the glyph. .IP "l" 8 .IX Item "l" Indicates a lookup based contextual rule as per the \s-1GSUB\s0 table. .RE .RS 4 .RE .IP "\s-1MATCH_TYPE\s0" 4 .IX Item "MATCH_TYPE" This can take any of the following values .RS 4 .IP "g" 8 .IX Item "g" A glyph array .IP "c" 8 .IX Item "c" An array of class values .IP "o" 8 .IX Item "o" An array of coverage tables .RE .RS 4 .RE .PP The following variables are added for Attachment Positioning Subtables: .IP "\s-1MATCH\s0" 4 .IX Item "MATCH" This contains an array of glyphs to match against for all \s-1RULES.\s0 It is much like having the same \s-1MATCH\s0 string in all \s-1RULES.\s0 In the cases it is used so far, it only ever contains one element. .IP "\s-1MARKS\s0" 4 .IX Item "MARKS" This contains a Mark array consisting of each element being a subarray of two elements: .RS 4 .IP "\s-1CLASS\s0" 8 .IX Item "CLASS" The class that this mark uses on its base .IP "\s-1ANCHOR\s0" 8 .IX Item "ANCHOR" The anchor with which to attach this mark glyph .RE .RS 4 .Sp The base table for mark to base, ligature or mark attachment positioning is structured with the \s-1ACTION\s0 containing an array of anchors corresponding to each attachment class. For ligatures, there is more than one \s-1RULE\s0 in the \s-1RULE\s0 array corresponding to each glyph in the coverage table. .RE .PP Other variables which are provided for informational purposes are: .IP "\s-1VFMT\s0" 4 .IX Item "VFMT" Value format for the adjustment of the glyph matched by the coverage table. .IP "\s-1VFMT2\s0" 4 .IX Item "VFMT2" Value format used in pair adjustment for the second glyph in the pair .SS "Value Records" .IX Subsection "Value Records" There is a subtype used in \s-1GPOS\s0 tables called a value record. It is used to adjust the position of a glyph from its default position. The value record is variable length with a bitfield at the beginning to indicate which of the following entries are included. The bitfield is not stored since it is recalculated at write time. .IP "XPlacement" 4 .IX Item "XPlacement" Horizontal adjustment for placement (not affecting other unattached glyphs) .IP "YPlacement" 4 .IX Item "YPlacement" Vertical adjustment for placement (not affecting other unattached glyphs) .IP "XAdvance" 4 .IX Item "XAdvance" Adjust the advance width glyph (used only in horizontal writing systems) .IP "YAdvance" 4 .IX Item "YAdvance" Adjust the vertical advance (used only in vertical writing systems) .IP "XPlaDevice" 4 .IX Item "XPlaDevice" Device table for device specific adjustment of horizontal placement .IP "YPlaDevice" 4 .IX Item "YPlaDevice" Device table for device specific adjustment of vertical placement .IP "XAdvDevice" 4 .IX Item "XAdvDevice" Device table for device specific adjustment of horizontal advance .IP "YAdDevice" 4 .IX Item "YAdDevice" Device table for device specific adjustment of vertical advance .IP "XIdPlacement" 4 .IX Item "XIdPlacement" Horizontal placement metric id (for Multiple Master fonts \- but that is all I know!) .IP "YIdPlacement" 4 .IX Item "YIdPlacement" Vertical placement metric id .IP "XIdAdvance" 4 .IX Item "XIdAdvance" Horizontal advance metric id .IP "YIdAdvance" 4 .IX Item "YIdAdvance" Vertical advance metric id .SH "CORRESPONDANCE TO LAYOUT TYPES" .IX Header "CORRESPONDANCE TO LAYOUT TYPES" Here is what is stored in the \s-1ACTION_TYPE\s0 and \s-1MATCH_TYPE\s0 for each of the known \&\s-1GPOS\s0 subtable types: .PP .Vb 3 \& 1.1 1.2 2.1 2.2 3 4 5 6 7.1 7.2 7.3 8.1 8.2 8.3 \& ACTION_TYPE o v p p e a a a l l l l l l \& MATCH_TYPE g c g c o g c o .Ve .SH "METHODS" .IX Header "METHODS" .SS "read_sub" .IX Subsection "read_sub" Reads the subtable into the data structures .ie n .SS "$t\->extension" .el .SS "\f(CW$t\fP\->extension" .IX Subsection "$t->extension" Returns the table type number for the extension table .ie n .SS "$t\->out_sub" .el .SS "\f(CW$t\fP\->out_sub" .IX Subsection "$t->out_sub" Outputs the subtable to the given filehandle .ie n .SS "$t\->read_value($format, $base, $lookup, $fh)" .el .SS "\f(CW$t\fP\->read_value($format, \f(CW$base\fP, \f(CW$lookup\fP, \f(CW$fh\fP)" .IX Subsection "$t->read_value($format, $base, $lookup, $fh)" Reads a value record from the current location in the file, according to the format given. .ie n .SS "$t\->read_delta($offset, $base, $lookup, $fh)" .el .SS "\f(CW$t\fP\->read_delta($offset, \f(CW$base\fP, \f(CW$lookup\fP, \f(CW$fh\fP)" .IX Subsection "$t->read_delta($offset, $base, $lookup, $fh)" Reads a delta (device table) at the given offset if it hasn not already been read. Store the offset and item in the lookup cache ($lookup\->{' \s-1CACHE\s0'}) .ie n .SS "$t\->read_anchor($offset, $base, $lookup, $fh)" .el .SS "\f(CW$t\fP\->read_anchor($offset, \f(CW$base\fP, \f(CW$lookup\fP, \f(CW$fh\fP)" .IX Subsection "$t->read_anchor($offset, $base, $lookup, $fh)" Reads an Anchor table at the given offset if it has not already been read. .ie n .SS "$t\->fmt_value" .el .SS "\f(CW$t\fP\->fmt_value" .IX Subsection "$t->fmt_value" Returns the value format for a given value record .ie n .SS "$t\->out_value" .el .SS "\f(CW$t\fP\->out_value" .IX Subsection "$t->out_value" Returns the output string for the outputting of the value for a given format. Also updates the offset cache for any device tables referenced. .SH "AUTHOR" .IX Header "AUTHOR" Martin Hosken . .SH "LICENSING" .IX Header "LICENSING" Copyright (c) 1998\-2016, \s-1SIL\s0 International (http://www.sil.org) .PP 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 \s-1LICENSE.\s0