Set size font via string counter

Asgardesign's Avatar

Asgardesign

25 Mar, 2021 10:02 PM

Hello, I'm trying to set the size of the font of the node "text on path" (which basically create a text in a series of circle) based on the leght of the string taken by a list that I upload. My idea is: more caracter on the row is equal to a small font size, and viceversa.
I tryed to use a compare node, but unfortunatly the node don't accept a int input, is there any workaround?

  1. Support Staff 1 Posted by john on 26 Mar, 2021 12:46 AM

    john's Avatar

    Hello again,

    Yes, the compare node is finicky about taking integers. All you have to do is feed your count (or any other integer output) into a number node and THEN feed that into compare. The number node is not only for creating numbers; it can also be used to convert integers into floating point numbers.

    But for this task you may not need a compare node. Allow me to suggest the convert_range node instead. Feed your length node into its value port; it's not finicky like compare and will take integers or floating points without complaining. Then set source start and end to the shortest and longest lengths you want to handle. Set target start to a large font size (for your shortest length) and target end to a small font size (for your longest length); convert-range will interpolate accordingly.

    Don't spend too much time trying to pick the perfect target values. Just make a reasonable guess, render the final output, and then adjust the two target sizes until you are pleased with the results. Convert_range is your friend.

    I enjoy answering questions like these. Keep them coming!

    John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • screenshot.png 79.4 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

26 Jan, 2025 02:09 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM

 

21 Jan, 2025 09:36 AM
21 Jan, 2025 02:00 AM
16 Jan, 2025 08:30 PM
15 Jan, 2025 06:37 AM
04 Jan, 2025 04:09 AM
03 Jan, 2025 05:32 PM