Skip to main content
Solved

Is it possible to change the style of a textNode that is inside an instance?

  • January 10, 2024
  • 4 replies
  • 404 views

Lucas_Miqueias

Hi guys.

I need to change some specific texts within a text node that is within an instance.
Is this possible via API?

Best answer by tank666

The fontWeight property is read-only. To change the fontWeight, you need to change fontName.style using the above methods.

This topic has been closed for replies.

4 replies

tank666
  • January 10, 2024

Yes, of course you can change the font style. You need to use the setRangeFontName or setRangeTextStyleId methods.


Lucas_Miqueias
  • Author
  • New Member
  • January 10, 2024

How?

Because in documentation

setRageFontName wait font name.
setRageTextStyleId wait a string.

I need to change font-weight in a range.


tank666
  • Answer
  • January 10, 2024

The fontWeight property is read-only. To change the fontWeight, you need to change fontName.style using the above methods.


Lucas_Miqueias
  • Author
  • New Member
  • January 11, 2024

Thank you!

This works for me.