I want to create a TextObject with an installed font (Chez Vous). I have installed the font in Windows.
In Rhino command if I use TextObject I am able to select “Chez Vous” from the font dropdown and create a textobject with it. However when I use _-TextObjext _F “Chez Vous” … I get the error “Font name does not exist”. What am I missing?
Thank you for your quick reply.
Unfortunately when I run your script I still get the error that the font name can not be found.
As for the function for adding textobject within rhinoscriptsyntax, I am trying to make a 3D textobject (with option output=solid). Unfortunately the method you referred to does not support this.
Thank you for your reply.
I have tried many names (Font name, Filename, Window font name):
“Chez Vous”
“ChezVous”
“Chez Vous Regular”
“ChezVousRegular”
“ChezVous-Regular”
I do not have your font installed but the upper method should work. Always enclose your font names with chr(34) if they are consisted of 1> words (have an empty “space” between the words).
As Mitch pointed out, something is wrong with your font name.
import rhinoscriptsyntax as rs
def CreateTextObjsAsSolids():
text_string=rs.GetString("Text to insert?")
if not text_string: return
pt=rs.GetPoint("Text insert point?")
if not pt: return
ht=rs.GetReal("Text height?",minimum=0)
if not ht: return
thk=rs.GetReal("Solid thickness?",minimum=0)
if not thk: return
opts='_GroupOutput=_Yes _FontName="Your Font Name" _Italic=_No _Bold=_No '
opts+='_Height={} _Output=_Solids _Thickness={} '.format(ht,thk)
opts+='_LowerCaseAsSmallCaps=_No _AddSpacing=_No '
rs.EnableRedraw(False)
rs.Command('_-TextObject '+opts+'"'+text_string+'"'+' '+str(pt),True)
CreateTextObjsAsSolids()
The font name appears not to be the file name, but rather the name you see in the Fonts folder.
OK, thanks for the font, I have tested everything I can think of and the font just does not want to behave like the others on my system. Funny thing is that you can choose it in the dialog version of the command and it works fine, but not with the command line version.
If you choose it with the dialog version, the next time you run the dash version the font name shows up simply as “Chez Vous”. However, inputting the same name (in quotes) into the dash version it says “Font doesn’t exist”… Bizarre.
Bizarre isn’t it. Well thanks a lot for your time and effort. I will be writing a mail to McNeel support, hopefully they will be able to solve the problem
Thats great that this was fixed so fast. I see that the release target is 5.11, 6.0. When will this be available?
Not quite sure how to compare this with current Rhino Version “Version 5 SR11 64-bit
(5.11.50226.17195, 26-2-2015)”
Thanks for your reply,
I interpreted more as the 6th minor update/release for version 5.11.
But then I guess I will need to wait for version 6. Any indication when this will be released?
@dale, can you confirm above problem has been fixed in SR12 ? We’re facing the exact problem using an *.otf font and need to find a solution for all platforms, RH5, RH6 and Mac.
If not, is there a way to reference the font file using a path or use a font from a private font collection in a TextObject. A C# solution would help as well.