Skip to content

Commit

Permalink
clef annotations size refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Apr 6, 2023
1 parent 53a0172 commit 9773f71
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions src/clef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface ClefMetrics {
width: number;
annotations: {
[key: string]: {
point: number;
[type: string]: { line?: number; shiftX?: number } | number;
};
};
Expand Down Expand Up @@ -148,7 +147,7 @@ export class Clef extends StaveModifier {
// If an annotation, such as 8va, is specified, add it to the Clef object.
if (annotation !== undefined) {
const code = Clef.annotationSmufl[annotation];
const point = musicFont.lookupMetric(`clef_${this.size}.annotations.${annotation}.point`);
const point = (Clef.getPoint(this.size) / 5) * 3;
const line = musicFont.lookupMetric(`clef_${this.size}.annotations.${annotation}.${this.type}.line`);
const x_shift = musicFont.lookupMetric(`clef_${this.size}.annotations.${annotation}.${this.type}.shiftX`);

Expand Down
4 changes: 0 additions & 4 deletions src/fonts/common_metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ export const CommonMetrics = {
width: 26,
annotations: {
'8va': {
point: 18,
treble: {
line: -2,
shiftX: 12,
},
},
'8vb': {
point: 18,
treble: {
line: 6.5,
shiftX: 10,
Expand All @@ -126,14 +124,12 @@ export const CommonMetrics = {
width: 20,
annotations: {
'8va': {
point: 16,
treble: {
line: -0.2,
shiftX: 8,
},
},
'8vb': {
point: 16,
treble: {
line: 5.3,
shiftX: 6,
Expand Down

0 comments on commit 9773f71

Please sign in to comment.