Skip to content

Commit 2a7f7a6

Browse files
committed
Merge branch 'master' into font-variation-writing
# Conflicts: # README.md # src/tables/cff.js # test/tables/cff.js
2 parents 2214e4d + c6a3cb8 commit 2a7f7a6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ Returns the default coordinates for the font's variation axes.
362362
Determines and returns the index of the default variation instance. Returns `-1` if it cannot be determined.
363363
* Returns: Integer representing the default instance index or `-1`.
364364

365+
###### `Font.variation.getTransform(glyph, coords)`
366+
Just a shortcut for [`Font.variation.process.getTransform()`](#fontvariationprocessgettransformglyph-coords).
367+
365368
###### `Font.variation.getInstanceIndex(coordinates)`
366369
Finds the index of the variation instance that matches the provided coordinates, or `-1` if none match.
367370
* `coordinates`: Object with axis tags as keys and variation values as corresponding values.
@@ -384,8 +387,9 @@ Gets the current variation settings from the font's default render options.
384387
##### The `Font.variation.process` object (`VariationProcessor`)
385388
The `VariationProcessor` is a component of the `VariationManager`, used mainly internally for computing and applying variations to the glyphs in a variable font. It handles transformations and adjustments based on the font's variable axes and instances.
386389

387-
###### `Font.variation.process.getNormalizedCoords()`
390+
###### `Font.variation.process.getNormalizedCoords(coords)`
388391
Returns normalized coordinates for the variation axes based on the current settings.
392+
* `coords`: The coordinates object to normalize (or the variation coords in the font's `defaultRenderOptions` by default)
389393
* Returns: Normalized coordinates as an object mapping axis tags to normalized values.
390394

391395
###### `Font.variation.process.interpolatePoints(points, deltas, scalar)`
@@ -414,9 +418,11 @@ Transforms components of a glyph using a specified transformation matrix.
414418
* `transformation`: Transformation matrix to apply.
415419
* Returns: Transformed components.
416420

417-
###### `Font.variation.process.getTransform()`
418-
Computes the transformation matrix based on current variation settings.
419-
* Returns: Transformation matrix for the current variation settings.
421+
###### `Font.variation.process.getTransform(glyph, coords)`
422+
Retrieves a transformed copy of a glyph based on the provided variation coordinates, or the glyph itself if no variation was applied
423+
* `glyph`: Glyph or index of glyph to transform.
424+
* `coords`: Variation coords object (or the variation coords in the font's `defaultRenderOptions` by default)
425+
* Returns: `opentype.Glyph`
420426

421427
###### `Font.variation.process.getVariableAdjustment(adjustment)`
422428
Calculates the variable adjustment for a given adjustment parameter.

0 commit comments

Comments
 (0)