-
Notifications
You must be signed in to change notification settings - Fork 52
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
Lilypond sections can get clipped if they're outside the embedded SVGs bounds #464
Comments
Can you share a small sample song (+ config) so I can reproduce this? Adding |
Here's a zip containing all the relevant files. Let me know if something is weird. I'm not passing any extra arguments to the command, just specifying the primary "chordpro.json" file I included, the |
I cannot reproduce this. Can you also share |
Yes, can do. Here you go: |
Thanks. As you already assumed the problem is a mismatch of font metrics. LilyPond is formatting with the metrics of Times Bold and ChordPro is rendering the resultant SVG with font RobotoSerif. If you run ChordPro with
(The exact names may depend on your system font config) So when you specify
Now LilyPond and ChordPro use the same font metrics and the image will not be clipped. |
Awesome, thanks! |
I'm actually not having much luck. Should I still be setting |
For me, this works (I have LilyPond 2.25): In the preamble:
In the fontconfig:
Running ChordPro with
The end result uses Roboto Serif for the TabNoteHeads, and there is no clipping. LilyPond uses fontconfig so you can verify that it does use the right font:
Does this help? |
Hmmm, I'm still getting the same cut off. The debug output shows this:
I have Lilypond 2.24.4, but not sure if that would affect it. |
Describe the bug
Sometimes, the output SVG from Lilypond isn't perfectly in the bounds of the cropped SVG. This might be due to the possibility of it not knowing the size of the text due to the font changing once embedded in the PDF and uses the PDF's font settings.
The solution might just be to add
overflow="visible"
to the SVG itself once generated?Or I also could just set the right font for Lilypond in its settings, but this might be more easily fixable at the start.
Attachments
System information
Additional context
In my situation, I have
TabNoteHead.font-family = #'roman
, which internally defaults to Times New Roman. But in ChordPro'spdf.fontconfig
, theserif
family is set to Roboto Serif.The text was updated successfully, but these errors were encountered: