X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fall-font-metrics.cc;h=23119125aa593db391b513ea0bb0cc827e7532d6;hb=e5cc39a9a82b3c05156553173a8513db4152b1f9;hp=3792b353db05c0c67189afd0fc822a2f3a2a4814;hpb=6fef7b7a22004cccab9b133d7458fb100d47293a;p=lilypond.git diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 3792b353db..23119125aa 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -1,13 +1,25 @@ /* - all-font-metrics.cc -- implement All_font_metrics + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 1999--2011 Han-Wen Nienhuys - (c) 1999--2007 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "all-font-metrics.hh" +#include "string-convert.hh" #include "international.hh" #include "main.hh" #include "open-type-font.hh" @@ -17,13 +29,16 @@ Index_to_charcode_map const * -All_font_metrics::get_index_to_charcode_map (string filename, FT_Face face) +All_font_metrics::get_index_to_charcode_map (string filename, + int face_index, + FT_Face face) { - if (filename_charcode_maps_map_.find (filename) + string key = filename + String_convert::int_string (face_index); + if (filename_charcode_maps_map_.find (key) == filename_charcode_maps_map_.end ()) - filename_charcode_maps_map_[filename] = make_index_to_charcode_map (face); + filename_charcode_maps_map_[key] = make_index_to_charcode_map (face); - return &filename_charcode_maps_map_[filename]; + return &filename_charcode_maps_map_[key]; } @@ -34,11 +49,9 @@ All_font_metrics::All_font_metrics (string path) #if HAVE_PANGO_FT2 PangoFontMap *pfm = pango_ft2_font_map_new (); - pango_ft2_fontmap_ - = G_TYPE_CHECK_INSTANCE_CAST (pfm, - PANGO_TYPE_FT2_FONT_MAP, - PangoFT2FontMap); - pango_dpi_ = 1200; + pango_ft2_fontmap_ = PANGO_FT2_FONT_MAP (pfm); + + pango_dpi_ = PANGO_RESOLUTION; pango_ft2_font_map_set_resolution (pango_ft2_fontmap_, pango_dpi_, pango_dpi_); @@ -76,7 +89,7 @@ All_font_metrics::find_pango_font (PangoFontDescription const *description, if (!pango_dict_->try_retrieve (key, &val)) { if (be_verbose_global) - progress_indication ("[" + string (pango_fn)); + progress_indication ("\n[" + string (pango_fn)); Pango_font *pf = new Pango_font (pango_ft2_fontmap_, description, @@ -115,7 +128,7 @@ All_font_metrics::find_otf (string name) return 0; if (be_verbose_global) - progress_indication ("[" + file_name); + progress_indication ("\n[" + file_name); val = Open_type_font::make_otf (file_name);