Global

Methods

resolveFontWeight(desiredWeight, availableWeights) → {Number}

Source:

Snap a desired font-weight to an available font-weight according to the font-weight snapping algorithm described in https://www.w3.org/TR/css-fonts-3/#fontstylematchingalg

Parameters:
Name Type Description
desiredWeight Number

The desired font-weight

availableWeights Array.<Number>

Available font-weights

Returns:

Resulting font-weight after snapping to available weights

Type
Number

snapToAvailableFontProperties(fontFaceDeclarations, propsToSnap) → {FontFaceDeclaration}

Source:

Font style matching algorithm as described in https://www.w3.org/TR/css-fonts-3/#fontstylematchingalg

Parameters:
Name Type Description
fontFaceDeclarations Array.<FontFaceDeclaration>

Array of FontFaceDeclarations to match against

propsToSnap FontFaceDeclaration

FontFaceDeclaration to match against fontFaceDeclarations

Returns:

The nearest match from fontFaceDeclarations

Type
FontFaceDeclaration

Type Definitions

AssetConfig

Source:
Properties:
Name Type Attributes Description
type String <optional>

The Assets type. Will be inferred if missing

rawSrc Buffer <optional>

Buffer object containing the raw source of the asset

contentType String <optional>

The Content-Type (MIME type) of the asset. For subclasses of Asset there will be a reasonable default.

url String <optional>

The fully qualified (absolute) url of the asset. If not provided, the asset will be considered inline. This property takes precedence over all other url parts in the configuration

fileName String <optional>
baseName String <optional>
extension String <optional>
protocol String <optional>
username String <optional>
password String <optional>
hostname String <optional>
port Number <optional>
path String <optional>

Configuration object used to construct Assets in all places where an asset is automatically constructed. For example in AssetGraph.addAsset or in the to-property in Asset.addRelation

Type:
  • Object

FontFaceDeclaration

Source:
Properties:
Name Type Description
font-family String

CSS font-family property

font-stretch String

CSS font-stretch property

font-weight Number

CSS font-weight property, must be normalized to numbers

font-style String

CSS font-style property

Type:
  • Object