Skip to content

Instantly share code, notes, and snippets.

View be5invis's full-sized avatar

Belleve be5invis

View GitHub Profile
@be5invis
be5invis / 00--Results.md
Last active September 13, 2023 20:32
Haskell-ish AltJS performance test results

Candidates

  • JavaScript: Hand-written JavaScript.

  • Idris-codegen-es: Idris 1.0 with idris-codegen-es.

  • Idris (Official JS): Idris 1.0 with official JavaScript Codegen.

  • PureScript: Using Latest PureScript.

  • PureScript (Uncurried): Latest PureScript with Data.Function.Uncurry.

  • Idris (C): Idris 1.0 with C codegen on Windows x64.

  • C: Hand-written JavaScript, compiled with gcc 6.2.0, with Win64 settings and -O3.

CommandType Name Version Source
----------- ---- ------- ------
Alias Add-ProvisionedAppxPackage 3.0 Dism
Alias Apply-WindowsUnattend 3.0 Dism
Alias Disable-PhysicalDiskIndication 2.0.0.0 Storage
Alias Disable-StorageDiagnosticLog 2.0.0.0 Storage
Alias Enable-PhysicalDiskIndication 2.0.0.0 Storage
Alias
@be5invis
be5invis / autohint.js
Last active June 28, 2020 16:58
Automatic gridfit generator for Han characters.
var upm = 1000;
function Point(x, y, on, interpolated){
this.xori = x;
this.yori = y;
this.xtouch = x;
this.ytouch = y;
this.touched = false;
this.donttouch = false;
this.on = on;
// Algebra 1
interface ExprAlg1<E> {
lit(x: number): E;
add(a: E, b: E): E;
}
const Eval: ExprAlg1<number> = {
lit: x => x,
add: (a, b) => a + b
};
interface Expr1 extends Expr2 {
"use esnext";
const version = '3.0.0-alpha.2'
const shapes = {
'': ['Default', '', false, true],
slab: ['Slab', 'Slab', true, true],
curly: ['Curly', 'Curly', false, true],
'curly-slab': ['Curly Slab', 'Curly Slab', true, true],
ss01: ['Andale Mono Style', 'SS01'],
@be5invis
be5invis / ot-nga.md
Last active December 16, 2019 02:08

OpenType “Neo Geometry Architecture”

Static coordinate data

  • nKnots : UInt16 – Number of control knots in this contour set.
  • flags : StaticCoordFlag ^ nKnots – Flag array.
  • xData, yData : Bytes – Compressed X and Y coordinate data, driven by flags.

StaticCoordFlag

Assembly Alternatives Table ASMB

Assembly Alternatives Table (ASMB) defines the mechanism for complex justification, including Kashida. The principle is to associate assembly alternative lists to current glyphs. An assembly alternative list will have multiple glyph assemblies, being a glyph list with optional stretchable parts.

The table follows the structure of GSUB and GPOS. Listing lookups only.

Lookup type 1: Simple glue application

  • subtableFormat: UInt16: Format identifier: format = 1
  • coverage: Offset16 Coverage: Offset to Coverage table, from beginning of this subtable.

Breaking the 64K limit

  • The next font format (OpenType 2?) should support > 64K glyphs in one font.
  • GID will be 32-bit.
  • A “subset” table would be present to support legacy APIs that expect GID being 16-bit. It is a bijection between 16-bit “Legacy GID” and 32-bit “Real GID”.
  • Legacy API implementations should reject “OT2” fonts if the subset table is absent – which means this font is designed exclusively for new API.
  • A STAT-like mechanism will be used to “break down” an “OT2” font into a family of legacy-API-aware fonts.
  • When processing in legacy software…
    • TTF component references – if still supported – will reference to Real GID rather than Legacy GID.
  • CMAPGSUB, COLR, SVG entries involving glyphs outside the down-level subset will be ignored.
@be5invis
be5invis / interpreter.js
Last active July 1, 2019 11:26
A CPS-style S-exp interpreter (with call/cc)
function interpret(form, env, k){
if(form instanceof Array){
switch(form[0]){
case 'lambda': {
var params = form[1];
var body = form[2];
return k(function(k){ return function() {
var e = Object.create(env);
for(var j = 0; j < params.length; j++)
e[params[j]] = arguments[j];
@be5invis
be5invis / glyf-cubic-boolean-extension.md
Last active May 3, 2018 08:19
glyf Cubic & Boolean Extension