• Stars
    star
    797
  • Rank 57,151 (Top 2 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Adds OpenType features—ligatures, kerning, and more—to Normalize.css.

Note You might also like my more recent take on this project, Utility OpenType: CSS utility classes for advanced typographic features.


Normalize-OpenType.css wordmark


Normalize-OpenType.css

Adds OpenType features—ligatures, kerning, and more—to Normalize.css.

Read the blog post: Introducing Normalize-OpenType.css

Get the latest version of the CSS file

Or use

npm install normalize-opentype.css

Ligatures

First, normalize basic ligatures across browsers, and then get fancier, discretionary ligatures on <h1>, <h2>, and <h3>s.

An example of basic and discretionary ligatures.

Numerals

Different situations require different numerals, depending on the context. Normalize-OpenType.css takes care of this for you, so you don’t need to know what combination of Proportional, Lining, Tabular, and Old-Style numerals you need to use.

An example of old-style, proportional numerals.

An example of tabular, lining numerals.

Small Capitals

Regular capitals draw a lot of attention in body copy. With Normalize-OpenType.css, anything wrapped in <abbr> will use small capitals instead. This works especially well with Typogr.js and equivalents.

An example of small capitals.

Kerning

Kerning is turned on by default everywhere, and carefully turned off where it isn’t appropriate. A monospaced typeface’s application is ruined when automatic kerning is turned on. This is not the case with Normalize-OpenType.css; your code blocks have been preserved.

A kerning example.

…and more

There’s more optimisations included, so you don’t have to think about them: Lining, tabular numerals in code blocks, uppercase fallbacks for small capitals, and proper subscript and superscripts.

Getting started

Normalize-OpenType.css aims to be as easy to use as its namesake, Normalize.css. If it’s not that easy, please open an issue. Get the latest version of the CSS file here:

Get the latest version of the CSS file

Alternatively, use the package manager and build tool of your choice:

With npm

npm install normalize-opentype.css

With Component

component install kennethormandy/normalize-opentype.css

With bower

bower install normalize-opentype.css

Include

Though technically Normalize-OpenType.css is not dependent on Normalize.css, the intent expectation is that the former would not be used without the latter. If you’re dropping in stylesheets:

<link src="css/normalize.css" rel="stylesheet" />
<link src="css/normalize-opentype.css" rel="stylesheet" />

If you’re using a preprocessor through something like Harp, you can import the files instead.

@import "normalize";
@import "normalize-opentype";

Caveats

This library does the best it can with what it has. In order to use any of these optimisations, they must also be available in the font you are using.

I’m working on some blog posts and documentation about this, and will be sending them out via email if you’re interested.

There’s also a bug in Open Sans on Windows 7, with IE10 and 11, that’s caused by font-feature-settings, which this stylesheet uses heavily. We’re keeping an eye on it.

Running locally

If you’d like to see the test suite, or just want to view things locally, use the following:

git clone https://github.com/kennethormandy/normalize-opentype.css
cd normalize-opentype.css
npm install

To view the tests:

npm test

To compile any changes:

npm build

Contributing

Thanks for considering contributing! There’s information about how to get started with normalize-opentype here.

If you’re new to all this GitHub, Open Source, JavaScript, Node.js, testing, wow all this stuff seems really difficult I just want to make my sites better stuff, I get it. I’m still there, too. Feel free to send me an email or open an issue here and I’ll do my best to share some resources that have helped me out.

Colophon

Normalize-OpenType.css’ wordmark, examples, and some tests set in the Klinic Slab, designed by Joe Prince. The manicules were designed by Cade Cran for Dan Gneiding’s Dude Hank Pro. Both are available through the wonderful Lost Type Co-op.

Additional tests use Fira from Mozilla, and Source Code Pro from Adobe.

License

The MIT License (MIT)

Copyright © 2014–2015 Kenneth Ormandy

More Repositories

1

utility-opentype

Simple, CSS utility classes for advanced typographic features.
CSS
496
star
2

react-fittext

FitText.js as a React v16+ component.
JavaScript
70
star
3

my-harp-blog

Start a blog with Harp.
CSS
27
star
4

react-flipcard

A flippable card, with almost no opinions on styling.
JavaScript
23
star
5

word-o-mat

JavaScript version of Nina Stössinger’s word-o-mat: generate words for type specimens, spacing, and more.
JavaScript
22
star
6

font-feature-fibbing

Hey, do you support the font-feature-settings CSS property? Safari, look—I know you’re lying!
JavaScript
13
star
7

chasers

Bourbon Neat helpers, making complex, mobile-first layouts a little easier.
CSS
12
star
8

figment

Editorial figure and caption pairings for mobile-first layouts.
CSS
12
star
9

hb-epub3

A Harp boilerplate for creating EPUB3 ebooks.
10
star
10

proof

A very basic template for proofing type with InDesign.
8
star
11

craft-marketplace

Make your Craft Commerce site a Marketplace, via Stripe
PHP
8
star
12

googlefonts-japanese

JavaScript
5
star
13

craft-s3securedownloads

PHP
4
star
14

typecooker-ingredients

TypeCooker’s raw ingredients, via @TypeMyType’s RoboFont extension.
2
star
15

example-dark-mode-readme-specimens

2
star
16

eventuell

A Goodbits template with good typography.
CSS
2
star
17

dodging-bullets

A mobile-first approach to hanging bullets and ordinals for ordered and unordered lists.
CSS
2
star
18

font-service-specifics

Look up a font’s service vendor, through its delivery URL.
JavaScript
2
star
19

utility-opentype.kennethormandy.com

The documentation for Utility OpenType.
HTML
1
star
20

wait-times

The average wait times in Edmonton and area hospitals.
CSS
1
star
21

yonder-expected

Expected example test cases for Yonder.
HTML
1
star
22

default

A starting points for certain projects.
1
star
23

craft-api2pdf

PHP
1
star
24

smokeproofs

Record font performance from Google Fonts, Typekit, and more.
JavaScript
1
star
25

font-feature-abettings

Collect glyph names from a font’s OpenType gsub data.
JavaScript
1
star
26

typecooker-togo

A small TypeCooker app for mobile devices.
JavaScript
1
star