Skip to content

Instantly share code, notes, and snippets.

@rsheeter
rsheeter / how_to_diff.sh
Created November 8, 2023 17:18
How to ttx_diff
# starting from a directory with both fontc and oswald
git clone git@github.com:googlefonts/fontc.git
git clone git@github.com:googlefonts/OswaldFont.git
cd fontc
# establish a virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r resources/scripts/requirements.txt
@rsheeter
rsheeter / colr_demo_no_chrome.sh
Last active July 10, 2020 03:48
Compile drott color demo w/o Chrome source
# NOTE: prefer https://github.com/rsheeter/skia_colr/tree/colr_test, build_mac_colr.sh
git clone https://skia.googlesource.com/skia
cd skia
# download https://skia-review.googlesource.com/c/skia/+/300558
# What I actually did: click download, http, and take the Branch example, e.g:
# git fetch "https://skia.googlesource.com/skia" refs/changes/58/300558/2 && git checkout -b change-300558 FETCH_HEAD
@rsheeter
rsheeter / MyFontProvider.java
Created February 6, 2019 22:35
Fonts ContentProvider
// Notes on ContentProvider to fulfil requests for fonts, such as from FontsContractCompat.
// Not all imports shown
import android.provider.FontsContract.Columns;
public abstract class MyFontProvider extends ContentProvider {
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
String query = selectionArgs[0]; // change based on your input pattern
@rsheeter
rsheeter / README.txt
Created February 4, 2019 19:19
Progressive Enrichment Demo Notes
Notes on server-side of https://fonts.gstatic.com/experimental/incxfer_demo
- it's currently tied to Google internal serving so just open sourcing code isn't helpful
/experimental/incxfer, args:
- font - string identifying font, e.g. Lobster:400
- cp_current - csv of codepoints UA has
- cp_needed - csv of codepoints UA would like to have
- retain_gids - whether gids should be stable
- diff_type - lets demo support different diff algorithms
@rsheeter
rsheeter / gist:5b692cf56eb5d8d54bfe
Created March 13, 2015 19:28
A font that fails OTS in TTX form
<?xml version="1.0" encoding="utf-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="2.4">
<GlyphOrder>
<!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
<GlyphID id="0" name=".notdef"/>
<GlyphID id="1" name="space"/>
</GlyphOrder>
<head>