MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / constructor

Method constructor

packages/alphatab/src/model/Font.ts:447–458  ·  view source on GitHub ↗

* Initializes a new instance of the Font class. * @param family The family. * @param size The size. * @param style The style. * @param weight The weight.

(
        family: string,
        size: number,
        style: FontStyle = FontStyle.Plain,
        weight: FontWeight = FontWeight.Regular
    )

Source from the content-addressed store, hash-verified

445 * @param weight The weight.
446 */
447 public constructor(
448 family: string,
449 size: number,
450 style: FontStyle = FontStyle.Plain,
451 weight: FontWeight = FontWeight.Regular
452 ) {
453 this._families = FontParser.parseFamilies(family);
454 this._size = size;
455 this._style = style;
456 this._weight = weight;
457 this._css = this.toCssString();
458 }
459
460 public withSize(newSize: number): Font {
461 return Font.withFamilyList(this._families, newSize, this._style, this._weight);

Callers

nothing calls this directly

Calls 2

toCssStringMethod · 0.95
parseFamiliesMethod · 0.80

Tested by

no test coverage detected