Methodology

How SwapMyFont ranks substitutes

SwapMyFont is built for designers, developers, and brand teams who need documented substitutes — not opinion lists. Unlike catalog tools that score fonts from editorial metadata buckets, SwapMyFont measures actual glyph outlines on the text you provide and shows per-character proof.

Reference input

You provide a reference font by uploading a file or selecting a Google Font. Uploaded fonts stay in your browser — they are parsed locally with opentype.js and never sent to a server.

Fingerprinting

SwapMyFont rasterizes glyph outlines into a fixed grid and extracts shape fingerprints for the characters in your sample text. Precomputed fingerprints for the Google Fonts catalog make ranking fast at scale.

Similarity scoring

Candidates are ranked using contour similarity, advance width, x-height alignment, and ink density. These metrics capture both visual shape and layout impact — critical when swapping fonts in UI or headlines.

Glyph proof

For each character in your sample string, SwapMyFont renders side-by-side glyph previews and overlay comparisons with a per-character match score. Low scores flag characters that may look wrong in production.

Coverage checks

SwapMyFont warns when a substitute is missing glyphs required by your sample text — numerals, punctuation, currency symbols, or extended Latin characters.

License guidance

License badges summarize common Google Font licenses in plain language. This is guidance only, not legal advice. Always verify licensing before commercial use.

Scoring

What the similarity score measures

A SwapMyFont similarity score ranges from 0 to 100. Higher values indicate closer alignment between a candidate and your reference on the characters in your sample string. Scores reflect structural and visual compatibility — not legal equivalence, brand equity, or guaranteed pixel identity.

DimensionWeightWhat it measures
Shape45%Rasterized glyph contour comparison — pixel agreement and intersection-over-union on normalized outlines
Width20%Advance width ratio per glyph — how much horizontal space each character occupies
X-height15%Lowercase height ratio per glyph — affects perceived size at the same point size
Ink20%Black pixel density as a stem-weight proxy — related to stroke contrast and weight

Algorithm

How scores are calculated

Shape comparison. Each glyph outline is rasterized into a normalized grid. SwapMyFont compares reference and candidate pixels using pixel agreement (65%) and intersection-over-union (35%) to score contour similarity.

Ratio metrics. Width, x-height, and ink scores use the ratio of the smaller value to the larger — so a candidate that is 10% wider scores 91 on width, not zero.

Per-glyph composite. Each character receives its own score (shape 55%, width 20%, x-height 10%, ink 15%). The overall family score is the weighted average of dimension scores across all compared characters in your sample text.

Sample-dependent. Rankings change when you change the sample string. Include brand names, UI labels, numerals, and punctuation you actually use — not just a generic pangram.

Confidence

Interpreting scores

Glyph proof uses color-coded thresholds to highlight characters that need review. Overall family scores follow similar guidance:

ScoreLevelInterpretation
85–100Strong matchHigh structural and visual alignment on your sample text. Suitable for most substitution decisions.
70–84Verify specificsGood overall fit, but inspect individual glyphs — some characters may diverge in shape or width.
Below 70Use with cautionNoticeable differences in shape, spacing, or weight. Review glyph proof before adopting.

In glyph proof, scores at or above 85 appear as strong matches, 70–84 as needing review, and below 70 as potential mismatches.

Strict mode

Filtering weak substitutes

Strict match mode filters out candidates where too many individual glyphs fall below a minimum score threshold. By default, a candidate is rejected if more than a set number of glyphs score below 85%. The threshold is configurable from 50% to 99%.

Use strict mode when every character in your sample string must hold up — brand names, product codes, or UI copy where a single mismatched glyph is unacceptable.

Limits

What SwapMyFont does not measure

  • It does not provide legal advice about font licensing.
  • It does not host licensed commercial fonts such as Helvetica or Gotham.
  • It does not guarantee pixel-perfect identity — it documents closeness with proof.
  • Scores depend on your sample text — different strings can change rankings.
  • OpenType features, stylistic alternates, and ligatures are not compared.
  • Variable font axes (weight, width, optical size) are normalized at a fixed instance — results may differ at other settings.
  • Hinting quality at small sizes is not measured.
  • Non-Latin script support is limited in v0.1; always verify coverage warnings.

Always test substitutes in real layouts at target sizes before final selection.

Try the matching tool