You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are there any plans to add getRange... setRange... methods like getRangeFontName, setRangeFontName etc?
How it should work?
The functions mentioned in the issue are used to modify the styling of a part of a text. The "range" refers to the part of the text the styling will be applied to. I believe it will not be a simple implementation of returning certain results as Figma docs suggests right at the beginning that there may be several edge cases.
From Figma's documentation on Working with text
When working with text nodes, there are a lot of things to consider:
make notes of cases we need to cover If needed, new items will be added to this list
See if there are cases, like missing fonts, that may be shared between multiple cases, e.g., setRangeFontName(), and setRangeTextStyleId()
Propose an implementation architecture before proceeding We should try to reduce rewriting boilerplate code. I have the feeling these function implementations will be very similar, but it may not be obvious how to generalize to one or two generic solutions
Implementation
NOTE: Each function needs to be added to both TextNode and TextSublayer
setRangeFontSize()
setRangeFontName()
setRangeTextCase()
setRangeTextDecoration()
setRangeLetterSpacing()
setRangeLineHeight()
setRangeTextStyleId()
The text was updated successfully, but these errors were encountered:
Original issue: react-figma#18
How it should work?
The functions mentioned in the issue are used to modify the styling of a part of a text. The "range" refers to the part of the text the styling will be applied to. I believe it will not be a simple implementation of returning certain results as Figma docs suggests right at the beginning that there may be several edge cases.
To Do
Preparation
If needed, new items will be added to this list
setRangeFontName()
, andsetRangeTextStyleId()
We should try to reduce rewriting boilerplate code. I have the feeling these function implementations will be very similar, but it may not be obvious how to generalize to one or two generic solutions
Implementation
NOTE: Each function needs to be added to both
TextNode
andTextSublayer
The text was updated successfully, but these errors were encountered: