UNPKG

modern-text

Version:

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

58 lines (53 loc) 1.81 kB
'use strict'; const Text = require('./shared/modern-text.CE19Tml2.cjs'); require('modern-idoc'); require('modern-path2d'); require('modern-font'); function measureText(options, load) { const text = new Text.Text(options); if (load) { return text.load().then(() => { return text.measure(); }); } return text.measure(); } function renderText(options, load) { const text = new Text.Text(options); if (load) { return text.load().then(() => { return text.render(options); }); } return text.render(options); } exports.Character = Text.Character; exports.Fragment = Text.Fragment; exports.Measurer = Text.Measurer; exports.Paragraph = Text.Paragraph; exports.Text = Text.Text; exports.backgroundPlugin = Text.backgroundPlugin; exports.createSVGLoader = Text.createSVGLoader; exports.createSVGParser = Text.createSVGParser; exports.definePlugin = Text.definePlugin; exports.drawPath = Text.drawPath; exports.filterEmpty = Text.filterEmpty; exports.getHighlightStyle = Text.getHighlightStyle; exports.getTransform2D = Text.getTransform2D; exports.hexToRgb = Text.hexToRgb; exports.highlightPlugin = Text.highlightPlugin; exports.isEqualObject = Text.isEqualObject; exports.isEqualValue = Text.isEqualValue; exports.listStylePlugin = Text.listStylePlugin; exports.outlinePlugin = Text.outlinePlugin; exports.parseColor = Text.parseColor; exports.parseColormap = Text.parseColormap; exports.parseValueNumber = Text.parseValueNumber; exports.renderPlugin = Text.renderPlugin; exports.setupView = Text.setupView; exports.textDecorationPlugin = Text.textDecorationPlugin; exports.textDefaultStyle = Text.textDefaultStyle; exports.uploadColor = Text.uploadColor; exports.uploadColors = Text.uploadColors; exports.measureText = measureText; exports.renderText = renderText;