Skip to content

Instantly share code, notes, and snippets.

View eliheuer's full-sized avatar

Eli Heuer eliheuer

View GitHub Profile
@eliheuer
eliheuer / ar_name.py
Created April 10, 2019 20:47
ar_name.py
from fontTools.ttLib import TTFont
font = TTFont("TitilliumWeb-Roman-VF.ttf")
print(font)
glyphnames = font.getGlyphOrder()
def name_report(gns):
for i in gns:
print(i)
print("Glyph Count:", len(gns))
name_report(glyphnames)
@eliheuer
eliheuer / nametable-roman.py
Created April 10, 2019 20:48
nametable-roman.py
from fontTools.ttLib import TTFont
from fontTools.ttLib.tables._n_a_m_e import NameRecord
font = TTFont("TitilliumWeb-Roman-VF.ttf")
print(font)
myRecord = NameRecord()
myRecord.nameID = 128
myRecord.platformID = 64
@eliheuer
eliheuer / rename-italic.py
Created April 10, 2019 20:49
rename-italic.py
from fontTools.ttLib import TTFont
font = TTFont("TitilliumWeb-Italic-VF.ttf")
print(font)
glyphnames = font.getGlyphOrder()
new_glyphnames = [
name.replace(
"yehHamzaabove_yehHamzaabovear.fina", "yehHamzaabv_yehHamzaabvar.fina"
)
for name in glyphnames
@eliheuer
eliheuer / rename-roman.py
Created April 10, 2019 20:51
rename-roman.py
from fontTools.ttLib import TTFont
font = TTFont("TitilliumWeb-Roman-VF.ttf")
print(font)
glyphnames = font.getGlyphOrder()
def name_report(gns):
for i in gns:
print(i)
print("Glyph Count:", len(gns))
name_report(glyphnames)
@eliheuer
eliheuer / db.py
Created August 6, 2019 02:11
DrawBot sketch
# 📄 RENDER THIS DOCUMENT WITH DRAWBOT (Python 3): http://www.drawbot.com/
# 🌍 GIT URL: https://github.com/eliheuer/drawbot-sketchbok
from drawBot import *
import math
# [W] WIDTH, [H] HEIGHT, [M] MARGIN
W,H, M = 1000, 500, 20
# Set variation
@eliheuer
eliheuer / rumi.py
Created August 7, 2019 02:47
Rumi drawbot sketch
# 📄 RENDER THIS DOCUMENT WITH DRAWBOT (Python 3): http://www.drawbot.com/
# 🌍 GIT URL: https://github.com/eliheuer/drawbot-sketchbok
from drawBot import *
import math
# [W] WIDTH, [H] HEIGHT, [M] MARGIN
W,H,M = 1000,500,20
# EDGE
@eliheuer
eliheuer / image.py
Last active August 9, 2019 03:18
DrawBot Sketch
# 📄 RENDER THIS DOCUMENT WITH DRAWBOT (Python 3): http://www.drawbot.com/
from drawBot import *
import math
# [W] WIDTH, [H] HEIGHT, [M] MARGIN
W,H,M = 1024,512,64
# EDGE
def edge():
@eliheuer
eliheuer / bab.py
Created September 26, 2019 18:59
Báb poster: هل من مفرج غير الله قل سبحان الله هو الله كل عباد له و كل بامره قائمون
# RENDER THIS DOCUMENT WITH DRAWBOT: http://www.drawbot.com
# Typeface is Amiri: https://github.com/alif-type/amiri
from drawBot import *
import math
#[W]IDTH,[H]EIGHT,[M]ARGIN,[F]RAMES
W,H,M,F = 1224,792,72,72
# GRID
@eliheuer
eliheuer / basic-glyphs-anchors.py
Created November 13, 2019 18:55
Basic anchor placement script for GlyphsApp
from Foundation import NSPoint
layer = Glyphs.font.selectedLayers[0]
width = layer.bounds.size.width
center = int(width/2)
# make anchor at (0,0)
layer.anchors['top'] = GSAnchor()
layer.anchors['bottom'] = GSAnchor()
# set position
layer.anchors['top'].position = NSPoint(center, 800)
layer.anchors['bottom'].position = NSPoint(center, 0)
@eliheuer
eliheuer / ScienceGothicVF.txt
Created December 12, 2019 01:13
pyfontaine ScienceGothicVF.ttf output
Fonts
Font:
Filename: ScienceGothicVF.ttf
Common name: Science Gothic
Sub family: Regular
Weight: bold
Fixed width: no
Fixed sizes: no
Copyright: Copyright © 2019 Font Detective LLC.
License: Licensed under Open Font License 1.1, with no reserved font name.