Skip to content

MathSymbolFont

Overview

MathSymbolFont is the font used for math symbols (e.g. 'x', 'y') in PhET sims. See https://github.com/phetsims/scenery/issues/545

@author Chris Malley (PixelZoom, Inc.)

Class MathSymbolFont

import { MathSymbolFont } from 'scenerystack/scenery-phet';

Constructor

new MathSymbolFont( providedOptions? : number | string | MathSymbolFontOptions )

Instance Methods

Static Methods

getRichTextMarkup( text : string, style ) : string

Converts a string to the markup needed to display that string with RichText, using the same family as MathSymbolFont. @param text @param [style] - see Font options.style

createDerivedProperty( symbolStringProperty : TReadOnlyProperty<string>, providedOptions? : CreateDerivedPropertyOptions ) : TReadOnlyProperty<string>

Wraps a dynamic string in RichText markup that will display the string in the same font as MathSymbolFont.

Static Properties

FAMILY

(readonly)

Type MathSymbolFontOptions

import type { MathSymbolFontOptions } from 'scenerystack/scenery-phet';

StrictOmit<FontOptions, "family">

Source Code

See the source for MathSymbolFont.ts in the scenery-phet repository.