This file contains 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
const width = 1000; | |
const height = 1000; | |
const background = '#f1f1f1'; | |
const canvas = document.createElement('canvas'); | |
canvas.width = width; | |
canvas.height = height; | |
const ctx = canvas.getContext('2d'); | |
ctx.fillStyle = background; |
This file contains 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
import { readFileSync } from 'fs'; | |
import postcss from 'postcss'; | |
const customMediaNameRegExp = /^custom-media$/i; | |
const customMediaParamsRegExp = /^(--[A-z][\w-]*)\s+([\W\w]+)\s*$/; | |
const customMediaValueRegExp = /min-width:[ ]?([0-9]+px|rem|em)/; | |
/** | |
* @param {import('postcss').Node} node | |
* @returns boolean |
This file contains 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
var path; | |
var penAngle = -20; | |
var textItem = new PointText(new Point(20, 30)); | |
textItem.fillColor = 'black'; | |
textItem.content = 'Click and drag to draw a line.'; | |
function onMouseDown(event) { | |
// If we produced a path before, deselect it: | |
if (path) { |
This file contains 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
// For exporting the video | |
import com.hamoid.*; | |
static final int NUM_LINES = 20; | |
float t; | |
VideoExport videoExport; | |
void setup() { | |
size(500, 500); |
This file contains 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
print "Name\t\t\tMax\t\t\tMin" | |
for thisLayer in Glyphs.font.selectedLayers: | |
capHeight = Glyphs.font.masters[thisLayer.associatedMasterId].capHeight | |
xHeight = Glyphs.font.masters[thisLayer.associatedMasterId].xHeight | |
ascender = Glyphs.font.masters[thisLayer.associatedMasterId].ascender | |
maxY = 0 | |
minY = 1000 | |
for path in thisLayer.paths: | |
for node in path.nodes: |
This file contains 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
scale = 1.166666667 | |
for char in Glyphs.font.selectedLayers: | |
if char.LSB < 0: | |
char.LSB = round(char.LSB/scale) | |
else: | |
char.LSB = round(char.LSB*scale) | |
if char.RSB < 0: | |
char.RSB = round(char.RSB/scale) | |
else: |
This file contains 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
// Wrap the quotes | |
// in language specific | |
// quotation marks if a | |
// language is specified | |
// --------------------- | |
// German Quotes | |
.c-quote--german &, | |
html:lang(de) & | |
&::before | |
content: '„' |
This file contains 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
// These default values could be overwritten in a potentially cleaned up global config file ;-) | |
$transition--easing: cubic-bezier(0.4, 0, 0.2, 1) !default | |
$transition--slow: '0.2s 0.1s' !default | |
$transition--fast: '0.1s' !default | |
// The main mixin | |
=transition($speed, $properties...) | |
$transitions: () | |
// Timing is fast, unless 'slow' is specified |
This file contains 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
# Linter Options | |
options: | |
merge-default-rules: false | |
formatter: stylish | |
max-warnings: 50 | |
# File Options | |
files: | |
include: '**/*.s+(a|c)ss' |
This file contains 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
# type your Python code here and press cmd+Return to run. | |
reference = "n" | |
glyph = Glyphs.font.glyphs[reference].layers[0] | |
referenceWidth = glyph.width - glyph.LSB - glyph.RSB | |
print "Reference:", reference, referenceWidth | |
for char in ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]: | |
curGlyph = Glyphs.font.glyphs[char].layers[0] | |
width = curGlyph.width - curGlyph.LSB - curGlyph.RSB |
NewerOlder