modelBinder

How to get modelBinder

import modelBinder from 'fontoxml-stencils/src/modelBinder.js'

Type: Object

The modelBinder provides various functions which can help with syncing between models and aligned stencils

Static methods

Name Description
getSelectionRange

Get the selectionRange prefered by the stencil, if any. It does this using the selection.start / selection.end gaps

Refer to modelBinder for more information on how to import and use this function.


  Arguments
# Name Type Description
1. alignedStencil AlignedStencil

The stencil to get the range from

  Returns

Type: BlueprintRange | Null

The given range, or null if none found

syncModelToStencil

Write a model to an aligned stencil

Refer to modelBinder for more information on how to import and use this function.


  Arguments
# Name Type Description
1. alignedStencil AlignedStencil

The stencil to write to

2. model Object

The model to read from

syncStencilToModel

Write a model to an aligned stencil

Refer to modelBinder for more information on how to import and use this function.


  Arguments
# Name Type Description
1. alignedStencil AlignedStencil

The stencil to read from

2. model Object

The model to write to. This object is mutated by this function

Was this page helpful?