Skip to content

Instantly share code, notes, and snippets.

@anthrotype
anthrotype / scale_ufo.py
Last active Jun 4, 2020
Script that uses ufo2ft (>= 2.14) TransformationsFilter to scale the UPEM of a UFO
View scale_ufo.py
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@khaledhosny
khaledhosny / cldr-coverage.py
Last active May 8, 2020
Calculate font script and language coverage based on ICU exemplar data
View cldr-coverage.py
# Copyright 2020 Khaled Hosny
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@kylehowells
kylehowells / ast2text.py
Last active Jan 14, 2020
Extract the plain text from markdown, for plain text search.
View ast2text.py
import commonmark
with open('test.md', 'r') as myfile:
text = myfile.read()
parser = commonmark.Parser()
ast = parser.parse(text)
# Returns the text from markdown, stripped of the markdown syntax itself
def ast2text(astNode):
@arrowtype
arrowtype / README.md
Last active Feb 1, 2020
This is a set of Python I use many times I wish to make an animation or multipage doc with Drawbot, but coded in my preferred editor (currently, VS Code)
View README.md

Using Drawbot in an external editor

This is a set of Python I use many times I wish to make an animation or multipage doc with Drawbot, but code in my preferred editor (currently, VS Code) rather than in the Drawbot app.

Usage

First, install DrawBot as a module:

pip install git+https://github.com/typemytype/drawbot
@mjlagattuta
mjlagattuta / fixBrackets.py
Last active Jul 16, 2019
Setup glyphs file with bracket layers for fontmake build, and generate a python file to run on the final ttf to add the feature vars
View fixBrackets.py
# Copyright 2019 Michael LaGattuta
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@gramian
gramian / hack4tex
Last active Apr 23, 2017
A small script to use the hack truetype font in pdflatex
View hack4tex
#!/bin/sh
# hack4tex 0.1
# Copyright (c) 2016 Christian Himpe
# released under BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause )
# based on Stephan Lehmke's answer to "How do I use TrueType Fonts with PDFTeX
# using otftotfm?" on tex.stackexchange.com/a/52902
#
# requires otftotfm which is part of lcdf-typetools
#
@leonbreedt
leonbreedt / FontPreview.swift
Last active Jul 13, 2018
Render font from command line on OS X without requiring font to be installed.
View FontPreview.swift
//
// FontPreview
// Copyright © 2018 Leon Breedt
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
View Basic UFO Master Comparison in RoboFont DrawBot extension
# design settings
gutter = 60
radius = 6
pageW = 1600
# draw filled outline or contours
contour = False
# draw nodes and bluezones and vertical metrics?
@PurpleBooth
PurpleBooth / README-Template.md
Last active Jul 2, 2020
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@XVilka
XVilka / TrueColour.md
Last active Jul 2, 2020
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
You can’t perform that action at this time.