i need to have combobox to display the font family and font styles by Eto in python.please guid me.
@Alain - is this something you can help with?
1 Like
yes. we made plugin by python for writing text in right to left language. in combobox just show the name of the fonts. i need to know the codes for display the fonts style.top pic is a sample of what we need.
Here is a place to start:
import Rhino
for fq in Rhino.DocObjects.Font.InstalledFontsAsQuartets():
print(fq.QuartetName)
– Dale
1 Like
thanks. with this code all fonts from system listed in combo box.but i need to display fonts style and font face in combo box (Preview drop-down font list) too.
if it needs to be in a dropdown you could get the info this way:
from Rhino.DocObjects import Font
for f in Font.InstalledFonts():
print f.FamilyName, f.FaceName
or there’s an Eto font dialgog you could use:
from Eto.Forms import FontDialog, DialogResult
fd = FontDialog()
def pp(f):
print "fam:{}, face:{}".format(f.FamilyName, f.Typeface.Name)
def callback(s,e):
pp(fd.Font)
fd.FontChanged += callback
r = fd.ShowDialog(None);
if r == DialogResult.Ok:
print 'selected: '
pp(fd.Font)
1 Like
thanks.but i need alittle more your assist.i have a dialog with combobox include of all fonts and want to give the style and font face to each font in combobox.