diff options
author | Rasmus Andersson <rasmus@notion.se> | 2023-11-20 03:05:56 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2023-11-20 03:05:56 +0300 |
commit | a521315959ee183f0c1195149335a0720edc403f (patch) | |
tree | c219f2886d4fa41efb6275d51bfcc9d4f4469da5 /docs/res | |
parent | 401515a3439c6e7d809ad228b07c513d2fdeb893 (diff) | |
download | inter-a521315959ee183f0c1195149335a0720edc403f.tar.xz |
website: v4.0
Diffstat (limited to 'docs/res')
-rw-r--r-- | docs/res/base.css | 4 | ||||
-rw-r--r-- | docs/res/glyph-inspector.js | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/docs/res/base.css b/docs/res/base.css index c6b5582c2..28d453d2a 100644 --- a/docs/res/base.css +++ b/docs/res/base.css @@ -5,12 +5,12 @@ layout: none @font-face { font-family: InterVariable; font-style: normal; font-weight: 100 900; font-display: block; /* <-- block, not swap */ - src: url('../font-files/Inter-Variable.woff2?v={{font_v}}') format('woff2'); + src: url('../font-files/InterVariable.woff2?v={{font_v}}') format('woff2'); } @font-face { font-family: InterVariable; font-style: italic; font-weight: 100 900; font-display: block; /* <-- block, not swap */ - src: url('../font-files/Inter-Variable-Italic.woff2?v={{font_v}}') format('woff2'); + src: url('../font-files/InterVariable-Italic.woff2?v={{font_v}}') format('woff2'); } @font-face { font-family: "jbmono"; diff --git a/docs/res/glyph-inspector.js b/docs/res/glyph-inspector.js index f620d23e0..24f16540f 100644 --- a/docs/res/glyph-inspector.js +++ b/docs/res/glyph-inspector.js @@ -27,6 +27,7 @@ function pxround(px) { } const monotime = performance.now.bind(performance) +const WGHT_MIN = 14, WGHT_MAX = 32 class GlyphInspector { constructor() { @@ -35,7 +36,7 @@ class GlyphInspector { this.glyphUnicode = 0 this.defaultGlyphUnicode = 0x0041 this.selectedGlyphGridCell = null - this.defaultAxisValues = {wght: 400, opsz: 28} + this.defaultAxisValues = {wght: 400, opsz: WGHT_MAX} this.axisValues = {wght: 0, opsz: 0} this.idNameElement = $(".identification .name", rootElement) this.idUnicodeElement = $(".identification .unicode", rootElement) @@ -83,13 +84,13 @@ class GlyphInspector { // enable clicking on label to toggle this.opszSlider.onclick = (ev) => ev.stopPropagation() this.opszSlider.parentElement.onclick = (ev) => { - this.setFontInstance({opsz: this.axisValues.opsz > 14 ? 14 : 28}) + this.setFontInstance({opsz: this.axisValues.opsz > WGHT_MIN ? WGHT_MIN : WGHT_MAX}) } this.opszCheckbox = $('input[name="opsz-switch"]') - this.defaultAxisValues.opsz = this.opszCheckbox.checked ? 14 : 28 + this.defaultAxisValues.opsz = this.opszCheckbox.checked ? WGHT_MIN : WGHT_MAX this.opszCheckbox.onchange = (ev) => { - this.setFontInstance({opsz: this.opszCheckbox.checked ? 14 : 28}) + this.setFontInstance({opsz: this.opszCheckbox.checked ? WGHT_MIN : WGHT_MAX}) } let showDetailsCheckbox = $('input[name="show-details"]') @@ -272,7 +273,7 @@ class GlyphInspector { if (ev.shiftKey) wght = Math.round(wght / 100) * 100 wght = max(100, min(900, wght)) - // opsz = max(14, min(28, opsz)) + // opsz = max(WGHT_MIN, min(WGHT_MAX, opsz)) this.hasDraggedWght = true if (this.draggedWghtStartTime == 0) this.draggedWghtStartTime = monotime() @@ -942,7 +943,7 @@ class GlyphInspector { // let wght = 100 // let inc = true // setInterval(x => { - // this.setFontInstance({wght, opsz: 28}) + // this.setFontInstance({wght, opsz: WGHT_MAX}) // if (inc) { // wght += 10 // if (wght > 900) { @@ -961,5 +962,5 @@ class GlyphInspector { } let inspector = new GlyphInspector() -await inspector.loadFont('font-files/Inter-Variable.ttf') +await inspector.loadFont('font-files/InterVariable.ttf') // await inspector.loadFont('font-files/InterDisplay-Regular.otf') |