Each text element can set textOverflow ('resize', 'ellipsis' or 'fit'), maxLines, minFontSize and maxFontSize. 'fit' draws the text at the largest size that fits between the bounds, without changing its fontSize. Text sizing docs
Changelog · Oct 15, 2026
Polotno 4.16.1: text sizing per element and consistent text overflow in exports
Text elements can fit their box between a minimum and maximum font size, or stop after a set number of lines. SVG, HTML, PDF and PPTX export now fit text as the canvas does.
Highlights
Text sizing per element
Text overflow matches the canvas
SVG, HTML, PDF and PPTX export draw overflowing text as the canvas does, and a word wider than its box shrinks the text instead of breaking it, unless textSplitAllowed is on.
PDF import matches the layout
@polotno/pdf-import measures text in the fonts that will render it, so an imported page lays out as the Polotno canvas does and edits the way it looks. It also imports numbered and nested lists, Type3 fonts and right-to-left text.
Layers panel selection and groups
In the layers panel, Shift+click selects a range, Cmd/Ctrl+click adds or removes one layer, groups expand as a tree, and hovering a row highlights its element on the canvas.
Breaking changes
- @polotno/pdf-import 0.11.0: Requires Node.js 22.13 or newer.
All changes
polotno 4.16.1 / 3.16.1
- Better text overflow logic, shared across all exporters (raster, pdf, svg, html). a word wider than its box now shrinks the text instead of breaking it, unless textSplitAllowed is on.
- Added text sizing per element: textOverflow ('resize', 'ellipsis' or 'fit'), maxLines, minFontSize and maxFontSize. 'fit' draws the text at the largest size that fits, between the bounds, without changing its fontSize.
tsx // a headline that shrinks for long names and grows for short ones element.set({ textOverflow: 'fit', minFontSize: 24, maxFontSize: 160 }); // a description that stops after two lines with "…" element.set({ textOverflow: 'resize', maxLines: 2 }); - Added 'fit' to setTextOverflow, so every text fits its box.
tsx import { setTextOverflow } from 'polotno/config'; setTextOverflow('fit'); - measureText returns the drawn fontSize, lines, lineCount and truncated, and takes the new text sizing fields. richTextEnabled is deprecated and has no effect.
tsx import { measureText } from 'polotno/utils/measure-text'; const result = await measureText({ ...element.toJSON(), text: 'A much longer value' }); result.fontSize; // the size the canvas draws it at result.truncated; // true when some text does not fit - Curved text under 'fit' takes the largest size whose curve fits the element width.
- Layers panel: Shift+click selects a range, Cmd/Ctrl+click adds or removes one layer, groups expand as a tree, and hovering a row highlights its element on the canvas. Shift+click used to add one layer.
- Added store.highlightElement(id), store.highlightedElementId and element.isHighlighted, for custom layer lists.
tsx store.highlightElement(element.id); // outline it on the canvas store.highlightElement(null); // clear - Selection colors: one palette across a multi-selection, groups and several SVGs; editing a color recolors every element sharing it in one undo step.
- Added numeric width, height, X and Y in the Position popover for multi-selections and groups.
- Added "Fit to page" for SVGs, groups and multi-selections: the selection is scaled to fit inside the page. A single image keeps its "Fit to page" that fills the page.
- Added one-click text effect presets (Shadow, Lift, Glow, Outline, Sticker, Pop, Background) to the Effects panel.
- Added onProgress(progress, phase) to toGIFDataURL and saveAsGIF.
tsx await store.saveAsGIF({ onProgress: (progress, phase) => console.log(phase, Math.round(progress * 100) + '%'), }); - Smart duplicate repeats the offset of the last move, and duplicates the elements of nested groups.
- Blend modes preview on hover in the Blending list.
- Fixed a color edit or "fit" on several SVGs or images reaching only the first one.
- Fixed fitted text jumping while it is typed.
- Fixed the color picker hiding behind the effects panel on mobile.
@polotno/svg-export 0.10.0
- Overflowing text now renders as the canvas does: 'ellipsis' cuts the text, a word wider than its box shrinks it, and curved text fits its width. Existing exports of overflowing text change, so they match the editor.
- Overflowing text now renders as the canvas does: 'ellipsis' cuts the text, a word wider than its box shrinks it, and curved text fits its width. Existing exports of overflowing text change, so they match the editor.
- Added text sizing as in polotno 4.16: an element's textOverflow, maxLines, minFontSize and maxFontSize, and 'fit' as the global textOverflow.
- Added textSplitAllowed to the export options. store.toSVG() forwards the editor flag.
tsx const svg = await jsonToSVG( { ...json, pages: [json.pages[0]] }, { textOverflow: 'fit', textSplitAllowed: false }, );
@polotno/html-export 0.9.0
- Overflowing text now shrinks as the canvas does under the default 'change-font-size', and a word wider than its box shrinks the text instead of breaking it. Existing exports of overflowing text change, so they match the editor.
- Added text sizing as in polotno 4.16: an element's textOverflow, maxLines, minFontSize and maxFontSize, and 'fit' as the global textOverflow.
- Added textSplitAllowed to the export options. store.toHTML() forwards the editor flag.
tsx const html = await jsonToHTML(json, { textOverflow: 'fit' }); - Fixed text strokes clipped at the box edge.
@polotno/pdf-export 0.15.0
- Added text sizing as in polotno 4.16: an element's textOverflow, maxLines, minFontSize and maxFontSize, and 'fit' as the global textOverflow.
tsx await jsonToPDF(json, './output.pdf', { textOverflow: 'fit' }); - Fixed bold text in a single-weight font exporting as regular. The exporter emboldens the glyphs as the browser does.
- Fixed misplaced transparency on palette PNGs with binary alpha.
@polotno/pptx-export 0.8.0
- Text is now fitted at export and written at its fitted size, with only the lines that show, so PowerPoint opens the slide as the canvas draws it. Existing exports of overflowing text change.
- Added text sizing as in polotno 4.16: an element's textOverflow, maxLines, minFontSize and maxFontSize. The global textOverflow option now also takes 'ellipsis' and 'fit'.
- Added textSplitAllowed.
tsx await jsonToPPTX(json, 'design.pptx', { textOverflow: 'fit', textSplitAllowed: false }); - Fixed capitalized text split across styled runs.
@polotno/pdf-import 0.11.0
- Imports now reproduce the page as the Polotno canvas lays it out: text is measured in the fonts that will render it, so line breaks, element bounds and font sizes of existing files change, and the result edits the way it looks.
- Added numbered and nested lists. Items keep their bold, italic and color.
- Added mesh shadings and soft masks as vector art, and rotated rectangles as native shapes.
- Added Type3 fonts as editable text, and FreeText comments as text.
- Added right-to-left and complex-script text in reading order, and vertical writing.
- A font is matched to its Google family only when the PDF's copy matches the hosted one; otherwise it is embedded as "Name (PDF)". See fontStrategy.
- Added the fully-transparent reason to IMAGE_SKIPPED warnings. Every warning code and reason is listed in the docs.
const json = await pdfToJson({
pdf,
onWarning: (w) => {
if (w.code === 'IMAGE_SKIPPED') console.log(w.details.reason, 'on page', w.details.pageIndex);
},
});- Different import edge case fixes.
@polotno/psd-import 0.2.0
- Added Stroke and Inner Glow layer effects on raster layers, gradient overlay opacity stops, and the layer-style master switch.
- A truncated PSD or PSB throws IMPORT_FAILED with details.reason: 'truncated', so you can ask the user for a complete file. See parse errors.
tsx try { await psdToJson({ psd }); } catch (error) { if (error.code === 'IMPORT_FAILED' && error.details?.reason === 'truncated') { alert('The file is incomplete. Please upload it again.'); } }
@polotno/schema 0.9.0
- Added textOverflow, maxLines, minFontSize and maxFontSize to text elements. All optional, with no default.
polotno-node 3.13.0
- Bundle Polotno 4.16.0, including per-element text sizing ('fit', maxLines, minFontSize, maxFontSize) rendered as the editor does. attrs.textOverflow accepts 'fit'.
tsx const image = await instance.jsonToImageBase64(json, { textOverflow: 'fit' }); - Update Puppeteer to 25.14.0.
Embed creative infrastructure into your product
TRUSTED BY
100,000+
CREATORS
300+
BUSINESSES
