Skip to content

Commit

Permalink
Now refers to the correct ivd when processing results from the instan…
Browse files Browse the repository at this point in the history
…tiated IVS
  • Loading branch information
Lorp committed Aug 2, 2024
1 parent ba1e33d commit 7b719f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ function loadFontFromArrayBuffer (arrayBuffer, options={}) {
const locationsTxt = new Set();
locationsTxt.add(Array(axisCount).fill(0).join()); // add the default location, prevents it ever being added

ivs.ivds.forEach(ivd => {
ivs.ivds.forEach((ivd, ivdIndex) => {

ivd.regionIds.forEach(regionId => {
const region = ivs.regions[regionId];
Expand Down Expand Up @@ -756,7 +756,7 @@ function loadFontFromArrayBuffer (arrayBuffer, options={}) {
else {
locationsTxt.add(locationTxt); // prevent this location from being added again using a serialized version of the array as a hash
const location = [[...corner], [...corner]];
const deltasI16 = SamsaFont.prototype.itemVariationStoreInstantiate(ivs, location[0])[0];
const deltasI16 = SamsaFont.prototype.itemVariationStoreInstantiate(ivs, location[0])[ivdIndex];
deltasI16.forEach((delta, d) => {
const axisId = activeAxisIds[d];
location[1][axisId] = clamp(location[1][axisId] + delta/16384, -1, 1);
Expand Down

0 comments on commit 7b719f0

Please sign in to comment.