This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #MenuTitle: Uppercase | |
| # -*- coding: utf-8 -*- | |
| """Converts the selected text to upppercase.""" | |
| Doc = Glyphs.currentDocument | |
| Font = Glyphs.font | |
| Doc = Glyphs.currentDocument | |
| TextStoreage = Doc.windowController().activeEditViewController().graphicView().textStorage() | |
| String = TextStoreage.text().string() | |
| Range = TextStoreage.selectedRange() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #MenuTitle: Lowercase | |
| # -*- coding: utf-8 -*- | |
| """Converts the selected text to lowercase.""" | |
| Doc = Glyphs.currentDocument | |
| Font = Glyphs.font | |
| Doc = Glyphs.currentDocument | |
| TextStoreage = Doc.windowController().activeEditViewController().graphicView().textStorage() | |
| String = TextStoreage.text().string() | |
| Range = TextStoreage.selectedRange() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from mojo.UI import CurrentGlyphWindow | |
| from mojo.events import addObserver | |
| class LockZoomObserver: | |
| def __init__(self): | |
| addObserver(self, "ZoomObserver", "modifiersChanged") | |
| def ZoomObserver(self, info): | |
| gw = CurrentGlyphWindow() | |
| viewScale = gw.getGlyphViewScale() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import string | |
| # to check for uppercase as well, just uncomment in line 4 | |
| wanted = string.ascii_lowercase #+ string.ascii_uppercase | |
| used = 'Insert words here' | |
| used = used.replace(' ', '') | |
| list(used) | |
| required = [letter for letter in wanted if letter not in used] | |
| required = ''.join(required) | |
| print ('STILL MISSING:\n' + required) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from mojo.UI import GetFile | |
| font_paths = GetFile(allowsMultipleSelection=True) | |
| fonts = FontsList() | |
| for font_path in font_paths: | |
| f = OpenFont(font_path, showInterface=False) | |
| fonts.append(f) | |
| glyph_set_dict = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in the current font | |
| # add lowercase unicodes to uppercase characters | |
| # requires compositor for mapping uppercase to lowercase, https://github.com/typesupply/compositor | |
| from compositor.caseConversionMaps import upperToSingleLower | |
| f = CurrentFont() | |
| for g in f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import string, random | |
| v = 'aeiou' | |
| c = string.ascii_lowercase | |
| c = [l for l in c if l not in v] | |
| d = dict(v = list(v),c = list(c)) | |
| wordNum = 300 | |
| pattern = 'cvcvc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| font = CurrentFont() | |
| all_glyphs = font.glyphOrder | |
| lc_list = [] | |
| exceptions = ['germandbls','dotlessi','dotlessj','napostroph'] | |
| case_extension = '.uc' | |
| for glyph_name in all_glyphs: | |
| lc_glyph = None | |
| if glyph_name[0].isupper() or glyph_name in exceptions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in the current font | |
| # add script, category and subcategory to glyphs matching “target_script” | |
| # this enables exchange between people using non-standard glyph names | |
| # TODO: could also work with selection | |
| # Set target script | |
| # initiate collection list | |
| target_script = "arabic" | |
| glyphs_to_store = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #MenuTitle: Generate UFO instances | |
| # -*- coding: utf-8 -*- | |
| from __future__ import print_function | |
| __doc__=""" | |
| Creates UFO files of all instances with production names. | |
| """ | |
| import os |
OlderNewer