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
g = CurrentGlyph() | |
f = CurrentFont() | |
for g in f: | |
box = g.box | |
if box is None: |
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
from fontTools.pens.basePen import BasePen | |
class MyPen(BasePen): | |
def _moveTo(self, pt): | |
print "move to", pt | |
def _lineTo(self, pt): | |
print "line to", pt |
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
from robofab.pens.pointPen import AbstractPointPen, PrintingPointPen | |
from robofab.pens.adapterPens import SegmentToPointPen | |
from lib.tools.bezierTools import intersectRayRay | |
class ReconvertSplinePointPen(AbstractPointPen): | |
def __init__(self, outPointPen): | |
self.outPointPen = outPointPen | |
def beginPath(self): |
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
path = u"path/to/file" | |
from AppKit import * | |
fm = NSFileManager.defaultManager() | |
attr, error = fm.attributesOfItemAtPath_error_(path, None) | |
print attr[NSFileCreationDate] | |
print attr[NSFileModificationDate] |
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
from fontTools.pens.basePen import BasePen | |
def pointOnCurve(p1, c1, c2, p2, value): | |
dx = p1[0] | |
cx = (c1[0] - dx) * 3.0 | |
bx = (c2[0] - c1[0]) * 3.0 - cx | |
ax = p2[0] - dx - cx - bx | |
dy = p1[1] | |
cy = (c1[1] - dy) * 3.0 |
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
import vanilla | |
from AppKit import * | |
""" | |
for the demo some vanilla objects are subclassed | |
- the main change would be in the VanillaBaseObject | |
- a window, sheet, group, popover (all elements that can set vanillaObjects) could have a addConstraints attribute | |
- map the attribute name and the view automatically whenever the posSize is "auto" | |
- the constraint cannot be a replacement of the posSize cause it the constraint Visual Format Language is a discription of a complete UI. |
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
from drawBot import * | |
from drawBot.ui.drawView import DrawView | |
from vanilla import * | |
class Previewer(object): | |
def __init__(self): | |
# setup the window | |
self.w = Window((400, 400), "Previewer", minSize=(200, 200)) |
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
""" | |
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 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 = {} |
OlderNewer