]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/afm.cc
new file.
[lilypond.git] / lily / afm.cc
index 456f4893c2cc96a9ab8d2efd56baf9816ac29e97..0bc5aac07d4879eafac1feb10ef66683bc1b5e3e 100644 (file)
@@ -1,9 +1,9 @@
 /*   
-  afm.cc --  implement Adobe_font_metric
+  afm.cc -- implement Adobe_font_metric
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -24,7 +24,7 @@ Adobe_font_metric::Adobe_font_metric (AFM_Font_info *fi)
   for (int i = 256 >? fi->numOfChars; i--;)
     ascii_to_metric_idx_.push (-1);
   
-  for (int i=0; i < fi->numOfChars; i++)
+  for (int i = 0; i < fi->numOfChars; i++)
     {
       AFM_CharMetricInfo * c = fi->cmi + i;
 
@@ -48,14 +48,14 @@ Adobe_font_metric::make_afm (AFM_Font_info *fi,
 {
   Adobe_font_metric *fm = new Adobe_font_metric (fi);
   fm->checksum_ = checksum;
-  fm->design_size_ = design_size;
+  fm->design_size_ = design_size; 
   return fm->self_scm ();    
 }
 
 AFM_CharMetricInfo const*
 Adobe_font_metric::find_ascii_metric (int a) const
 {
-  if (ascii_to_metric_idx_[a] >=0)
+  if (ascii_to_metric_idx_[a] >= 0)
     {
       int code = ascii_to_metric_idx_[a];
       if (code >= 0)
@@ -76,7 +76,7 @@ Adobe_font_metric::find_char_metric (String nm) const
 int
 Adobe_font_metric::name_to_index (String name) const
 {
-  std::map<String,int>::const_iterator ai = name_to_metric_dict_.find (name);
+  std::map<String, int>::const_iterator ai = name_to_metric_dict_.find (name);
   if (ai == name_to_metric_dict_.end ())
     return -1;
   return (*ai).second; 
@@ -165,7 +165,7 @@ Offset
 Adobe_font_metric::get_indexed_wxwy (int k) const
 {
   AFM_CharMetricInfo const *mi = font_info_->cmi + k;
-#if 1 /* Fine for feta; ec-fonts-mftraced do not have AFM :-(
+#if 1 /* Fine for feta; ec-fonts-mftraced do not have AFM :-( */
   return Offset (mi->wx, mi->wy) * 0.001 PT;
 #else /* FIXME: about right for lmodern.  */
   return Offset (mi->wx, mi->wy) * 1.14 * 0.001 PT;
@@ -178,8 +178,10 @@ Adobe_font_metric::design_size () const
   return design_size_;    
 }
 
+
+
 String
-Adobe_font_metric::coding_scheme () const
+Adobe_font_metric::font_name () const
 {
-  return font_info_->gfi->encodingScheme;
+  return font_info_->gfi->fontName;
 }