Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created March 7, 2022 19:52
Show Gist options
  • Select an option

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

Select an option

Save nfreear/d48d668d9e3b844c5e446771c1293aea to your computer and use it in GitHub Desktop.
Icon fonts, Material icons, fonts for Simplified Chinese | https://fontsource.org/
<!doctype html><html lang="en"> <title> font-icon test </title>
<meta charset="utf-8" />
<style>
:root {
--my-font-face: OpenDyslexic;
--X-my-page-bg-color: black;
--my-page-color: #333;
}
.my-font-loaded p.od,
.my-font-loaded .open-dyslexic,
.my-font-loaded [ name = OpenDyslexic ] {
/* X-color: #888;
X-font: 2rem/1.7 'Open Dyslexic';
X-word-spacing: -1.5rem; */
font-family: 'OpenDyslexic';
font-style: normal;
font-size: 2rem;
line-height: 1.7;
font-feature-settings: unset;
}
.my-font-loaded p.od {
X-word-spacing: -.2rem;
}
.my-font-loaded [ lang ^= zh ].liu {
font: 3rem/1.4 'LiuJianMaoCao';
}
.my-font-loaded .long-cang {
font: 3rem/1.4 'LongCang';
}
.my-font-loaded mi,
.my-font-loaded my-icon,
.my-font-loaded .material-icons {
X_color: #555;
font-family: 'MaterialIcons';
font-weight: normal;
font-style: normal;
font-size: 4rem; /* Was: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
}
.my-font-loaded pi {
font-family: 'ParticlesIcons';
font-size: 4rem;
}
.my-font-loaded fab {
font-family: 'FontAwesome-Brand';
font-size: 4rem;
}
fab.creative-commons::before {
content: '\f25e';
}
</style>
<my-page>
<h1> font-icon test </h1>
<p>
<span class="material-icons">settings</span>
<my-icon>translate</my-icon>
<mi>accessibility_new</mi>
<mi>hearing_disabled</mi>
<mi>share</mi>
</p>
<p>
<pi>twitter</pi>
<fab class="creative-commons"></fab>
</p>
<p class="xyz od">Sphinx of black quartz, judge my vow.</p>
<p lang="zh-hans" class="liu" data-pinyin="yǒuyuán qiānlǐ lái xiāng huì" data-en="Fate has us meet from a 1000 miles away.">
有缘千里来相会。
</p>
<p lang="zh-hans" class="long-cang">有缘千里来相会。A B C</p>
</my-page>
<my-font
name="OpenDyslexic"
X_url="https://opendyslexic.org/themes/opendyslexic/typefaces/OpenDyslexic3-Regular.otf"
url="https://unpkg.com/@fontsource/[email protected]/files/opendyslexic-latin-400-normal.woff"
X_show-example="true"
></my-font>
<my-font
name="MaterialIcons"
url="https://unpkg.com/@fontsource/[email protected]/files/material-icons-base-400-normal.woff"
></my-font>
<my-font
name="ParticlesIcons"
url="https://unpkg.com/[email protected]/dist/fonts/particles.woff2"
></my-font>
<my-font
name="FontAwesome-Brand"
url="https://unpkg.com/@fortawesome/[email protected]/webfonts/fa-brands-400.woff2"
></my-font>
<my-font
name="LiuJianMaoCao"
url="https://unpkg.com/@fontsource/[email protected]/files/liu-jian-mao-cao-chinese-simplified-400-normal.woff"
></my-font>
<my-font
name="LongCang"
url="https://unpkg.com/@fontsource/[email protected]/files/long-cang-chinese-simplified-400-normal.woff"
></my-font>
<my-options
template-host="github.io"
use="my-page, my-font"
></my-options>
<script
src="/custom.js"
X_src="https://nfreear.github.io/web-components/custom.js"
type="module" async crossorigin
></script>
<script>
</script>
<pre>
NDF, 04-Mar-2022.
* https://fonts.google.com/icons,
* https://fontsource.org/fonts/material-icons,
* https://stackoverflow.com/questions/31648838/how-does-materialize-icons-work,
* https://fonts.google.com/?subset=chinese-simplified,
* https://fluentin3months.com/chinese-proverbs/
</pre>
</html>
<!--
Source: https://opendyslexic.org
@font-face{
font-family: clfallback;
src: url(/themes/opendyslexic/typefaces/OpenDyslexic3-Regular.otf) format('opentype')
}
@font-face{
font-family: oda;
src:
url(/themes/opendyslexic/typefaces/OpenDyslexic-Regular.otf) format('opentype'),
url(/themes/opendyslexic/typefaces/OpenDyslexic-Regular.eot) format('eot'),
url(/themes/opendyslexic/typefaces/OpenDyslexic-Regular.woff) format('woff'),
url(/themes/opendyslexic/typefaces/OpenDyslexic-Regular.woff2) format('woff2');
font-weight:400;
font-style:normal
}
@font-face{
font-family:oda;
src:url(/themes/opendyslexic/typefaces/OpenDyslexic-Italic.otf) format('opentype'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Italic.eot) format('eot'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Italic.woff) format('woff'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Italic.woff2) format('woff2');
font-weight:400;
font-style:italic
}
@font-face{
font-family:oda;
src:url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold.otf) format('opentype'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold.eot) format('eot'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold.woff) format('woff'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold.woff2) format('woff2');
font-weight:700;
font-style:normal
}
@font-face{
font-family:oda;
src:url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold-Italic.otf) format('opentype') url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold-Italic.eot) format('eot'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold-Italic.woff) format('woff'),url(/themes/opendyslexic/typefaces/OpenDyslexic-Bold-Italic.woff2) format('woff2');
font-weight:700;
font-style:italic
}
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment