Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clef annotations size refactor #1552

Merged
merged 1 commit into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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