ThomasJockin / readexpro

Readex Pro is the world-script expansion of Lexend. Lexend is a variable font empirically shown to significantly improve reading-proficiency.
http://www.lexend.com
SIL Open Font License 1.1
503 stars 26 forks source link

[Feature request] CSS font loader #62

Open S-K-Tiger opened 1 year ago

S-K-Tiger commented 1 year ago

A CSS file that can be referenced to import the font for use on a webpage.

For a live example see <link href="https://fonts.googleapis.com/css?family=Dosis" rel="stylesheet">. This example can be used to import the Dosis font.

A potential implementation could look like: <link href="https://cdn.jsdelivr.net/gh/ThomasJockin/readexpro@master/fonts/css/ReadexPro.css" rel="stylesheet"> Referring to a file looking like:

@charset "UTF-8";
/* For information on this font see: https://www.lexend.com/ */
@font-face {
    font-family: 'ReadexPro';
    src: url(https://cdn.jsdelivr.net/gh/ThomasJockin/readexpro@master/fonts/ttf/ReadexPro-Regular.ttf) format('ttf');
    font-weight: normal;
}
@font-face {
    font-family: 'ReadexPro';
    src: url(https://cdn.jsdelivr.net/gh/ThomasJockin/readexpro@master/fonts/ttf/ReadexPro-bold.ttf) format('ttf');
    font-weight: bold;
}
@font-face {
    font-family: 'ReadexPro';
    src: url(https://cdn.jsdelivr.net/gh/ThomasJockin/readexpro@master/fonts/ttf/ReadexPro-Light.ttf) format('ttf');
    font-weight: lighter;
}