From 6055e8696c0d7c210e051f32ca14f2e259c1e49e Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 6 Oct 2005 10:27:27 +0000 Subject: [PATCH] (print_trailer): only define glyph names when FT_Face has FT_FACE_FLAG_GLYPH_NAMES --- ChangeLog | 5 +++++ lily/open-type-font.cc | 1 + lily/ttf.cc | 24 ++++++++++++++---------- scm/define-grob-properties.scm | 10 +++++++--- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0198b7139..faf12b528a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-06 Han-Wen Nienhuys + + * lily/ttf.cc (print_trailer): only define glyph names when + FT_Face has FT_FACE_FLAG_GLYPH_NAMES + 2005-10-05 Han-Wen Nienhuys * lily/horizontal-bracket.cc (make_bracket): new function. diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index a82a14f0e9..e20a2c4ce5 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -9,6 +9,7 @@ #include "open-type-font.hh" #include + using namespace std; #include diff --git a/lily/ttf.cc b/lily/ttf.cc index 170fbfb719..5ac142ce55 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -131,18 +131,22 @@ print_trailer (void *out, = (TT_MaxProfile *)FT_Get_Sfnt_Table (face, ft_sfnt_maxp); lily_cookie_fprintf (out, "/CharStrings %d dict dup begin\n", mp->numGlyphs); - for (int i = 0; i < mp->numGlyphs; i++) - { - FT_Error error = FT_Get_Glyph_Name (face, i, glyph_name, GLYPH_NAME_LEN); - if (error) - programming_error ("FT_Get_Glyph_Name() returned error"); - else - lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i); - if (! (i % 5)) - lily_cookie_fprintf (out, "\n"); - } + if (face->face_flags & FT_FACE_FLAG_GLYPH_NAMES) + for (int i = 0; i < mp->numGlyphs; i++) + { + FT_Error error = FT_Get_Glyph_Name (face, i, glyph_name, + GLYPH_NAME_LEN); + if (error) + programming_error ("print_trailer(): FT_Get_Glyph_Name() returned error"); + else + lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i); + + if (! (i % 5)) + lily_cookie_fprintf (out, "\n"); + } + lily_cookie_fprintf (out, "end readonly def\n"); lily_cookie_fprintf (out, "FontName currentdict end definefont pop\n"); } diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index f71ee578c7..02d96c137b 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -535,6 +535,7 @@ function is to protect objects from being garbage collected.") (direction-source ,ly:grob? "in case side-relative-direction is set, which grob to get the direction from .") (dot ,ly:grob? "reference to Dots object.") + (figures ,ly:grob-array? "Figured bass objects for continuation line.") (pedal-text ,ly:grob? "Pointer to the text of a mixed-style piano pedal.") (stem ,ly:grob? "pointer to Stem object.") (tremolo-flag ,ly:grob? "The tremolo object on a stem.") @@ -546,14 +547,17 @@ set, which grob to get the direction from .") (accidental-grob ,ly:grob? "Accidental for this note.") (bars ,ly:grob-array? "list of bar line pointers.") (bounded-by-me ,ly:grob-array? "list of spanners that have this -column as start/begin point. Only columns that have grobs or act as bounds are spaced.") +column as start/begin point. Only columns that have grobs or act as +bounds are spaced.") (columns ,ly:grob-array? "list of grobs, typically containing paper-columns or note-column objects.") (conditional-elements ,ly:grob-array? "Internal use only") - (dependencies ,ly:grob-array? "list of score-grob pointers that indicate who to compute first for certain global passes.") + (dependencies ,ly:grob-array? "list of score-grob pointers that indicate +who to compute first for certain global passes.") (encompass-objects ,ly:grob-array? "Objects that a slur should avoid in addition to notes and stems.") - (elements ,ly:grob-array? "list of grobs, type depending on the Grob where this is set in.") + (elements ,ly:grob-array? "list of grobs, type depending on the Grob +where this is set in.") (heads ,ly:grob-array? "List of note heads.") (items-worth-living ,ly:grob-array? "A list of interesting items. If empty in a particular staff, then that staff is erased.") -- 2.39.5