Skip to content

Instantly share code, notes, and snippets.

View connordavenport's full-sized avatar

Connor Davenport connordavenport

View GitHub Profile
@justvanrossum
justvanrossum / rename_fea_glyphs.py
Last active May 21, 2024 13:32
Rename glyph names in OpenType feature files
from functools import singledispatch
from io import StringIO
from fontTools.feaLib import ast
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.parser import Parser
def renameGlyphs(feaSource, renameFunc, glyphNames=()):
features = Parser(StringIO(feaSource), glyphNames=glyphNames).parse()
@typemytype
typemytype / markdownNSAttributedString.py
Created July 27, 2023 11:17
markdown with NSAttributedString for drawBot
md = """
# title
## sub title
*foo*
__italic foo__
[our website](https://example.com).

OpenType font name table notes

Provided are the name table record ID and instructions on how to fill it out. Arial is used as an example to show how the names records can be filled. You can see the example records here:

https://learn.microsoft.com/en-us/typography/opentype/spec/namesmp

There are also more exmaples added to the bottom of this file.

Why this document?

@okay-type
okay-type / ItalicAnglessss.py
Last active April 7, 2023 13:42
A hack to see different italic angles when drawing a ufo
from mojo.subscriber import Subscriber, registerRoboFontSubscriber
'''
Italic angles are complicated.
Technically, they don't really exist.
They're constructed by font editors to make drawing slanted things more consistent.
It's very helpful.
from mojo.UI import *
"""
RoboFont Script
- Type: Composites
- Purpose: To create RoboFont glyph construction syntax out of the exisiting
composites inside a font using the anchor names.
- Specifications:
- Determines the base letter and marks according to anchor names.
- Reconstruct the glyphConstruction syntax from the anchor names.
- Publish Date: 7 Dec 2020
@IanColdwater
IanColdwater / twittermute.txt
Last active November 17, 2024 02:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@frankrolf
frankrolf / unicats.py
Last active February 10, 2021 13:47
Select Unicode categories in Robofont 3
from mojo.UI import CurrentFontWindow
import unicodedata
import AppKit
from vanilla import CheckBox, FloatingWindow, List
category_to_codepoints = {}
for code_point in range(0, 0xFFFF + 1):
category = unicodedata.category(chr(code_point))