def doReturnFontFromDialog(currentFont): fontChoice = mc.fontDialog() if fontChoice: return fontChoice else: warning("No font selected. You're stuck with " + currentFont) return currentFont
def display_font_dialog(cls): font = cmds.fontDialog() if font: font = font.split('|', 1)[0] cmds.textFieldButtonGrp(cls.label_font_tfg, e=True, text=font) cls.update_mask()
def change_text_font(): strings = parse_text_field_commas(cmds.textField(desired_text, q=True, text=True)) new_font = cmds.fontDialog() print(new_font) if new_font != '': new_font_short_name = new_font.split('|')[0] current_font['current_font'] = new_font cmds.button(font_button, e=True, label=new_font_short_name)
def returnFontList(): bufferList = (mc.fontDialog(FontList = True)) return bufferList
cmds.text(l="NURBS TEXT CREATOR", h=15, w=275, bgc=grey) space() rowOf2() nurbsTextField = cmds.textField(ec=setNurbsTxt, w=248) #cmds.button(c=setNurbsTxt,l="GO", font="boldLabelFont", w=24, h=20, bgc=blueGreen) cmds.iconTextButton( c=setNurbsTxt, style='iconOnly', image1='arrowRight.png',w=24, h=20, bgc=blueGreen) close()#closeRowof2 fonts = cmds.fontDialog(FontList=True) fontOptionMenu = cmds.optionMenu(w=275) for i in fonts: fontList = cmds.menuItem(label=i) separator()#------------------------------------------------------------------------------------ cmds.text(l="NURBS SHAPES", h=15, w=275, bgc=grey) space() rowOf2() cmds.formLayout(w=136)