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 pathops | |
| from booleanOperations.booleanOperationManager import BooleanOperationManager | |
| import time | |
| import math | |
| print("pathops version:", pathops.__version__) | |
| f = CurrentFont() |
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
| # url to the image | |
| path = 'https://pbs.twimg.com/media/DgwanJqXUAA9847.jpg' | |
| # amount of frames | |
| frames = 30 | |
| # scaling (the image is big) | |
| sc = 0.08 | |
| # get the image size | |
| w, h = imageSize(path) | |
| #start the loop | |
| for i in range(frames): |
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 sys | |
| sys.path.insert(0, '/Users/frederik/Downloads/fonttools-ufoLib/Lib') | |
| import os | |
| import shutil | |
| import ufoLib | |
| from fontTools.pens.basePen import NullPen | |
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 | |
| import shutil | |
| import AppKit | |
| import attr | |
| from plistlib import readPlist, writePlist | |
| from distutils.version import LooseVersion | |
| import tempfile | |
| from drawBot.scriptTools import ScriptRunner |
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 AppKit | |
| speaker = "com.apple.speech.synthesis.voice.BadNews" | |
| voice = AppKit.NSSpeechSynthesizer.alloc().initWithVoice_(speaker) | |
| voice.startSpeakingString_("awful spacing") |
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
| characters = u"345678" | |
| format = "A4" | |
| margin = 10 | |
| t = FormattedString() | |
| for fontName in installedFonts(characters): | |
| t.font(fontName) | |
| t += characters |
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
| margin = 30 | |
| fontName = "CooperBlackStd" | |
| newPage("A4") | |
| t = FormattedString(font=fontName) | |
| glyphNames = t.listFontGlyphNames() | |
| t.appendGlyph(*glyphNames) | |
| textBox(t, (margin, margin, width()-margin*2, height()-margin*2)) |
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.pens.basePen import BasePen | |
| program = """void draw(SkCanvas* canvas) { | |
| SkPaint paint; | |
| SkPath path, dummy, result; | |
| SkOpBuilder builder; | |
| paint.setAntiAlias(true); | |
| path.setFillType(SkPath::kWinding_FillType); | |
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 time | |
| import os | |
| repeat = 10000 | |
| notExistingPath = u"test-non-existing.txt" | |
| existingPath = 'test-exsisting.txt' |
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 vanilla | |
| import AppKit | |
| class _CheckBoxManualBuild(vanilla.vanillaCheckBox._CheckBoxManualBuild): | |
| # both the container view and the check box will be adjusted. | |
| # this is necessary to create the appropriate buffer | |
| # and to handle the alignment. |