Skip to content

Instantly share code, notes, and snippets.

View guidoferreyra's full-sized avatar

Guido Ferreyra guidoferreyra

View GitHub Profile
@connordavenport
connordavenport / bitmapFont-Drawbot.py
Last active January 26, 2024 06:29
bitmapFont-Drawbot
w = h = 1000
newPage(w,h)
fill(0)
rect(0,0,w,h)
# -------- change these -------- #
pixelSize = 7
copy = "Testing"
@frankrolf
frankrolf / which_kerning_group.py
Created August 12, 2020 09:30
Robofont: startup script to find out which kerning group the selected glyph belongs to
'''
Robofont startup script to find out which kerning group
the selected glyph belongs to.
'''
import AppKit
from mojo.UI import CurrentFontWindow
from mojo.events import addObserver
from mojo.roboFont import CurrentFont
@arrowtype
arrowtype / getting-started-in-type-design.md
Last active October 9, 2024 03:31
Some tips for getting started in type design, plus a few favorite extensions and tools

Getting started in Type Design (and possible next steps)

So, you’re interested in type design, but you are still figuring out how & where to start or get to the next step. This post is a non-exhaustive attempt to share an overview of how you might learn some basics, how you can get started with font editing software, and where you might consider growing your skills after that. It reflects my bias and (some of) my personal experience, and it completely skips important topics like formal education, calligraphy and sketching, bezier drawing tips, and more.

This started as an email listing my favorite RoboFont extensions, and then I thought that it would be worth sharing publicly, and then I added more and it turned into a bigger post. In the future, I hope to bring it onto a proper blog as a collection of separate, more-focused topics.

General learning

Useful Internet resources

import os
import shutil
from mojo.events import addObserver
"""
Goal: Create a UFOZ automatically when a UFO is saved.
Off the top of my head, I can think of a few ways to do this:
1. Make a copy of the font object, save as UFOZ, discard the
@okay-type
okay-type / send-email.py
Created May 16, 2019 21:32
send email from python
import smtplib
# this uses a burner gmail account to send from
# I use this to email my phone's sms email
email = '[email protected]'
text = 'hello sms'
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login('[email protected]', 'password')
server.sendmail('Robofont', email, text)
@jenskutilek
jenskutilek / avar-slant.py
Last active May 8, 2024 21:53
Axis variation mapping generator for the slant axis
#!/usr/bin/env python
# coding: utf-8
from __future__ import division, print_function
from math import atan, pi, tan
# Spit out some mappings for the slant axis to get closer to actual degrees.
#print(angle,
# atan(
# tan(slant * pi / 180) / (slant / angle)
@abalter
abalter / argparse1.md
Last active December 10, 2024 15:43
Python Aargparsing Examples

http://stackoverflow.com/a/30493366/188963

Other answers do mention that argparse is the way to go for new Python, but do not give usage examples. For completeness, here is a short summary of how to use argparse:

1) Initialize

import argparse

# Instantiate the parser

parser = argparse.ArgumentParser(description='Optional app description')

@th0ma5w
th0ma5w / easing.py
Created March 31, 2014 01:32
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b
@gferreira
gferreira / find-bezier-point-2.py
Last active April 18, 2019 22:16
translation along a path
'''draw a range of shapes along a bezier segment'''
# converted from:
# http://13thparallel.com/archive/bezier-curves/
def B1(t): return t*t*t
def B2(t): return 3*t*t*(1-t)
def B3(t): return 3*t*(1-t)*(1-t)
def B4(t): return (1-t)*(1-t)*(1-t)
@typemytype
typemytype / swapper.py
Created March 3, 2014 16:20
swap bottom/top part of all glyphs in a font :)
g = CurrentGlyph()
f = CurrentFont()
for g in f:
box = g.box
if box is None: