Jump to content
Sign in to follow this  
Noobini

Heeeeeeyyy..........FontZ, or Font that goes in Z axis rather than Y

Recommended Posts

oddly, some fonts create the same text in different character order....so I've added an internal sort..

ver 1.02: - added internal sort to ensure correct character parsing..

 

vu_fontZ.hdanc

  • Like 1

Share this post


Link to post
Share on other sites

thanks Matt, if you or any other gurus out there can workout where it stores the line 'gap' internally, then we could do away with the Offset entirely..rather than as of now it's a bit of an eyeballing process...

Must be in there some where since the font 'knows' the line spacing...

Share this post


Link to post
Share on other sites

No magic tricks from me I'm afraid. I assume Houdini is relying on the font itself to work out the vertical separation, but doesn't expose that in any way.

Thinking out loud, You could maybe calculate it yourself. The textindex attribute jumps where there's a new line, so you could get the first character of the first line, the first character of the second, then measure the distance from the bottom of the first to the top of the second.

That seems a bit loose though; if you wanted to guarantee where the first char of each line is, you could get the text from the font sop text parm directly, split on the '\n', and go from there. Just proving to myself that its possible in python (and cos its late and I shouldn't go any further with this tonight...)

 

>>> p = hou.parm('/obj/geo1/font1/text')
>>> p.eval()
'line 1\nline2'

 

Share this post


Link to post
Share on other sites

thanks Matt...I did wrestle with that python...but sadly couldn't go the distance...so I resorted to my redneck hillbilliness.....hey, hillbillies can be very creative/resourceful too....especially with me cousins ;)

Anyway, ver 1.03: no more eyeballing Offset..now it's fully auto for any fonts...plus you can add manual spacing on top....

 

vu_fontZ.hdanc

Edited by Noobini

Share this post


Link to post
Share on other sites

Cool! Be curious to see what you came up with; despite myself I played with detecting the line breaks in vex for another 2 hours past my bedtime, it actually got worse by the end of those 2 hours. 

*time passes as I look at the setup*

Ah jeez, thats such a simple fix, I was waaay overcomplicating it. :)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×