Hi Urs, On Tue, Apr 28, 2015 at 11:38 AM, Urs Liska <u...@openlilylib.org> wrote:
> > > Am 28.04.2015 um 18:14 schrieb Urs Liska: > >> >> >> Am 28.04.2015 um 17:53 schrieb Urs Liska: >> >>> I think I have found something. >>> >>> After some experimenting with a copy of font-config-get-font-file and >>> trying different approaches I could guess from the documentations available >>> I found that replacing an item in the FcPatternGetString call this function >>> returns the font name and not the Postscript name or the font file. >>> >>> The following preliminary function (if added to font-config-scheme.cc) >>> returns either the Font Name (if the font exists) or "Emmentaler-11" (on my >>> system) if it doesn't exist. I assume it would return other names on other >>> systems: >>> >>> LY_DEFINE (ly_font_config_font_exists, "ly:font-config-font-exists", 1, >>> 0, 0, >>> >>> ... >>> >>> Best >>> Urs >>> >> >> Wrapping this Scheme function around that: >> >> fontExists = >> #(define-scheme-function (parser location font-name)(string?) >> (string=? font-name (ly:font-config-font-exists font-name))) >> >> shows that my idea is right: The C++ function returns the family name of >> either the given font or the (system-dependent) fallback font. Now all >> there would be to it is moving the comparison of the latter Scheme function >> to the C++ function . >> >> Urs >> > > > Last one for this working session: The following function > ly:font-config-font-exists will return true or false depending on whether > the given font is available. I tried this out on my VM (Ubuntu 10.04.4 -- yes, I need to update to the most recent LilyDev...) Should it work for any font that's listed by ly:font-config-display-fonts? It works for most of the names I've tried, though not all. For example. "Kedage" returns #f. > The only drawback (yet) is that now the comparison is case sensitive. But > *that* should be easy now? > I don't find anything convenient. I suppose you could just convert both strings to lower- or uppercase and then compare. But is this desirable? I mean, is LilyPond ever case-insensitive? Thanks for working on this! David
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user