Last active
May 10, 2022 20:33
-
-
Save connordavenport/324fe2bc93be43db21a2a932f0a3586f to your computer and use it in GitHub Desktop.
Bring a font to the front
This file contains 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 : front & center | |
# shortCut : command+alt+0 | |
from mojo.UI import SelectFont, AllFontWindows | |
from fontParts.world import RFont | |
class frontAndCenter: | |
def __init__(self): | |
self.fontWindows = [(w.document.font,w) for w in AllFontWindows() if hasattr(w, "document")] | |
self.font = SelectFont() | |
self.bringUp() | |
def bringUp(self): | |
for font, win in self.fontWindows: | |
f = RFont(font) | |
if f == self.font: | |
win.w.getNSWindow().makeKeyAndOrderFront_(None) | |
frontAndCenter() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment