From bede204d6cd1488b69e5944e00515b501b4328bf Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 9 Jun 2010 23:51:27 +0200 Subject: [PATCH] Svg with woff fonts: fix crash with empty pango-physical-fonts. Thanks Neil! --- scm/backend-library.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 0c80ee66b3..ec0a537bdd 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -267,7 +267,10 @@ (list-ref pango-pf 2)) (define (pango-font-name pango-font) - (pango-pf-font-name (car (ly:pango-font-physical-fonts pango-font)))) + (let ((pf-fonts (ly:pango-font-physical-fonts pango-font))) + (if (pair? pf-fonts) + (pango-pf-font-name (car pf-fonts)) + ""))) (define-public (define-fonts paper define-font define-pango-pf) "Return a string of all fonts used in PAPER, invoking the functions @@ -293,7 +296,8 @@ DEFINE-FONT DEFINE-PANGO-PF for producing the actual font definition." (define-font font font-name scaling))) (define (pango-font-load-command pango-font) - (let* ((pango-pf (car (ly:pango-font-physical-fonts pango-font))) + (let* ((pf-fonts (ly:pango-font-physical-fonts pango-font)) + (pango-pf (if (pair? pf-fonts) (car pf-fonts) '("" "" 0))) (font-name (pango-pf-font-name pango-pf)) (scaling (ly:output-def-lookup paper 'output-scale))) (if (equal? font-name "unknown") -- 2.39.2