[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: try except in lilypond
From: |
Urs Liska |
Subject: |
Re: try except in lilypond |
Date: |
Sun, 20 Nov 2016 01:00:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Am 19.11.2016 um 23:50 schrieb Noeck:
> Hi Mike, Andrew and David,
>
> thanks for your suggestions and help. My question was driven by the
> intention to write a score in one file that can be shared and compiled
> standalone and can optionally include my custom settings and fonts.
>
> This way, I could share it and it would probably look best with all the
> extra settings, but if the fonts are not installed etc., the score will
> still compile.
>
> So any solution that does not fit in the source file of the score
> creates the kind of dependencies I want to avoid.
>
> I will have a look at the guile exceptions whether that is a solution.
I'm only now at the regular computer to comment.
I don't think you need exceptions for the kind of request you need. If
I'm not completely mistaken with your use case an if clause (or rather
"if not") should be perfectly fine.
However, I'm not sure how you can determine if a font is installed on
your system.
I assume it's possible to route the the font list shown by
ly:font-config-display-fonts to a string and then check if given font
is listed there.
There's also ly:font-config-get-font-file, but that probably will just
*not* really help you because fontconfig will *always* return a font
file - either the right one or one that *it* thinks is the closest
match. I got stuck there when I tried to integrate notation fonts
installed as system fonts. I wanted to implement a fallback to
Emmentaler, but it didn't work out for exactly that reason. It seems
that fontconfig happily gives me Arial as a replacement font for
Paganini ;-)
But if someone can tell you how to get either the font file name for
your specific font or the whole list of available fonts in a string you
can determine if the right thing is in that string and then act accordingly.
HTH
Urs
> Thanks,
> Joram
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
- try except in lilypond, Noeck, 2016/11/19
- RE: try except in lilypond, Mike Solomon, 2016/11/19
- Re: try except in lilypond, Andrew Bernard, 2016/11/19
- Re: try except in lilypond, David Kastrup, 2016/11/19
- RE: try except in lilypond, Andrew Bernard, 2016/11/19
- Re: try except in lilypond, Noeck, 2016/11/19
- Re: try except in lilypond,
Urs Liska <=
- Re: try except in lilypond, Noeck, 2016/11/20
- Re: try except in lilypond, Timothy Lanfear, 2016/11/20
- Re: try except in lilypond, Noeck, 2016/11/20
- Re: try except in lilypond, Timothy Lanfear, 2016/11/20
- Re: try except in lilypond, Noeck, 2016/11/20
- Re: try except in lilypond, Urs Liska, 2016/11/20