configureProperties

How to get configureProperties

import configureProperties from 'fontoxml-families/src/configureProperties.js'

Type: Function

Configure common properties for nodes matching the given selector.

If a property is not provided, the value for this property of a more generic selector is used.

Example:

import configureAsInlineFrame from 'fontoxml-families/src/configureAsInlineFrame.js';
import configureProperties from 'fontoxml-families/src/configureProperties.js';

// Configure all 'hi' elements as inline frames
configureAsInlineFrame(sxModule, 'self::hi');

// But if they are @rend="sub", they should be subscript
configureProperties(sxModule, 'self::hi[@rend="sub"]', { baseline: 'subscript' });

// And if they are @rend="bold", they should be bold
configureProperties(sxModule, 'self::hi[@rend="sub"]', { weight: 'bold' });

When to use 'visualization'

Note that there is not a strict difference for properties nested in the 'visualization' object, or properties placed directly in the 'options' object. Instead, they are the same.

#Example

The following CVK options:

configureProperties(sxModule, 'xxx', { visualization: { weight: 'bold' } })

Are exactly the same as the following CVK options

configureProperties(sxModule, 'xxx', { weight: 'bold' })

When possible, the latter notation is preferred because it is shorter and does not need any knowledge of which properties are visualization-related.

Arguments

# Name Type Description
1. sxModule SxModule
2. selector XPathTest
3. options CvkOptions | CvkVisualizationOptions

The visualization key for this object is optional. The separate CvkVisualizationOptions may occur on the options object.