Skip to content

Commit

Permalink
Linearize weight
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Sep 8, 2023
1 parent 42b188e commit cf3ec02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
14 changes: 3 additions & 11 deletions _sources/Wavefont.designspace
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@
<map input="-100" output="0"/>
<map input="100" output="1"/>
</axis>
<axis default="100" minimum="100" maximum="900" name="Weight" tag="wght">
<!-- We add non-linearity to mapping -->
<map input="100" output="{{axes.weight.min}}"/>
<map input="200" output="16"/>
<map input="300" output="33"/>
<map input="400" output="54"/>
<map input="500" output="75"/>
<map input="600" output="100"/>
<map input="700" output="128"/>
<map input="800" output="160"/>
<map input="900" output="{{axes.weight.max}}"/>
<axis default="20" minimum="20" maximum="1000" name="Weight" tag="wght">
<map input="20" output="5"/>
<map input="1000" output="250"/>
</axis>
</axes>
<rules>{{#each clips as |code value| }}
Expand Down
2 changes: 1 addition & 1 deletion plopfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function alias(value, char) {
// axes definition, per https://github.com/dy/wavefont/issues/42
const AXES = {
roundness: { name: 'Roundness', tag: 'ROND', min: 0, max: 100 },
weight: { name: 'Weight', tag: 'wght', min: 5, max: 200 },
weight: { name: 'Weight', tag: 'wght', min: 5, max: 250 },
align: { name: 'Vertical Element Alignment', tag: 'YELA', min: 0, max: 1 }
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ <h1>
Wavefont&thinsp;<sup><small><a title="github" href="https://github.com/a-vis/wavefont">3.3</a></small></sup>
</h1>
<div class="panel-field">
<label for="weight"><small>Weight</small></label> <input id="weight" type="range" min="100" value="400" step="10"
max="900" list="weights" />
<label for="weight"><small>Weight</small></label> <input id="weight" type="range" min="0" value="400" step="10"
max="1000" list="weights" />
<datalist id="weights">
<option>0</option>
<option>100</option>
Expand Down

0 comments on commit cf3ec02

Please sign in to comment.