Font::TTF::Silf(3)
π Font::TTF::Silf: the main Graphite table, bestie edition π
Okay so this is the Font::TTF::Silf(3) page, coming at you from the User Contributed Perl Documentation corner of the universe. Grab a boba π§ because this is the main Graphite table and it has layers, no cap.
π¦ NAME π¦
Font::TTF::Silf β the main Graphite table. That's the whole vibe. β¨
πΈ DESCRIPTION πΈ
The Silf table holds the core of the Graphite rules for a font. A Silf table has potentially multiple silf subtables, although there is usually only one. Within a silf subtable, there are a number of passes which contain the actual finite state machines to match rules and the constraint and action code to be executed when a rule matches.
Like, that's the whole plot: rules live here, passes do the matching, and the constraint/action code jumps in when a rule hits. Periodt. π
π INSTANCE VARIABLES π
Here's the full cast β every single one, because we don't skip anyone. π«Ά
Versionβ Silf table format version. πCompilerβ Lowest compiler version necessary to fully support the semantics expressed in this Graphite description. Ngl, it's the "you need at least this compiler" tea.SILFβ An array of Silf subtables. Potentially multiple, even if usually just one. πmaxGlyphIDβ The maximum glyph id referenced including pseudo and non glyphs.Ascentβ Extra ascent to be added to the font ascent.Descentβ Extra descent to be added to the font descent. Both values are assumed to be positive for a descender below the base line.substPassβ Pass index intoPASSof the first substitution pass.posPassβ Pass index intoPASSof the first positioning pass.justPassβ Pass index intoPASSof the first justification pass.bidiPassβ Pass index of the pass before which the bidirectional processing pass will be executed.0xFFindicates that there is no bidi pass to be executed.Flagsβ A bitfield of flags:0β Indicates there are line end contextual rules in one of the passes.
maxPreContextβ Maximum length of a context preceding a cross line boundary contextualisation.maxPostContextβ Maximum length of a context following a cross line boundary contextualisation.attrPseudoβ Glyph attribute for the actual glyph id associated with a pseudo glyph.attrBreakWeightβ Glyph attribute number of the attribute holding the default breakweight associated with a glyph.attrDirectionalityβ Glyph attribute number of the attribute holding the default directionality value associated with a glyph.JUSTβ There may be a number of justification levels each with their own property values. This points to an array of hashes, one for each justification level.attrStretchβ Glyph attribute number for the amount of stretch allowed before this glyph.attrShrinkβ Glyph attribute number for the amount of shrink allowed before this glyph.attrStepβ Glyph attribute number specifying the minimum granularity of actual spacing associated with this glyph at this level.attrWeightβ Glyph attribute number giving the weight associated with spreading space across a run of glyphs.runtoβ Which level starts the next stage.
numLigCompβ Number of initial glyph attributes that represent ligature components.numUserAttrβ Number of user defined slot attributes referenced. Tells the engine how much space to allocate to a slot for user attributes.maxCompPerLigβ Maximum number of components per ligature.directionβ Supported directions for this writing system.CRIT_FEATUREβ Array of critical features.scriptsβ Array of script tags that indicate which set of GDL rules to execute if there is more than one in a font.lbGIDβ Glyph ID of the linebreak pseudo glyph.pseudosβ Hash of Unicode values to pseudo glyph ids.classesβ This is an array of classes, each of which is an array of glyph ids in class order.PASSβ The details of rules and actions are stored in passes. This value is an array of pass subobjects one for each pass.flagsβ This is a bitfield:0β If true, this pass makes no change to the slot stream considered as a sequence of glyph ids. Only slot attributes are expected to change (for example during positioning).
maxRuleLoopβ How many times the engine will allow rules to be tested and run without the engine advancing through the input slot stream.maxRuleContextβ Number of slots of input needed to run this pass.maxBackupβ Number of slots by which the following pass needs to trail this pass (i.e. the maximum this pass is allowed to back up).numRulesβ Number of action code blocks, and so uncompressed rules, in this pass.numRowsβ Number of rows in the finite state machine.numTransitionalβ Number of rows in the finite state machine that are not final states. This specifies the number of rows in thefsmelement.numSuccessβ Number of success states. A success state may also be a transitional state.numColumnsβ Number of columns in the finite state machine.colmapβ A hash, indexed by glyphid, that gives the fsm column number associated with that glyphid. If not present, then the glyphid is not part of the fsm and will finish fsm processing if it occurs.rulemapβ An array of arrays, one for each success state. Each array holds a list of rule numbers associated with that state.minRulePreContextβ Minimum number of items in a rule's precontext.maxRulePreContextβ The maximum number of items in any rule's precontext.startStatesβ Array of starting state numbers depending on the length of actual precontext. There aremaxRulePreContext - minRulePreContext + 1of these.ruleSortKeysβ An array of sort keys one for each rule giving the length of the rule including its precontext.rulePreContextsβ An array of precontext lengths for each rule.fsmβ A two dimensional array such that$p->{'fsm'}[$row][$col]gives the row of the next node to try in the fsm.passConstraintLenβ Length in bytes of thepassConstraintcode.passConstraintCodeβ A byte string holding the pass constraint code.constraintCodeβ An array of byte strings holding the constraint code for each rule.actionCodeβ An array of byte strings holding the action code for each rule.
π @opcodes π
Each array holds the name of the opcode, the number of operand bytes and a string describing the operands. The characters in the string have the following meaning:
cβ lsb of class idCβ msb of class idfβ feature indexgβ lsb of glyph attribute idGβ msb of glyph attribute idlβ lsb of a 32-bit extension to a 16-bit numberLβ msb of a 32-bit numbermβ glyph metric idnβ lsb of a numberNβ msb of a 16-bit numberoβ offset (jump)sβ slot referenceSβ slot attribute idvβ variable number of following arguments
π§ read π§
Reads the Silf table into the internal data structure. Literally bringing the Silf tea inside. π
π¦ out π¦
Outputs a Silf data structure to a font file in binary format. Binary moment, iconic. β¨
π $t->minsize() π
Returns the minimum size this table can be. If it is smaller than this, then the table must be bad and should be deleted or whatever. Ngl, if it's under minsize, it's giving broken β delete or whatever. π
π AUTHOR π
Martin Hosken <http://scripts.sil.org/FontUtils>. Stan. π«Ά
π LICENSING π
Copyright (c) 1998-2016, SIL International (http://www.sil.org)
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.
Catch you later π
β from perl v5.42.0, dated 2016-08-28, this was Font::TTF::Silf(3). Stay slay, bestie. π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Font-TTF 1.06-bp160.1.12 Β· Artistic-2.0 and OFL-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms