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 into PASS of the first substitution pass.
    • posPass β€” Pass index into PASS of the first positioning pass.
    • justPass β€” Pass index into PASS of the first justification pass.
    • bidiPass β€” Pass index of the pass before which the bidirectional processing pass will be executed. 0xFF indicates 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 the fsm element.
      • 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 are maxRulePreContext - minRulePreContext + 1 of 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 the passConstraint code.
      • 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 id
  • C β€” msb of class id
  • f β€” feature index
  • g β€” lsb of glyph attribute id
  • G β€” msb of glyph attribute id
  • l β€” lsb of a 32-bit extension to a 16-bit number
  • L β€” msb of a 32-bit number
  • m β€” glyph metric id
  • n β€” lsb of a number
  • N β€” msb of a 16-bit number
  • o β€” offset (jump)
  • s β€” slot reference
  • S β€” slot attribute id
  • v β€” 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