Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created March 2, 2022 21:44
Show Gist options
  • Select an option

  • Save nfreear/3ad861197288cec0179716fe49c9567c to your computer and use it in GitHub Desktop.

Select an option

Save nfreear/3ad861197288cec0179716fe49c9567c to your computer and use it in GitHub Desktop.
"OpenDyslexic" font demo | https://opendyslexic.org/
<!doctype html>
<style>
/* opendyslexic-latin-400-normal*/
@font-face {
font-family: 'OpenDyslexic';
font-style: normal;
font-display: swap;
font-weight: 400;
src:
url('https://unpkg.com/@fontsource/[email protected]/files/opendyslexic-latin-400-normal.woff2') format('woff2'),
url('https://unpkg.com/@fontsource/[email protected]/files/opendyslexic-latin-400-normal.woff') format('woff')
;
}
body {
margin: auto;
max-width: 33rem;
}
main {
font: 1.1rem/1.5 OpenDyslexic, 'Comic Sans MS', sans-serif;
}
h1, h2, h3 {
font-weight: 400;
}
#alpha {
line-height: 1.9;
word-spacing: -1.4rem;
}
</style>
<main>
<h1> Hello world! </h1>
<h2 id="alpha">..</h2>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
<p> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
</main>
<script>
const ALPHA = document.querySelector('#alpha');
const BET = [];
// const NUM = ' 1 2 3 4 5 6 7 8 9 0 ';
const NON_ALPHA = '© { }';
const JOIN = ' ';
const LOWER = alphaGen('a', 'z', JOIN);
const UPPER = alphaGen('A', 'Z', JOIN);
const NUM = alphaGen('0', '9', JOIN);
/* for (let idx = 'a'.charCodeAt(0); idx <= 'z'.charCodeAt(0); idx++) {
BET.push(String.fromCharCode(idx));
}
for (let idx = 'A'.charCodeAt(0); idx <= 'Z'.charCodeAt(0); idx++) {
BET.push(String.fromCharCode(idx));
} */
console.debug(BET);
ALPHA.textContent = `${LOWER} ${UPPER} ${NUM}`;
// ALPHA.textContent = BET.join(' ') + NUM + NON_ALPHA;
function alphaGen (startChar = 'a', endChar = 'z', joiner = null) {
const BET = [];
for (let idx = startChar.charCodeAt(0); idx <= endChar.charCodeAt(0); idx++) {
BET.push(String.fromCharCode(idx));
}
return joiner ? BET.join(joiner) : BET;
}
</script>
<pre>
NDF, 28-Feb-2022.
* https://opendyslexic.org/,
* https://github.com/antijingoist/opendyslexic,
* https://fontsource.org/fonts/opendyslexic,
* https://npmjs.com/package/@fontsource/opendyslexic,
* https://unpkg.com/@fontsource/[email protected]/,
* https://ericwbailey.design/writing/comic-sans-is-a-good-typeface-actually/,
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment