Skip to content

Instantly share code, notes, and snippets.

View eliheuer's full-sized avatar

Eli Heuer eliheuer

View GitHub Profile
@eliheuer
eliheuer / ttfautohint-py-0.4.4.dev5+gb61154f.d20210520.zip.error
Created May 20, 2021 17:26
ttfautohint-py-0.4.4.dev5+gb61154f.d20210520.zip Error
MINI-M1 🌎 ~/Py/venvs
10926 ◯ : pip install ~/Downloads/ttfautohint-py-0.4.4.dev5+gb61154f.d20210520.zip [~]
Processing /Users/eli/Downloads/ttfautohint-py-0.4.4.dev5+gb61154f.d20210520.zip
Using legacy 'setup.py install' for ttfautohint-py, since package 'wheel' is not installed.
Installing collected packages: ttfautohint-py
Running setup.py install for ttfautohint-py ... error
ERROR: Command errored out with exit status 2:
command: /Users/eli/Py/venvs/ttfautohint-py-test/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ht/8b6qb9pj7csc3pn8bgwwx3j80000gn/T/pip-req-build-lqxf4cj6/setup.py'"'"'; __file__='"'"'/private/var/folders/ht/8b6qb9pj7csc3pn8bgwwx3j80000gn/T/pip-req-build-lqxf4cj6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'
from strictyaml import load, Map, Str, Int, Seq, YAMLError
yaml_snippet = '''
# All about the character
name: Ford Prefect
age: 42
possessions:
- Towel
- Pen
- Knife
@eliheuer
eliheuer / roman-II-arabic.rs
Last active October 26, 2020 07:59
Finds Roman numerals in titles and converts them to Arabic numerals(integers). A program made using only the Rust Standard Library.
/// Source: https://gist.github.com/eliheuer/6ae351536f016299c09910e841d64087
///
/// A program that takes a movie or game title from command-line arguments.
/// It then looks for Roman numerals represented by upper-case Latin characters.
/// Finally, it converts the Roman numerals to Hindu-Arabic numerals(integers)
/// and prints the converted title to the command line.
///
/// This program requires Rust to be installed: https://www.rust-lang.org/
/// And uses only the Rust Standard Library: https://doc.rust-lang.org/std/index.html
///
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
from fontTools.ttLib import TTFont
from fontTools.misc.textTools import num2binary
import sys
import os
def main():
for root, dirs, files in os.walk("."):
for file in files:
if file.endswith("[wght].ttf"):
#!/usr/bin/env python
# Run with a arg like so:
# $ python3 fsSelectionView.py testfont.ttf
from fontTools.ttLib import TTFont
from fontTools.misc.textTools import num2binary
import sys
def main(font_path):
font = TTFont(font_path)
os2 = font["OS/2"]
#!/usr/bin/env python3
from fontTools.ttLib import TTFont
import sys
def main(font_path):
font = TTFont(font_path)
namerecord_list = font["name"].names
for record in namerecord_list:
print(record.nameID)
print(dir(record))
@eliheuer
eliheuer / font-tests.py
Last active September 12, 2020 23:54
A small script for testing fonts WIP
import fire
from drawBot import *
def add(a: int, b: int):
"""
Returns sum of a and b
:param a: first argument
:param b: second argument
:return: sum of a and b
"""
@eliheuer
eliheuer / db-error-cairo.txt
Created March 17, 2020 21:46
Cairo diffbrowsers error
INFO:__main__:Running Diffbrowsers
INFO:diffbrowsers.gfregression:Posting fonts to GF Regression
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 534, in <module>
main()
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 511, in main
qa.googlefonts_upgrade()
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 270, in googlefonts_upgrade
self.diffbrowsers()
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 193, in diffbrowsers
@eliheuer
eliheuer / ScienceGothicVF-no-italic.txt
Created December 12, 2019 01:15
pyfontaine ScienceGothicVF-no-italic.ttf output
Fonts
Font:
Filename: ScienceGothicVF-no-italic.ttf
Common name: Science Gothic
Sub family: Medium
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.