Skip to main content
Solved

Is it possible to split a text layer into two or more layers?


For example:

$19.99
/month

separate it into two layers where $19.99 is one layer and /month is another

Best answer by David

There are existing plugins which have this functionality. Here’s one example:

Figma
View original
This topic has been closed for replies.

8 replies

David
  • 9 replies
  • Answer
  • July 20, 2023

There are existing plugins which have this functionality. Here’s one example:

Figma

Im aware of that. I want know how to do it through the plugin api.


David
  • 9 replies
  • July 20, 2023

One of the currently available plugins has their source code available on GitHub. Take a look through there to see how they are handling it.

github.com

cool. thank you.


Vincent_Huss
  • Active Member
  • 29 replies
  • March 28, 2024

he’s only doing a split(‘\n’)
not handling :

  • the weird L-SEP char that appear if user does shift+ENTER (known issue)
  • natural text wrapping

anyone knows if the Figma API provides any sorts of info about the lines of text generated by the text engine ? i really can’t find anything


fengweiyao
  • New Member
  • 2 replies
  • September 10, 2024

@Vincent_Huss hi, do you have any solution now? i have the same issue.


Vincent_Huss
  • Active Member
  • 29 replies
  • September 11, 2024

no, i gave up on that feature,

it doesn’t seem like Figma provides any hook for that information 😕

maybe something to consider as a feature request @Figma_Product ?

=> for a text node : providing a list of bounding box for each lines


James_Yang
Figmate
  • Figmate
  • 82 replies
  • September 11, 2024

There was another thread on something similar from earlier this year: Methods and/or Properties for Getting Dimensions of Lines of Text within Text Node?


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