Webfont Subset Savings Percent Glyphs

Budget subset savings from transitive composite-glyph dependencies and actual per-glyph/fixed bytes, not raw retained-count ratio alone; omits rewritten table/compression cost and font usability certification.

Description

Font subsets may require transitive composite-glyph dependencies.

Font subsets may require transitive composite-glyph dependencies. Byte savings differ from glyph-count savings.1

Enter nonempty requested integer indices, a square binary dependency matrix with aligned nonnegative integer bytes and fixed bytes. Traverse dependencies, deduplicate/sort retained indices, require positive original bytes and return byte/count savings.

When to use Webfont Subset Savings Percent Glyphs

Use Webfont Subset Savings Percent Glyphs when you need to evaluate the supplied records under the calculation and evidence rules below. No font tables are rewritten, compression applied or font usability verified. Dependencies may contain cycles.

Prepare measured font or typeset-layout values and the explicit design policy requested. For text or font bytes, use the supported syntax explained below.

How to use Webfont Subset Savings Percent Glyphs and understand its results

  1. Prepare measured font or typeset-layout values and the explicit design policy requested. For text or font bytes, use the supported syntax explained below.
  2. Enter requestedGlyphIndices, glyphDependencyAdjacency, measuredGlyphBytes, callerFixedFontBytes using the field table and calculation rules, then run the tool.
  3. Read retainedGlyphIndices, retainedGlyphCount, modelOriginalBytes, modelSubsetBytes, modelByteSavingsPercent, glyphCountSavingsPercent. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
requestedGlyphIndicesRequested glyph indiceslist of numberRequired
glyphDependencyAdjacencyGlyph dependency adjacencylist of list of numberRequired
measuredGlyphBytesMeasured glyph byteslist of numberRequired
callerFixedFontBytesCaller fixed font bytesnumberRequired

Enter nonempty requested integer indices, a square binary dependency matrix with aligned nonnegative integer bytes and fixed bytes. Traverse dependencies, deduplicate/sort retained indices, require positive original bytes and return byte/count savings.

retained=transitive closure; subsetBytes=fixed+sum(retained glyph bytes)

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
retainedGlyphIndicesRetained glyph indiceslist of number
retainedGlyphCountRetained glyph countnumber
modelOriginalBytesModel original bytesnumber
modelSubsetBytesModel subset bytesnumber
modelByteSavingsPercentModel byte savings percentnumber
glyphCountSavingsPercentGlyph count savings percentnumber
json
{
  "input": {
    "requestedGlyphIndices": [
      0
    ],
    "glyphDependencyAdjacency": [
      [
        0,
        1,
        0
      ],
      [
        0,
        0,
        0
      ],
      [
        0,
        0,
        0
      ]
    ],
    "measuredGlyphBytes": [
      100,
      200,
      300
    ],
    "callerFixedFontBytes": 100
  },
  "output": {
    "retainedGlyphIndices": [
      0,
      1
    ],
    "retainedGlyphCount": 2,
    "modelOriginalBytes": 700,
    "modelSubsetBytes": 400,
    "modelByteSavingsPercent": 42.857142857142854,
    "glyphCountSavingsPercent": 33.333333333333336
  }
}

Limitations and assumptions

No font tables are rewritten, compression applied or font usability verified. Dependencies may contain cycles.

Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Matrices are limited to 128 rows and 128 entries per row. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use Font File Size Estimate From Glyph Count: Uncompressed SFNT budgeting combines per-glyph class costs with table and directory overhead. Compression changes the eventual file size. For a complementary task, use x-Height Ratio From Font File: A font’s x-height ratio relates a native metric to units per em. Missing native metrics should be represented separately from measured outline height.

References

  1. Webfont Subset Savings Percent Glyphs — tool.io

Similar or alternative tools

  • Font File Size Estimate From Glyph Count

    Uncompressed SFNT budgeting combines per-glyph class costs with table and directory overhead. Compression changes the eventual file size.

  • x-Height Ratio From Font File

    A font’s x-height ratio relates a native metric to units per em. Missing native metrics should be represented separately from measured outline height.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies