/** A face as the engine asks for it: a family, a numeric weight and a * slant (`oblique` reads as italic). */ export interface FontFaceRequest { family: string; weight: number; style: 'normal' | 'italic'; } /** A font's `px` size: `font.slice(start, end)` is the whole match and * `value` its number. */ export interface PxSize { start: number; end: number; value: string; } /** * The first `px` size of a CSS font string from `from` on, as * `/(\d*\.?\d+)px/` finds it (`/(\d+(?:\.\d+)?)px/` with * `leadingDigit`), or null. A scan in one pass: the expression's leading * repetition is slow on a long run of digits with no unit after it. */ export declare function findPxSize(font: string, from?: number, leadingDigit?: boolean): PxSize | null; /** `font` with its first `px` size (see {@link findPxSize}) set to * `sizePx`. */ export declare function withPxSize(font: string, sizePx: (value: string) => number): string; /** * A font shorthand split at its size, as * `/^(.*?)(\d*\.?\d+)px\s+(.+)$/` splits it (with `lineHeight`, * `/^(.*?)(\d*\.?\d+)px(\s*\/\s*[^\s]+)?\s+(.+)$/`): `prefix` the style * and weight words before the size (its spaces kept), `family` the family * list after it (and after a `/ line-height`). Null when the string has no * such size. A scan in one pass, where the expressions backtrack. */ export declare function splitAtFontSize(font: string, lineHeight?: boolean): { prefix: string; family: string; } | null; /** The face a canvas font shorthand names (`'700 37.5px Open Sans'`, * `'italic 400 13px "Source Serif 4"'`), or null when the string has no * `px` size. A string with no weight is 400; `bold` is 700. */ export declare function parseFontString(font: string): FontFaceRequest | null; /** Every family a canvas font shorthand lists, in order, unquoted * (`'700 16px "Lora", "Noto Serif", serif'` → Lora, Noto Serif, serif); * empty when the string has no `px` size. */ export declare function fontStringFamilies(font: string): string[]; /** The family of a canvas font shorthand, or null. */ export declare function fontStringFamily(font: string): string | null; /** `font` with its family list replaced by `family`, its style, weight and * size kept; null when the string names no size. For asking a measurer * for the same face in a family it cannot have (see `measuresOwnFace`). */ export declare function fontStringWithFamily(font: string, family: string): string | null; //# sourceMappingURL=fontString.d.ts.map