Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View behdad's full-sized avatar

Behdad Esfahbod behdad

View GitHub Profile
@behdad
behdad / gist:d08f958f8a5e2cb6badf6e32598427df
Created August 18, 2020 17:48
2016-02-13 Peter Constable opentype-layout smoking-gun message
Vlad:
I don’t see any attachment, and I have no idea what is in this amendment other than the little I glean from glancing over this thread.
Actually, I have no idea what’s been going into OFF for some time, though granted, I was out of this space for a while and only came back into it in the past year or so. However, I’ve been working on the DirectWrite platform in Windows during this time, and can say I’m not aware of anything that has gone into DirectWrite in that time that pertains to recent amendments to OFF except, perhaps, things related to USE. (DWrite has been picking up our shaping library from Andrew’s team.)
My concern is with changes going into OFF without knowing what the status is of platforms that actually implement support for OpenType fonts. And quite frankly, I’m SHOCKED to see that there are changes to the OS/2 table being rushed into OFF that Microsoft has not review.
I don’t see any indication of discussion in this list of a new OS/2 version with a usTypoWeightClass field. This mail thre

Keybase proof

I hereby claim:

  • I am behdad on github.
  • I am behdad (https://keybase.io/behdad) on keybase.
  • I have a public key whose fingerprint is C115 E6AE D747 7C7B DFC7 0F94 A426 3A73 9C48 7211

To claim this, I am signing this object:

@behdad
behdad / py
Created June 2, 2020 17:11
unionfind.py
from __future__ import print_function, division, absolute_import
#from fontTools.misc.py23 import *
class UnionFind(object):
def __init__(self, items):
self._sets = dict((x,set([x])) for x in items)
self._map = dict((x,x) for x in items)
def _union_pair(self, a, b):
diff --cc src/hb-ot-layout-gsub-table.hh
index 364ef189,364ef189..4de505aa
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@@ -899,8 -899,8 +899,31 @@@ struct LigatureSubstFormat
bool subset (hb_subset_context_t *c) const
{
TRACE_SUBSET (this);
-- // TODO(subset)
-- return_trace (false);
diff --git a/Lib/fontTools/subset/__init__.py b/Lib/fontTools/subset/__init__.py
index 2ed17cc9..22d1e371 100644
--- a/Lib/fontTools/subset/__init__.py
+++ b/Lib/fontTools/subset/__init__.py
@@ -1719,6 +1719,8 @@ def subset_glyphs(self, s):
@_add_method(ttLib.getTableClass('hmtx'))
def subset_glyphs(self, s):
self.metrics = _dict_subset(self.metrics, s.glyphs)
+ for g in s.glyphs_emptied:
+ self.metrics[g] = (0,0)
diff --git a/Lib/fontTools/varLib/__init__.py b/Lib/fontTools/varLib/__init__.py
index 5f0f9bd2..1fd0320b 100644
--- a/Lib/fontTools/varLib/__init__.py
+++ b/Lib/fontTools/varLib/__init__.py
@@ -289,7 +289,10 @@ def _add_gvar(font, model, master_ttfs, tolerance=0.5, optimize=True):
gvar.reserved = 0
gvar.variations = {}
- for glyph in font.getGlyphOrder():
+ glyphs = font.getGlyphOrder()
/* Simple example to use pangocairo to render rotated text */
#include <math.h>
#include <pango/pangocairo.h>
static void
draw_text (cairo_t *cr)
{
#define RADIUS 200
#define N_WORDS 20
#!/bin/bash
time for x in */img*.jpg; do
out=`dirname $x`/4`basename $x`
if test -f $out; then
echo Skipping $x
else
echo $x
time convert -geometry 25% \
-pointsize 36 -fill white \
@behdad
behdad / gist:149ae8947c11afddc560
Created May 1, 2015 17:21
UNSAFE_TO_BREAK patch
commit aa2e899700e3c301b7a4ce93689a7803e4e8bef9
Merge: cf3afd8 7c40225
Author: Behdad Esfahbod <behdad@behdad.org>
Date: Fri Oct 26 12:24:14 2012 -0700
WIP on master: cf3afd8 Rename and revamp is_zero_width() to be is_default_ignorable()
diff --cc src/hb-buffer.cc
index 2f8f511,2f8f511..884acee
--- a/src/hb-buffer.cc

Keybase proof

I hereby claim:

  • I am behdad on github.
  • I am behdad (https://keybase.io/behdad) on keybase.
  • I have a public key whose fingerprint is 2277 650A 4E8B DFE4 B7F6 BE41 9FEE 04E5 D353 1115

To claim this, I am signing this object: