feat: custom text metrics provider (#9121)

This commit is contained in:
Marcel Mraz 2025-02-11 14:23:08 +01:00 committed by GitHub
parent c329470b73
commit e3060dfb8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 268 additions and 267 deletions

View file

@ -6,7 +6,7 @@ import {
getFontFamilyFallbacks,
} from "../constants";
import { isTextElement } from "../element";
import { charWidth, getContainerElement } from "../element/textElement";
import { getContainerElement } from "../element/textElement";
import { containsCJK } from "../element/textWrapping";
import { ShapeCache } from "../scene/ShapeCache";
import { getFontString, PromisePool, promiseTry } from "../utils";
@ -31,6 +31,7 @@ import type {
} from "../element/types";
import type Scene from "../scene/Scene";
import type { ValueOf } from "../utility-types";
import { charWidth } from "../element/textMeasurements";
export class Fonts {
// it's ok to track fonts across multiple instances only once, so let's use