Skip to Content
Platform.Ontology

SVG text metrics

Measures SVG text extents and glyph positions.

Used to track youGraphics and fingerprintingLayoutWeb browsersWhen the page loads

In one line

Can measure picture text sizes to learn about your fonts and system

Measures SVG text extents and glyph positions.

SVG layout uses a separate text path from HTML, so metrics add fonts and rasterizer detail even under HTML-layout defenses.

What it can and can't do

What the user does: Nothing. It happens when the page loads

It can

  • Measure how wide and tall text drawn in pictures is
  • Learn font and drawing differences even when normal text checks are blocked
  • Add that number to a device profile

It cannot

  • Show you anything on the screen
  • See your files
  • Ask permission first
  • Know who you are by itself

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported792020-01-15None
FirefoxSupported1.52005-11-29None
SafariSupported32007-10-26None
Safari on iPhoneSupported32009-06-17None
Chrome on AndroidSupported1Not listedNone
Samsung InternetSupported5.02016-12-15None

How a site asks for it

APISVGTextContentElement.getComputedTextLength(); getSubStringLength(); getBBox()
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Create SVG text elements
  2. Read lengths and boxes
  3. Hash

Data you get

What comes back: Floats per text sample
Shape: hash

FieldTypeUnitRangePrecision
computedTextLengthfloatuser units0 to 1000double precision

Technical limits

  • Same limits as DOMRect

The story

What it is

A script measures the exact size and spacing of text drawn as an SVG graphic.

For you

You never see it. The page draws text as a vector picture and measures where each letter lands. Those numbers vary with your fonts and system.

For makers

Chart and map makers need these numbers to place labels. Trackers use the same numbers as another way to see your fonts and rendering, even when other methods are blocked.

Where you see it

TypeExampleApps
analyticsA charting site like a dashboard tool places labels on a graph by measuring each text label first.None named
mapsA web map measures place names to avoid overlapping labels on your screen.Google Maps, Mapbox
creativeA web drawing tool with text on curves measures each letter to place it along a path.Figma
adsA tracker draws text in SVG and records exact widths, which works even if canvas is blocked.None named
securityA fraud tool compares SVG text size to what the device claims, to find a spoofed setup.None named
educationAn interactive science page labels diagram parts and measures text to avoid overlap.None named
gamesA web strategy game places unit names on a map and measures them so they do not collide.None named

Risks

  • Hard to block without breaking charts
  • Reveals fonts

What the platform says

  • MDN: SVG text. Describes how SVG text works and which measuring tools sites can use to lay it out.

Good uses and abuse

Legitimate uses

  • None

Known abuse

  • Font and engine signature

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility1 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough identifying entropy, when known

Sources

How well checked: Based on official documentation.

On this page