modern-text
Version:
Measure and render text in a way that describes the DOM.
28 lines (24 loc) • 1.15 kB
JavaScript
import { T as Text } from './shared/modern-text.COuQZZRJ.mjs';
export { C as Character, F as Fragment, M as Measurer, P as Paragraph, c as backgroundPlugin, i as createSVGLoader, j as createSVGParser, b as definePlugin, d as drawPath, w as filterEmpty, g as getHighlightStyle, e as getTransform2D, v as hexToRgb, h as highlightPlugin, n as isEqualObject, q as isEqualValue, l as listStylePlugin, o as outlinePlugin, p as parseColor, m as parseColormap, k as parseValueNumber, r as renderPlugin, s as setupView, t as textDecorationPlugin, f as textDefaultStyle, u as uploadColor, a as uploadColors } from './shared/modern-text.COuQZZRJ.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 };