tryMeasureHyphenWidth()
Measure hyphen width when the adapter supports it.
Import
Section titled “Import”import { tryMeasureHyphenWidth } from "@graphrefly/ts/solutions/reactive-layout";Signature
Section titled “Signature”function tryMeasureHyphenWidth( adapter: MeasurementAdapter, font: string,): number | undefinedParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
adapter | MeasurementAdapter | Measurement adapter to query. |
font | string | Font string passed to the adapter. |
Returns
Section titled “Returns”The hyphen width, or undefined when measurement fails.
Example
Section titled “Example”tryMeasureHyphenWidth(adapter, "16px sans-serif");Source
Section titled “Source”packages/ts/src/solutions/reactive-layout/measurements.ts