Skip to content

Instantly share code, notes, and snippets.

View bramstein's full-sized avatar

Bram Stein bramstein

View GitHub Profile
<!doctype html>
<html>
<head>
<title>Chrome 33 web font bug</title>
<style>
@font-face {
font-family: TestFont;
/* This is not a real web font, but close enough
to trick browsers into thinking it is. */
src: url(data:font/opentype;base64,);

Syntax

This proposal introduces a new text-kerning property:

text-kerning: [ <upoint> <upoint> <length> ] #

The <upoint> pairs are the left and right code points of a kerning pair and <value> is the kern value. Kerning pairs and values can be repeated multiple times by separating them with a comma. Kerning is applied to all unicode code point pairs in an element that match the kerning pairs specified in the text-kerning property of that element.

@bramstein
bramstein / gist:4031971
Created November 7, 2012 14:37
Test for font fallback bug in Webkit
function detectWebkitFallbackBug() {
var el = document.createElement('div'),
style = document.createElement('style'),
width = 0,
hasBug = false;
style.innerHTML = "@font-face{font-family:'__test__';src:url(data:application/x-font-woff;base64,) format('woff'),url(data:font/truetype;base64,) format('truetype');}";
el.style.cssText = 'position:absolute;font-family:monospace;font-size:20px;';
el.innerHTML = 'iii';
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<style>
.example {
width: 3500px;
font-family: 'times new roman', 'FreeSerif', serif;
font-size: 140px;
<!doctype html>
<html>
<head>
<script src="mock.js"></script>
<script src="array.js"></script>
<script src="dom.js"></script>
<script src="object.js"></script>
<script src="template.js"></script>
<script src="../1.js"></script>
<script src="../2.js"></script>
<!doctype html>
<html>
<head>
<script src="tempo.js"></script>
<script src="../1.js"></script>
<script src="../2.js"></script>
<script src="../3.js"></script>
<script>
window.onload = function () {
Tempo.prepare('t1').render(v1);
<!doctype html>
<html>
<head>
<script src="mustache.js"></script>
<script src="../1.js"></script>
<script src="../2.js"></script>
<script src="../3.js"></script>
<script>
window.onload = function () {
var e1 = document.getElementById('t1'),
<!doctype html>
<html>
<head>
<script src="mustache.js"></script>
<script src="../1.js"></script>
<script src="../2.js"></script>
<script src="../3.js"></script>
<script>
window.onload = function () {
var e1 = document.getElementById('t1'),

A Treesaver document can contain one or more individual articles:

<body>
  <article id="first">
  </article>
  <article id="second">
  </article>
</body>

These articles will be shown in the order they are declared in. Articles can link to other articles by identifier. So in the above example, the first article can link to the second one with <a href="#second">...</a>.

@bramstein
bramstein / Treesaver TOC
Created April 28, 2011 10:07
New and simplified Treesaver Table Of Contents
A Treesaver document can contain one or more individual articles:
<body>
<article id="first">
</article>
<article id="second">
</article>
</body>
These articles will be shown in the order they are declared in. Articles can link to other articles by identifier. So in the above example, the first article can link to the second one with `<a href="#second">...</a>`.