This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Add Google Calendar links to TypeLab 2022 | |
To use: | |
1️⃣ Visit https://2022.typographics.com/typelab/ in your desktop web browser | |
2️⃣ (Chrome) View > Developer > JavaScript Console | |
2️⃣ (Firefox) Tools > Browser Tools > Browser Console | |
2️⃣ (Safari) Develop > Show JavaScript Console | |
3️⃣ Copy the code below and paste into the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Player Sans Mono Bold'; | |
src: url('PlayerSansMono8x13-Bold.woff2') format('woff2'); | |
font-display: swap; | |
} | |
body { | |
margin: 0; | |
padding: 2em; | |
} | |
samp { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add units to a number | |
function addUnits(n, unitsFormat) { | |
return unitsFormat.replace('{}',n); | |
} | |
// Slider slide event | |
function slide(event, samp) { | |
// Apply style to samp | |
samp.style[event.srcElement.dataset.prop] = addUnits(event.srcElement.value, event.srcElement.dataset.units); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, minimum-scale=1.0'> | |
<title>Type Tester Demo</title> | |
<link rel='stylesheet' type='text/css' href='typetester.css'> | |
<script type='module' src='typetester.js'></script> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find the wrapper and create some elements to put in it | |
const tt = document.querySelector('.tt_wrapper'); | |
const sliders = {}; | |
sliders.size = document.createElement('input'); | |
const numboxes = {}; | |
numboxes.size = document.createElement('input'); | |
const samp = document.createElement('samp'); | |
// Clear the contents of .tt_wrapper | |
tt.innerHTML = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fontTools.ttLib import TTFont | |
from fontTools.ttLib.tables._g_l_y_f import Glyph | |
f = TTFont('Font.ttf') | |
assert 'glyf' in f and 'gvar' not in f, 'Must be a static font with a `glyf` table.' | |
for name in f['glyf'].keys(): | |
if not f['glyf'][name].isComposite(): | |
f['glyf'][name] = Glyph() | |
f.save('Font-Regular-Blank.ttf') |