Skip to content

Commit

Permalink
fix hardcoded font size
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Mar 8, 2023
1 parent f9a8087 commit 4691b1e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/accidental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export class Accidental extends Modifier {

this.render_options = {
// Font size for glyphs
font_scale: 38,
font_scale: Tables.NOTATION_FONT_SCALE,

// Padding between accidental and parentheses on each side
parenLeftPadding: 2,
Expand Down
2 changes: 1 addition & 1 deletion src/articulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export class Articulation extends Modifier {
this.type = type;
this.position = ABOVE;
this.render_options = {
font_scale: 38,
font_scale: Tables.NOTATION_FONT_SCALE,
};

this.reset();
Expand Down
2 changes: 1 addition & 1 deletion src/keysignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class KeySignature extends StaveModifier {

this.setKeySig(keySpec, cancelKeySpec, alterKeySpec);
this.setPosition(StaveModifierPosition.BEGIN);
this.glyphFontScale = 38; // TODO(0xFE): Should this match StaveNote?
this.glyphFontScale = Tables.NOTATION_FONT_SCALE;
this.glyphs = [];
this.xPositions = []; // relative to this.x
this.paddingForced = false;
Expand Down
2 changes: 1 addition & 1 deletion src/ornament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Ornament extends Modifier {
this.delayed = false;

this.render_options = {
font_scale: 38,
font_scale: Tables.NOTATION_FONT_SCALE,
accidentalLowerPadding: 3,
accidentalUpperPadding: 3,
};
Expand Down
4 changes: 1 addition & 3 deletions src/stavetempo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ export class StaveTempo extends StaveModifier {
this.setRendered();

const options = this.render_options;
// FIXME: What does the '38' mean? Why 38? Is that supposed to
// be the default font size for standard notation?
const scale = options.glyph_font_scale / 38;
const scale = options.glyph_font_scale / Tables.NOTATION_FONT_SCALE;
const name = this.tempo.name;
const duration = this.tempo.duration;
const dots = this.tempo.dots || 0;
Expand Down
3 changes: 2 additions & 1 deletion src/strokes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Glyph } from './glyph';
import { Modifier } from './modifier';
import { ModifierContextState } from './modifiercontext';
import { Note } from './note';
import { Tables } from './tables';
import { Category, isNote, isStaveNote, isTabNote } from './typeguard';
import { RuntimeError } from './util';

Expand Down Expand Up @@ -92,7 +93,7 @@ export class Stroke extends Modifier {
this.position = Modifier.Position.LEFT;

this.render_options = {
font_scale: 38,
font_scale: Tables.NOTATION_FONT_SCALE,
};

this.resetFont();
Expand Down

0 comments on commit 4691b1e

Please sign in to comment.