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
""" | |
The MIT License (MIT) | |
Copyright (c) 2015 Frederik Berlaen | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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 fontTools.ttLib import TTFont | |
from robofab.interface.all.dialogs import GetFolder | |
from lib.tools.misc import walkDirectoryForFile | |
root = GetFolder("Folder with .otf / .ttf files...") | |
found = {} |
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 AppKit import NSPoint | |
from mojo.events import MeasurementTool | |
measurement = MeasurementTool.measurementClass() | |
measurement.startPoint = NSPoint(100, 100) | |
measurement.endPoint = NSPoint(200, 200) | |
g = CurrentGlyph() | |
g.naked().measurements.append(measurement) | |
g.update() |
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 vanilla import * | |
import vanilla | |
from vanilla.vanillaBase import VanillaError | |
class ScrollView(vanilla.ScrollView): | |
def __init__(self, posSize, nsView, hasHorizontalScroller=True, hasVerticalScroller=True, | |
autohidesScrollers=False, backgroundColor=None, clipView=None, | |
drawsBackground=True): |
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 AppKit import * | |
icon = NSApp().applicationIconImage() | |
w, h = icon.size() | |
new = NSImage.alloc().initWithSize_((w, h)) | |
imageRect = NSMakeRect(0, 0, w, h) | |
new.lockFocus() |
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
f = CurrentFont() | |
print 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 lib.settings import defaultFontInfoAttributes | |
defaultFontInfoAttributes["descender"] = -200 | |
defaultFontInfoAttributes["ascender"] = 800 |
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 os | |
from fontTools.ttLib import TTFont | |
from mojo.events import addObserver | |
from ufo2fdk.fontInfoData import getAttrWithFallback | |
from ufo2fdk.outlineOTF import _roundInt | |
class FixBinaryOutput(object): | |
def __init__(self): |
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
Variable([ | |
dict(name="myVariable", ui="Slider", | |
args=dict( # add some vanilla Slider specific attributes | |
value=10, | |
minValue=0, | |
maxValue=100, | |
tickMarkCount=11, | |
stopOnTickMarks=True)), | |
], globals()) |
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 drawBot import * | |
from drawBot.ui.drawView import DrawView | |
from vanilla import * | |
class DrawBotViewer(object): | |
def __init__(self): | |
# create a window | |
self.w = Window((400, 400), minSize=(200, 200)) |