From: Han-Wen Nienhuys Date: Sun, 12 Dec 2004 23:36:48 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.5.14~428 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7a42c24ad876cae059e4425331a3b873575c157b;p=lilypond.git *** empty log message *** --- diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 12c2d60398..be4a3a23b6 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -290,7 +290,7 @@ get_encoded_index (Font_metric *m, String input_coding, int code) } Offset -Font_metric::attachment_point (String str) const +Font_metric::attachment_point (String) const { return Offset (0, 0); } diff --git a/lily/include/modified-font-metric.hh b/lily/include/modified-font-metric.hh index d9fd9c6585..79ade2db86 100644 --- a/lily/include/modified-font-metric.hh +++ b/lily/include/modified-font-metric.hh @@ -21,10 +21,11 @@ public: SCM font_encoding, SCM input_encoding); virtual int count () const; virtual Offset get_indexed_wxwy (int) const; + virtual Offset attachment_point (String) const; virtual int name_to_index (String) const; virtual String coding_scheme () const; virtual Font_metric *original_font () const; - + protected: SCM coding_vector_; SCM coding_table_; diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 801d666de0..f92b534ad4 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -134,6 +134,13 @@ Modified_font_metric::count () const return orig_->count (); } +Offset +Modified_font_metric::attachment_point (String s) const +{ + Offset o = orig_->attachment_point (s); + return o * magnification_; +} + Offset Modified_font_metric::get_indexed_wxwy (int k) const { diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 92a8df25e3..5a9085ef4e 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -16,6 +16,9 @@ #include "open-type-font.hh" #include "dimensions.hh" + +const Real point_constant = 1 PT; + FT_Byte * load_table (char const *tag_str, FT_Face face, FT_ULong *length) { @@ -44,7 +47,7 @@ SCM load_scheme_table (char const *tag_str, FT_Face face) { FT_ULong length = 0; - FT_Byte* buffer =load_table (tag_str, face, &length); + FT_Byte* buffer = load_table (tag_str, face, &length); SCM tab = SCM_EOL; if (buffer) @@ -98,8 +101,9 @@ Open_type_font::make_otf (String str) return otf->self_scm (); } -Open_type_font::Open_type_font(FT_Face) +Open_type_font::Open_type_font(FT_Face face) { + face_ = face; lily_character_table_ = SCM_EOL; lily_global_table_ = SCM_EOL; @@ -127,7 +131,7 @@ Open_type_font::attachment_point (String glyph_name) const SCM char_alist = entry; - SCM att_scm =scm_cdr (scm_assq (char_alist, ly_symbol2scm ("attachment"))); + SCM att_scm =scm_cdr (scm_assq (ly_symbol2scm ("attachment"), char_alist)); return ly_scm2offset (att_scm); } @@ -153,7 +157,6 @@ Open_type_font::get_indexed_char (int signed_idx) const Box b (Interval (-hb, m.width - hb), Interval (-vb, m.height - vb)); - Real point_constant = 1 PT; b.scale (design_size() * Real (point_constant) / face_->units_per_EM); @@ -176,5 +179,5 @@ Open_type_font::name_to_index (String nm) const Real Open_type_font::design_size () const { - return scm_to_double (scm_hashq_ref (lily_global_table_, ly_symbol2scm ("staffsize"), SCM_BOOL_F)); + return point_constant * scm_to_double (scm_hashq_ref (lily_global_table_, ly_symbol2scm ("staffsize"), SCM_BOOL_F)); } diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index de737860b0..27bc2bb05e 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -395,29 +395,29 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, String glyph_name; if (prefix_set & VIRGA) { - glyph_name = "vaticana-punctum"; - primitive->set_property ("add-stem", ly_bool2scm (true)); + glyph_name = "vaticana.punctum"; + primitive->set_property ("add.stem", ly_bool2scm (true)); } else if (prefix_set & QUILISMA) - glyph_name = "vaticana-quilisma"; + glyph_name = "vaticana.quilisma"; else if (prefix_set & ORISCUS) - glyph_name = "solesmes-oriscus"; + glyph_name = "solesmes.oriscus"; else if (prefix_set & STROPHA) if (prefix_set & AUCTUM) - glyph_name = "solesmes-stropha-aucta"; - else glyph_name = "solesmes-stropha"; + glyph_name = "solesmes.stropha.aucta"; + else glyph_name = "solesmes.stropha"; else if (prefix_set & INCLINATUM) if (prefix_set & AUCTUM) - glyph_name = "solesmes-incl-auctum"; + glyph_name = "solesmes.incl.auctum"; else if (prefix_set & DEMINUTUM) - glyph_name = "solesmes-incl-parvum"; + glyph_name = "solesmes.incl.parvum"; else - glyph_name = "vaticana-inclinatum"; + glyph_name = "vaticana.inclinatum"; else if (prefix_set & DEMINUTUM) if (i == 0) { // initio debilis - glyph_name = "vaticana-reverse-plica"; + glyph_name = "vaticana.reverse.plica"; } else if (prev_delta_pitch > 0) { @@ -425,10 +425,10 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, if (!(prev_context_info & FLEXA_RIGHT)) /* correct head of previous primitive */ if (prev_delta_pitch > 1) - prev_glyph_name = "vaticana-epiphonus"; + prev_glyph_name = "vaticana.epiphonus"; else - prev_glyph_name = "vaticana-vepiphonus"; - glyph_name = "vaticana-plica"; + prev_glyph_name = "vaticana.vepiphonus"; + glyph_name = "vaticana.plica"; } else // (prev_delta_pitch <= 0) { @@ -439,12 +439,12 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, if (i > 1) { /* cephalicus head with fixed size cauda */ - prev_glyph_name = "vaticana-inner-cephalicus"; + prev_glyph_name = "vaticana.inner.cephalicus"; } else { /* cephalicus head without cauda */ - prev_glyph_name = "vaticana-cephalicus"; + prev_glyph_name = "vaticana.cephalicus"; } /* @@ -460,35 +460,35 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, prev_primitive->set_property ("add-cauda", ly_bool2scm (false)); } - glyph_name = "vaticana-reverse-plica"; + glyph_name = "vaticana.reverse.plica"; } else if (prefix_set & (CAVUM | LINEA)) if ((prefix_set & CAVUM) && (prefix_set & LINEA)) - glyph_name = "vaticana-linea-punctum-cavum"; + glyph_name = "vaticana.linea.punctum.cavum"; else if (prefix_set & CAVUM) - glyph_name = "vaticana-punctum-cavum"; + glyph_name = "vaticana.punctum.cavum"; else - glyph_name = "vaticana-linea-punctum"; + glyph_name = "vaticana.linea.punctum"; else if (prefix_set & AUCTUM) if (prefix_set & ASCENDENS) - glyph_name = "solesmes-auct-asc"; + glyph_name = "solesmes.auct.asc"; else - glyph_name = "solesmes-auct-desc"; + glyph_name = "solesmes.auct.desc"; else if ((context_info & STACKED_HEAD) && (context_info & PES_UPPER)) if (prev_delta_pitch > 1) - glyph_name = "vaticana-upes"; + glyph_name = "vaticana.upes"; else - glyph_name = "vaticana-vupes"; + glyph_name = "vaticana.vupes"; else - glyph_name = "vaticana-punctum"; + glyph_name = "vaticana.punctum"; /* * This head needs a cauda, if it starts a flexa, is not the upper * head of a pes, and if it is a punctum. */ if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER)) - if (!String::compare (glyph_name, "vaticana-punctum")) + if (!String::compare (glyph_name, "vaticana.punctum")) primitive->set_property ("add-cauda", ly_bool2scm (true)); /* @@ -527,11 +527,11 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, { if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD)) { - if (!String::compare (prev_glyph_name, "vaticana-punctum")) + if (!String::compare (prev_glyph_name, "vaticana.punctum")) if (prev_delta_pitch > 1) - prev_glyph_name = "vaticana-lpes"; + prev_glyph_name = "vaticana.lpes"; else - prev_glyph_name = "vaticana-vlpes"; + prev_glyph_name = "vaticana.vlpes"; } }