UNPKG

modern-text

Version:

Measure and render text in a way that describes the DOM.

28 lines (24 loc) 1.08 kB
import { T as Text } from './shared/modern-text.BehtKzAJ.mjs'; export { C as Canvas2DRenderer, a as Character, F as Fragment, M as Measurer, P as Paragraph, b as backgroundPlugin, f as createSvgLoader, i as createSvgParser, d as definePlugin, q as filterEmpty, g as getHighlightStyle, c as getTransform2D, n as hexToRgb, h as highlightPlugin, k as isEqualObject, m as isEqualValue, l as listStylePlugin, o as outlinePlugin, j as parseColormap, p as parseValueNumber, r as renderPlugin, t as textDecorationPlugin, e as textDefaultStyle } from './shared/modern-text.BehtKzAJ.mjs'; import 'modern-idoc'; import 'modern-path2d'; import 'modern-font'; function measureText(options, load) { const text = new Text(options); if (load) { return text.load().then(() => { return text.measure(); }); } return text.measure(); } function renderText(options, load) { const text = new Text(options); if (load) { return text.load().then(() => { return text.render(options); }); } return text.render(options); } export { Text, measureText, renderText };