X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpango-font.cc;h=a4fea75109bcb15141db97da016cd30d291375a2;hb=05514c83a49dd3dfabd1fa7774c69c3038ecde6b;hp=6d18820b97e66eb83461a68ea1002e296623d15a;hpb=edf9d00fea686457b4469b82a435d5dc3bf09a56;p=lilypond.git diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 6d18820b97..a4fea75109 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2004--2010 Han-Wen Nienhuys + Copyright (C) 2004--2011 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,8 +111,7 @@ get_unicode_name (char *s, } Stencil -Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item, - bool tight_bbox) const +Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item) const { const int GLYPH_NAME_LEN = 256; char glyph_name[GLYPH_NAME_LEN]; @@ -128,13 +127,11 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item, FT_Face ftface = pango_fc_font_lock_face (fcfont); - PangoRectangle const *which_rect = tight_bbox ? &ink_rect - : &logical_rect; - Box b (Interval (PANGO_LBEARING (logical_rect), PANGO_RBEARING (logical_rect)), - Interval (-PANGO_DESCENT (*which_rect), - PANGO_ASCENT (*which_rect))); + Interval (-PANGO_DESCENT (ink_rect), + PANGO_ASCENT (ink_rect))); + b.scale (scale_); char const *ps_name_str0 = FT_Get_Postscript_Name (ftface); @@ -183,8 +180,8 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item, glyph_name[0] = '\0'; if (has_glyph_names) { - int errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name, - GLYPH_NAME_LEN); + FT_Error errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name, + GLYPH_NAME_LEN); if (errorcode) programming_error ( _f ("FT_Get_Glyph_Name () error: %s", @@ -228,7 +225,7 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item, *tail = scm_cons (scm_list_4 (scm_from_double (ggeo.width * scale_), scm_from_double (ggeo.x_offset * scale_), - scm_from_double (ggeo.y_offset * scale_), + scm_from_double (- ggeo.y_offset * scale_), char_id), SCM_EOL); tail = SCM_CDRLOC (*tail); @@ -300,19 +297,11 @@ Pango_font::physical_font_tab () const return physical_font_tab_; } -Stencil -Pango_font::text_stencil (Output_def* state, - string str, bool music_string) const -{ - return text_stencil (str, music_string, false); -} - extern bool music_strings_to_paths; Stencil -Pango_font::text_stencil (string str, - bool music_string, - bool tight) const +Pango_font::text_stencil (Output_def * /* state */, + string str, bool music_string) const { /* The text assigned to a PangoLayout is automatically divided @@ -334,7 +323,7 @@ Pango_font::text_stencil (string str, for (GSList *p = layout_runs; p; p = p->next) { PangoGlyphItem *item = (PangoGlyphItem *) p->data; - Stencil item_stencil = pango_item_string_stencil (item, tight); + Stencil item_stencil = pango_item_string_stencil (item); item_stencil.translate_axis (last_x, X_AXIS); last_x = item_stencil.extent (X_AXIS)[RIGHT];