Skip to content

Instantly share code, notes, and snippets.

// ../blink/src/third_party/llvm-build/Release+Asserts/bin/clang -std=c++11 -stdlib=libc++ -I../blink/src/skia/config -I../blink/src/third_party/skia/include -I../blink/src/third_party/skia/include/core -I../blink/src/third_party/skia/include/config -I../blink/src/third_party/skia/include/gpu -lstdc++ -L../blink/src/out/gndebug -lskia -Wl,-rpath,../blink/src/out/gndebug/ main.cpp -g -O1 -o noto_harfbuzz
#include "SkTypeface.h"
#include "SkString.h"
#include "SkSurface.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkStream.h"
int main() {
@drott
drott / hb_set_diff.patch
Created July 4, 2018 15:14
Hb Set differences 957e7756634a4fdf1654041e20e883cf964ecac9..2cb075fe26201f3e370fccfff6c1bc242b5acc79
diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh
index 3615c50e..ccd4d8df 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set-private.hh
@@ -158,21 +158,13 @@ struct hb_set_t
}
typedef unsigned long long elt_t;
- static const unsigned int PAGE_BITS = 1024;
+ static const unsigned int PAGE_BITS = 512;
@drott
drott / track_ot_coretext.py
Last active October 18, 2018 13:04
Quick script to overlay CoreText vs HB's own shaper for tracking
#!/usr/bin/env python3
import subprocess
from PIL import Image, ImageOps
import io
font_ptem_sizes = [
6,
9,
10,
11,
@drott
drott / gist:633d25c3c4a56e1070226822314b1aa3
Created November 6, 2018 07:23
AAT / OpenType tables in Mac Fonts
Bangla MN.ttc tables: ['kern', 'GPOS', 'GSUB', 'morx']
Bangla MN.ttc tables: ['kern', 'GPOS', 'morx']
Bangla Sangam MN.ttc tables: ['GPOS', 'GSUB', 'morx']
ChalkboardSE.ttc tables: ['kern', 'GPOS', 'GSUB', 'morx']
Cochin.ttc tables: ['kern', 'GPOS', 'GSUB', 'morx']
Cochin.ttc tables: ['kern', 'GPOS', 'morx']
Damascus.ttc tables: ['GSUB', 'morx']
DecoTypeNaskh.ttc tables: ['GSUB', 'morx']
Devanagari Sangam MN.ttc tables: ['GPOS', 'GSUB', 'morx']
Futura.ttc tables: ['kern', 'GPOS', 'GSUB', 'morx']
@drott
drott / ViewController.swift
Created November 22, 2018 13:43
Variable Color Font Rendering Issue Reproduction
//
// Variable Color Font Rendering Issue Reproduction
// ViewController.swift
//
import Cocoa
class ViewController: NSViewController {
final class Line: NSView {
override func draw(_ dirtyRect: NSRect) {
<trak>
<version value="1.0"/>
<format value="0"/>
<horizData>
<!-- nTracks=3, nSizes=20 -->
<trackEntry value="-1.0" nameIndex="291">
<track size="6.0" value="54"/>
<track size="9.0" value="10"/>
<track size="10.0" value="-4"/>
<track size="11.0" value="-16"/>
<trak>
<version value="1.0"/>
<format value="0"/>
<horizData>
<!-- nTracks=3, nSizes=20 -->
<trackEntry value="-1.0" nameIndex="291">
<track size="6.0" value="146"/>
<track size="9.0" value="102"/>
<track size="10.0" value="88"/>
<track size="11.0" value="76"/>
@drott
drott / gist:e95229e9b5dea5fafc6374c090575de8
Created January 18, 2019 17:36
Windows Build Failures
FAILED: obj/third_party/harfbuzz-ng/harfbuzz_source/hb-aat-layout.obj
C:\b\swarming\w\ir\cache\goma\client/gomacc.exe ../../third_party/llvm-build/Release+Asserts/bin/clang-cl.exe /nologo /showIncludes -imsvc..\..\third_party\depot_tools\win_toolchain\vs_files\818a152b3f1da991c1725d85be19a0f27af6bab4\win_sdk\Include\10.0.17763.0\um -imsvc..\..\third_party\depot_tools\win_toolchain\vs_files\818a152b3f1da991c1725d85be19a0f27af6bab4\win_sdk\Include\10.0.17763.0\shared -imsvc..\..\third_party\depot_tools\win_toolchain\vs_files\818a152b3f1da991c1725d85be19a0f27af6bab4\win_sdk\Include\10.0.17763.0\winrt -imsvc..\..\third_party\depot_tools\win_toolchain\vs_files\818a152b3f1da991c1725d85be19a0f27af6bab4\win_sdk\Include\10.0.17763.0\ucrt -imsvc..\..\third_party\depot_tools\win_toolchain\vs_files\818a152b3f1da991c1725d85be19a0f27af6bab4\VC\Tools\MSVC\14.16.27023\include -imsvc..\..\third_party\depot_tools\win_toolchain\vs_files\818a152b3f1da991c1725d85be19a0f27af6bab4\VC\Tools\MSVC\14.16.27023\atlmfc\include -DHAVE_O
@drott
drott / render_text_harfbuzz_patch.diff
Created September 26, 2019 10:15
Triggering logging on rematched typeface
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -796,11 +796,33 @@ bool TextRunHarfBuzz::FontParams::SetRenderParamsRematchFont(
// scenarios, as the fallback font may be of a different weight and style than
// the run's own, so this can lead to a failure of instantiating the correct
// fallback font.
+
+ sk_sp<SkTypeface> before_rematch;
+ PlatformFont* platform_font = new_font.platform_font();
+ if (platform_font) {
C:\src\yu>python3 -m fontTools.ttx -y0 -o- -tBASE YuGothR.ttc
Dumping "YuGothR.ttc" to "-"...
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.2">
Dumping 'BASE' table...
<BASE>
<Version value="0x00010000"/>
<HorizAxis>
<BaseTagList>