@simoncozens/fonttypes
    Preparing search index...

    Function userspaceToDesignspace

    • Convert a userspace location to a designspace location.

      Parameters

      • location: UserspaceLocation

        The userspace location to convert

      • axes: Axis[]

        The axes definitions to use for the conversion

      Returns DesignspaceLocation

      The corresponding designspace location

      let weightMap: UserspaceToDesignspaceMapping = [
      [100, 100],
      [400, 400],
      [700, 600],
      [900, 900]
      ];
      const axes: Axis[] = [
      {
      tag: "wght",
      min: 100,
      default: 400,
      max: 900,
      map: weightMap
      }
      ];
      const userLocation: UserspaceLocation = { wght: 650 };
      const designLocation = userspaceToDesignspace(userLocation, axes