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 defconAppKit.windows.baseWindow import BaseWindowController | |
| from vanilla import FloatingWindow | |
| from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber | |
| from mojo.UI import SetCurrentGlyphByName | |
| """ | |
| RoboFont Helper | |
| Type: Start up | |
| Purpose: After it's run, if you double click on a component it will jump to its base glyph. | |
| """ |
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 CurrentWindow | |
| from simpleKerning import * | |
| """ | |
| A RoboFont script to expand kerning groups from base glyph to their composites. | |
| You need the simple kerning extension installed for this to work. | |
| 1. Select base glyph(s) (with contours) which are already grouped | |
| 2. Run the script | |
| 3. The groups will be expanded to the composites, if: | |
| - Their width is same as the base glyph |
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 |
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
| 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
| 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
| # 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
| 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
| 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 CurrentGlyphWindow | |
| from mojo.events import addObserver | |
| class LockZoomObserver: | |
| def __init__(self): | |
| addObserver(self, "ZoomObserver", "modifiersChanged") | |
| def ZoomObserver(self, info): | |
| gw = CurrentGlyphWindow() | |
| viewScale = gw.getGlyphViewScale() |
NewerOlder