Skip to main content
Solved

How can I count the times a property is used?

  • April 1, 2023
  • 5 replies
  • 489 views

How can I create a plugin to count how many times a color, font-size, font-weight etc is used?

Best answer by Gleb

You need to loop through the nodes and count what you need.

This topic has been closed for replies.

5 replies

Gleb
  • Power Member
  • 4716 replies
  • Answer
  • April 8, 2023

You need to loop through the nodes and count what you need.


  • Author
  • 4 replies
  • June 19, 2023

Hi, for line-height, sometimes it is set to auto which is not what I want. Is there a way to get the line height from the inspects tab where it shows the line-height in pixels?


tank666
  • 4873 replies
  • June 19, 2023

In the Inspect panel, you could also see the comment: /* identical to box height */.
Therefore: TextNode.lineHeight = TextNode.height.


  • Author
  • 4 replies
  • June 19, 2023

thnks. and what if the text is mixed? or what if it is not identical to the box height?


tank666
  • 4873 replies
  • June 19, 2023

As an option, you can create a new text object for each segment to get its height/line height.