![]() Here is the font list returned on my PC (Windows 7):Īnd the list on my Mac (macOS Mojave 10.14.5):īoth lists on Windows and Mac are not complete. ![]() You need to download the FontTools subfolder from this repository: and add it in the same location as the Python script above. The code is inspired by this discussion: Surface Text Add-In Ui.messageBox('Failed:\n'.format(traceback.format_exc())) SketchTextInput = sketchTexts.createInput(key, 1.0, point) # end of functions for Font#Īpp.documents.add() Tt = ttLib.TTFont(source_file_name,fontNumber=0)įont_ori_name = shortName(tt,PlatFormID) If file.lower().endswith(".ttf") or file.lower().endswith(".ttc"): #iterate each *.ttf font in the specific folder If ('win') or ('cygwin'):įontPath = os.path.join(os.environ, 'Fonts') # get font list (Windows only in this release) If record.nameID = FONT_SPECIFIER_NAME_ID and not name and atformID=platformID:Įlif record.nameID = FONT_SPECIFIER_FAMILY_ID and not family and atformID=platformID: ![]() Here is a code that lists system fonts for Mac and Windows:įontToolPath = os.path.dirname(os.path.realpath(_file_))įontToolPath = fontToolPath + "/FontTools" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |