Home

Awesome

linefont build

Typeface for rendering small/medium-scale line charts (eg. time series).

<img width="151" alt="image" src="https://github.com/dy/linefont/assets/300067/32827572-d01b-489e-b949-e1454640c3c9">

Demo  •  Google fonts  •  V-fonts  •  Test

Usage

Put Linefont[wdth,wght].woff2 into your project directory and use this code:

<style>
@font-face {
	font-family: linefont;
	font-display: block;
	src: url(./Linefont[wdth,wght].woff2) format('woff2');
}
.linefont {
	--wght: 200;
	--wdth: 50;
	font-family: linefont;
	font-variation-settings: 'wght' var(--wght), 'wdth' var(--wdth);
	line-height: 1.4; /* match selection, optional */
}
</style>

<!-- Set values manually -->
<textarea id="linefont" class="linefont" cols="100">
abcdefghijklmnopqrstuvwwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
</textarea>

<script>
// Set values programmatically (more precise)
linefont.textContent = Array.from({length: 127}, (_,i) => String.fromCharCode(0x100 + i)).join('')
</script>

Ranges

Linefont values span from 0 to 100, assigned to different characters:

Variable Axes

TagRangeMeaning
wght1-1000Line thickness (quarter upms, linear).
wdth25-200Width of the font (ie. zoom of the signal).

Features

npm package

Linefont npm package contains the font and a js function that produces font string from values.

import lf from 'linefont'

// get characters for values from 0..127 range
lf(0, 1, 50, 99, 127, ...) // ĀāIJţŤ...

Building

make build

Troubleshooting

See also

<p align="center"><a href="https://github.com/krishnized/license/">🕉</a><p>