@@ -230,6 +230,8 @@ permalink: /sheet/
230230 <option value =" " >Unicode ♭♯ (default)</option >
231231 <option value =" ascii" >ASCII b#</option >
232232 </select >
233+ <label for =" gh-auto-size-checkbox" >Auto-size font:</label >
234+ <input type =" checkbox" id =" gh-auto-size-checkbox" checked >
233235 </span >
234236 </div >
235237
@@ -279,6 +281,7 @@ permalink: /sheet/
279281 preset: z .string ().optional (),
280282 accidentals: z .enum ([' ascii' , ' unicode' ]).optional (),
281283 barsPerLine: z .number ().int ().min (1 ).optional (),
284+ autoSize: z .boolean ().optional (),
282285 transposeSemitones: z .number ().int ().min (- 11 ).max (11 ).optional (),
283286 }),
284287 ]);
@@ -331,6 +334,7 @@ title: "Bebop Blues"
331334 const accidentalsSelect = document .getElementById (' accidentals-select' );
332335 const slashStyleSelect = document .getElementById (' slash-style-select' );
333336 const autoSizeCheckbox = document .getElementById (' auto-size-checkbox' );
337+ const ghAutoSizeCheckbox = document .getElementById (' gh-auto-size-checkbox' );
334338 const lineLengthSelect = document .getElementById (' line-length-select' );
335339 const htmlOptions = document .getElementById (' html-options' );
336340 const ghOptions = document .getElementById (' gh-options' );
@@ -373,6 +377,7 @@ title: "Bebop Blues"
373377 if (accidentals) currentRenderer .setAttribute (' accidentals' , accidentals);
374378 const barsPerLine = ghLineLengthSelect .value ;
375379 if (barsPerLine) currentRenderer .setAttribute (' bars-per-line' , barsPerLine);
380+ if (! ghAutoSizeCheckbox .checked ) currentRenderer .setAttribute (' no-auto-size' , ' ' );
376381 htmlOptions .hidden = true ;
377382 ghOptions .hidden = false ;
378383 } else {
@@ -489,6 +494,7 @@ title: "Bebop Blues"
489494 if (ghNotationPresetSelect .value ) config .preset = ghNotationPresetSelect .value ;
490495 if (ghAccidentalsSelect .value ) config .accidentals = ghAccidentalsSelect .value ;
491496 if (ghLineLengthSelect .value ) config .barsPerLine = parseInt (ghLineLengthSelect .value , 10 );
497+ if (! ghAutoSizeCheckbox .checked ) config .autoSize = false ;
492498 }
493499 const semitones = parseInt (transposeSelect .value , 10 );
494500 if (semitones !== 0 ) config .transposeSemitones = semitones;
@@ -538,6 +544,7 @@ title: "Bebop Blues"
538544 ghNotationPresetSelect .value = initialConfig .preset ?? ' ' ;
539545 ghAccidentalsSelect .value = initialConfig .accidentals ?? ' ' ;
540546 ghLineLengthSelect .value = initialConfig .barsPerLine ? String (initialConfig .barsPerLine ) : ' ' ;
547+ ghAutoSizeCheckbox .checked = initialConfig .autoSize !== false ;
541548 } else {
542549 typefaceSelect .value = initialConfig .typeface ?? ' sans' ;
543550 notationPresetSelect .value = initialConfig .preset ?? ' ' ;
@@ -679,6 +686,15 @@ title: "Bebop Blues"
679686 updateURL ();
680687 });
681688
689+ ghAutoSizeCheckbox .addEventListener (' change' , () => {
690+ if (currentRenderer && rendererSelect .value === ' grille-harmonique' ) {
691+ if (ghAutoSizeCheckbox .checked ) currentRenderer .removeAttribute (' no-auto-size' );
692+ else currentRenderer .setAttribute (' no-auto-size' , ' ' );
693+ outputElement .update ();
694+ }
695+ updateURL ();
696+ });
697+
682698 const formatBtn = document .getElementById (' format-btn' );
683699 const formatError = document .getElementById (' format-error' );
684700
0 commit comments