Skip to content

Main content

Glyph Pair Adjustment Lookup

Lookup every explicit pair-adjustment record for two glyph IDs, retaining conflicting duplicate values rather than assuming authoritative font kerning.

Loading tool…

Description

Look up every explicit pair-adjustment record for two glyph IDs, retaining conflicting duplicate values rather than assuming authoritative font kerning.

A glyph’s advance moves the next placement origin; its ink box describes visible bounds relative to that origin. Ink can overhang the advance, and an unknown box differs from a known empty box. These tools use caller-supplied glyph IDs and metrics, placing a horizontal run by cumulative advances without shaping text.

Look up every explicit pair-adjustment record for two glyph IDs, retaining conflicting duplicate values rather than assuming authoritative font kerning.

When to use this tool

Use this tool to look up every explicit pair-adjustment record for two glyph IDs, retaining conflicting duplicate values rather than assuming authoritative font kerning.

How to use the tool and how it works

  1. Enter pairsJson, left, right using the input definitions below. Serialize the JSON text fields in the decoded shape shown below.
  2. Run the operation. Resolve malformed-input errors before interpreting the result.
  3. Read result.matches. Interpret signs, units, ordering and null values using the rules below.

Validate each {left,right,adjustment} record, then return every exact ordered-ID match with its original index and signed adjustment, in input order.1

Input fieldMeaning and unitsAccepted input
pairsJsonJSON array of {left, right, adjustment} records: exact string glyph IDs and a finite signed adjustment in common metric units.Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply.
leftExact left glyph ID in the ordered pair.Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply.
rightExact right glyph ID in the ordered pair.Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply.

These decoded examples show the structure of the JSON text fields. Supply each as its corresponding serialized JSON string.

json
{
  "pairsJson": [
    {
      "left": "a",
      "right": "b",
      "adjustment": -1
    }
  ]
}
Output fieldInterpretation
resultObject containing the fields below.
result.matchesEvery matching pair occurrence as {index,adjustment}, in source order.
json
{
  "input": {
    "pairsJson": "[{\"left\":\"a\",\"right\":\"b\",\"adjustment\":-1}]",
    "left": "a",
    "right": "b"
  },
  "output": {
    "result": {
      "matches": [
        {
          "index": 0,
          "adjustment": -1
        }
      ]
    }
  }
}

Limitations and assumptions

  • Duplicate and conflicting observations are retained; no font file, shaping engine or authoritative kerning table is consulted.
  • All advances, box coordinates, shifts and positional tolerances must share caller-defined metric units. Signed advances are accepted. Glyph records contain id, advance, integer cluster 0–8192 and box = null or [minX,minY,maxX,maxY] with ordered bounds.
  • Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.

Alternative or Complementary methods

Obtain metrics and cluster mappings from the intended font/shaping system, then inspect the supplied observations. Use actual rendering when hinting, fallback choice or visible pixel extents matter.

References

  1. Tool behavior and example: Glyph Pair Adjustment Lookup — tool.io

Similar or alternative tools