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

15 Apr, 2021 06:22 AM
14 Apr, 2021 11:34 PM
13 Apr, 2021 09:20 AM
04 Apr, 2021 10:50 PM
04 Apr, 2021 10:20 PM

 

02 Apr, 2021 06:14 AM
30 Mar, 2021 09:34 AM
30 Mar, 2021 08:52 AM
28 Mar, 2021 02:58 PM
26 Mar, 2021 03:13 AM
26 Mar, 2021 12:46 AM