Skip to content

Commit

Permalink
DefaultFontStack
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Jun 5, 2021
1 parent 6b7fe6b commit 8460935
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/chordsymbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
//
// See `tests/chordsymbol_tests.js` for usage examples.

import { Vex } from './vex';
import { RuntimeError, log } from './util';
import { DefaultFontStack } from './font';
import { Flow } from './tables';
import { Glyph } from './glyph';
import { TextFont } from './textfont';
Expand Down Expand Up @@ -105,7 +105,7 @@ export class ChordSymbol extends Modifier {
}

static get engravingFontResolution() {
return Vex.Flow.DEFAULT_FONT_STACK[0].getResolution();
return DefaultFontStack[0].getResolution();
}

static get spacingBetweenBlocks() {
Expand Down Expand Up @@ -235,15 +235,15 @@ export class ChordSymbol extends Modifier {
}

static get chordSymbolMetrics() {
return Vex.Flow.DEFAULT_FONT_STACK[0].metrics.glyphs.chordSymbol;
return DefaultFontStack[0].metrics.glyphs.chordSymbol;
}

static get lowerKerningText() {
return Vex.Flow.DEFAULT_FONT_STACK[0].metrics.glyphs.chordSymbol.global.lowerKerningText;
return DefaultFontStack[0].metrics.glyphs.chordSymbol.global.lowerKerningText;
}

static get upperKerningText() {
return Vex.Flow.DEFAULT_FONT_STACK[0].metrics.glyphs.chordSymbol.global.upperKerningText;
return DefaultFontStack[0].metrics.glyphs.chordSymbol.global.upperKerningText;
}

// ### format
Expand Down
6 changes: 3 additions & 3 deletions src/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { RuntimeError } from './util';
import { Registry } from './registry';
import { Flow } from './tables';
import { DefaultFontStack } from './font';
import { BoundingBox } from './boundingbox';
import { Font } from './font';
import { RenderContext } from './types/common';
Expand Down Expand Up @@ -62,8 +62,8 @@ export abstract class Element {
};

this.rendered = false;
this.fontStack = Flow.DEFAULT_FONT_STACK;
this.musicFont = Flow.DEFAULT_FONT_STACK[0];
this.fontStack = DefaultFontStack;
this.musicFont = DefaultFontStack[0];

// If a default registry exist, then register with it right away.
Registry.getDefaultRegistry()?.register(this);
Expand Down
3 changes: 2 additions & 1 deletion src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { Vex } from './vex';
import { RuntimeError, log } from './util';
import { DefaultFontStack } from './font';
import { Beam } from './beam';
import { Flow } from './tables';
import { Fraction } from './fraction';
Expand Down Expand Up @@ -187,7 +188,7 @@ export class Formatter {
options?: { stavePadding: number }
): void {
options = {
stavePadding: Flow.DEFAULT_FONT_STACK[0].lookupMetric('stave.padding'),
stavePadding: DefaultFontStack[0].lookupMetric('stave.padding'),
...options,
};

Expand Down
4 changes: 2 additions & 2 deletions src/glyph.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.

import { RuntimeError } from './util';
import { Flow } from './tables';
import { DefaultFontStack } from './font';
import { Element } from './element';
import { BoundingBoxComputation } from './boundingboxcomputation';
import { BoundingBox } from './boundingbox';
Expand Down Expand Up @@ -236,7 +236,7 @@ export class Glyph extends Element {
options?: { font?: Font; category: string }
): GlyphMetrics {
const params = {
fontStack: Flow.DEFAULT_FONT_STACK,
fontStack: DefaultFontStack,
...options,
};
const metrics = Glyph.loadMetrics(params.fontStack, val, params.category);
Expand Down

0 comments on commit 8460935

Please sign in to comment.