Skip to content

Instantly share code, notes, and snippets.

View graphicore's full-sized avatar
🎯
Focusing then blurring again …

Lasse Fister graphicore

🎯
Focusing then blurring again …
View GitHub Profile
javascript:void((function%20()%7Bvar%20collected%20=%20new%20Map(),%20unique%20=%20new%20Map(),%20tags%20=%20Symbol('tags'),%20size%20=%20Symbol('size');for(elem%20of%20document.getElementsByTagName(%22*%22))%20%7Blet%20computed%20=%20window.getComputedStyle(elem,null);if%20(computed.display%20===%20'none')continue;if(elem.offsetParent%20===%20null%20&&%20computed.position%20!==%20'fixed')/*%20a%20parent%20node%20is%20hidden%20*/continue;if(!Array.from(elem.childNodes).some(node=%3E/*%20is%20a%20text%20Node%20*/node.nodeType%20===%20Node.TEXT_NODE%20&&/*%20only%20whitespace*/node.wholeText.trim()%20!==%20''))continue;let%20fontFamily%20=%20computed.getPropertyValue('font-family'),%20fontSize%20=%20computed.getPropertyValue('font-size'),%20fontWeight%20=%20computed.getPropertyValue('font-weight'),%20fontStyle%20=%20computed.getPropertyValue('font-style'),%20fontVariationSettings%20=%20computed.getPropertyValue('font-variation-settings'),%20key%20=%20%60$%7BfontFamily%7D%60,%20id%20=%20%5BfontSize,%20fontFamily
@graphicore
graphicore / ttfont-decompile.py
Created February 20, 2019 17:41
Used to plot memory usage with `mprof` (python memory-profiler)
#!/usr/bin/env python
from fontTools.ttLib import TTFont
# using sleep to
from time import sleep
import sys
if __name__ == '__main__':
fonts = [font for font in sys.argv if font.endswith('tf')]
ttfonts = []
// jshint esversion:6
const NodeGit = require('nodegit')
, path = require('path')
, MAX_PARALLEL_JOBS = 8
, REPOSITORY_BASE_PATH = '/tmp/node_git_bug_1495'
;
/**
* Expecting typical github urls here, like: "https://github.com/username/projectname"
* returns REPOSITORY_BASE_PATH + "/username_projectname"
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Glyph Table</title>
<script src="../../../lib/bower_components/requirejs/require.js"></script>
<script>
fontFiles = [
'../../assets/fonts/Jura-Medium.ttf'
, '../../assets/fonts/MontserratAlternates-Bold.ttf'
@graphicore
graphicore / languageCoverage.txt
Created February 2, 2017 21:43
Additional info for an issue on google/fonts
googleFontsTools/encodings/oriya_unique-glyphs.nam
lax language detection: true
language: Malayalam 1 % having: 1 needed: 95 missing: 94 ("ഃ" U+0d03,"അ" U+0d05,"ആ" U+0d06,"ഇ" U+0d07,"ഈ" U+0d08,"ഉ" U+0d09,"ഊ" U+0d0a,"ഋ" U+0d0b,"ൠ" U+0d60,"ഌ" U+0d0c … and 84 more) laxSkipped: 0
======================
googleFontsTools/encodings/gurmukhi_unique-glyphs.nam
lax language detection: true
language: Punjabi 71 % having: 68 needed: 96 missing: 28 ("\" U+005c,"u" U+0075,"0" U+0030,"A" U+0041,"3" U+0033,"C" U+0043,"U" U+0055,"-" U+002d,"–" U+2013,"—" U+2014 … and 18 more) laxSkipped: 3
language: Malayalam 1 % having: 1 needed: 95 missing: 94 ("ഃ" U+0d03,"അ" U+0d05,"ആ" U+0d06,"ഇ" U+0d07,"ഈ" U+0d08,"ഉ" U+0d09,"ഊ" U+0d0a,"ഋ" U+0d0b,"ൠ" U+0d60,"ഌ" U+0d0c … and 84 more) laxSkipped: 0
======================
googleFontsTools/encodings/kannada_unique-glyphs.nam
# This are the commands used to update https://github.com/graphicore/googleFontsTools
# This file is stored externally, so we can run the commands like this without having to
# care for new commits from us in the forked repository.
# git remote add upstream git@github.com:google/fonts.git
git fetch -f upstream master
git checkout -b fonts upstream/master
git filter-branch -f --subdirectory-filter tools --prune-empty -- --all
git checkout master
git rebase fonts
@graphicore
graphicore / FontLister.js
Last active December 15, 2016 14:44
Proposal for a fontLister widget, based on https://github.com/graphicore/specimenTools/issues/7 ff.
define([
'specimenTools/_BaseWidget'
], function(
Parent
) {
"use strict";
/**
* Very basic <select> interface to switch between all loaded fonts.
* See FamilyChooser for a more advanced interface.
@graphicore
graphicore / ftxvalidator
Last active December 5, 2016 12:20
ftxvalidator drop in replacement: Execute the Mac OS tool `ftxvalidator` on a remote host.
#! /bin/bash
# Copyright 2016 Lasse Fister <commander@graphicore.de>
#
# 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
@graphicore
graphicore / dumped.fea
Last active April 7, 2023 03:46
Sample output of $ ft2feaCLI.py fontfile.otf > dumped.fea
languagesystem DFLT dflt;
languagesystem arab dflt;
languagesystem arab ARA;
languagesystem arab URD;
#### Table GDEF ####
# GDEF Mark Attachment Classes:
@MarkAttachClass_2 = [ uniFBBC uniFBBB uniFBBF uniFBBE uni08E9 uni0664.below TahSmallTwoDotsbelowar uniFBB3 uniFBB7 uniFBB5 uniFBB9 uni065E uni065F uni065C uniFBC1 uni064D uni0655 uni0656 uni0650 uni0655064D uni06E6 uni06E3 uni06ED uni08F6 uni08F2 uni0662.below dots.horz.belowar uni06550650 vbelowar ];
@graphicore
graphicore / memoize
Last active August 29, 2015 14:08
draft of a generic caching interface
function Constructor(){}
var _p = Constructor.prototype;
p._rawMethod = function(name){}
_p.cachedMethod = memoize(p._rawMethod);
//memoize module
var _CACHE = new WeakMap();