Skip to main content

Expose visual line splitting for TextNodes in plugin API


Nathan_Thomassin

 

Hi 👋,

I am developing a plugin that needs to analyze text blocks and split them exactly “line by line” as they appear visually in the Figma editor. The goal is to process each displayed line, including those that result from automatic wrapping (not just explicit line breaks in the text).

Currently, the Plugin API only allows splitting text on explicit newline characters (\n), but there is no way to obtain the actual visual line breakdown as rendered by Figma’s text engine (i.e., where lines wrap automatically due to width, font, size, etc.).

Why this matters:

  • Many workflows (translation, accessibility, animation, content synchronization, etc.) require manipulating text “as seen” line by line.

  • Workarounds (simulating rendering, OCR, etc.) are complex, unreliable, and do not always match Figma’s own rendering.

  • Only Figma’s engine knows the true visual line breaks, since they depend on many internal parameters.

Feature request:
Would it be possible to add a method to the Plugin API that:

  • Returns the text of a TextNode as an array of lines, matching exactly how it’s displayed (including automatic line wrapping)?

  • Or, alternatively, exposes the visual position (line/column) of each character in the rendered text?

Benefits:

  • Enables advanced plugins for text management, export, and analysis.

  • Unlocks new use cases that are currently impossible due to this API limitation.

Thank you for considering this feature. I’m happy to provide more context or examples if needed!

Cheers

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings