]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/output-tex.scm (text): switch off char-mapping.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 8 Apr 2004 00:09:28 +0000 (00:09 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 8 Apr 2004 00:09:28 +0000 (00:09 +0000)
* lily/tfm.cc (coding_scheme): replace ' ' in encoding with '-',
because AFM's encoding field cannot have spaces.

ChangeLog
input/mutopia/F.Schubert/morgenlied.ly
lily/bezier-bow.cc
lily/paper-def.cc
lily/tfm.cc
mf/GNUmakefile
mf/cmr.enc [new file with mode: 0644]
scm/encoding.scm
scm/output-tex.scm

index 7f2b2a364394b95a20050dae6dc7992dd555e9e0..a634d1063ec173e70302f440d7c21e5a038a2895 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,20 @@
+2004-04-08  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/output-tex.scm (text): switch off char-mapping.
+
+       * lily/tfm.cc (coding_scheme): replace ' ' in encoding with '-',
+       because AFM's encoding field cannot have spaces.
+
 2004-04-08  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/output-ps.scm (define-fonts): More re/encoding tweaking.
 
 2004-04-08  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/paper-def.cc (find_scaled_font): change to inputencoding.
+
+       * mf/cmr.enc: new file, without hi-bit ascii info. 
+
        * lily/bezier-bow.cc (slur_shape): make indent dependent on
        width. This removes the 'hook' at the end of a long slur.
 
index 0f6401914f6654251f2139c5b222d7839188cb64..0de034dc0b95aeffe85b8ed1dfe352a7811a1023 100644 (file)
@@ -183,6 +183,7 @@ pianoLH = \notes \relative c'' \repeat volta 2 {
            \StaffContext
            minimumVerticalExtent = #'(-3. . 6)
        }
+       inputencoding = #"latin1"
     }
     \midi {
        \tempo 4 = 70
index 257529a7b84149eec45c47617a7a2b23ad9aac77..85d116e78c0725671c357363340009a619806803 100644 (file)
@@ -26,6 +26,16 @@ slur_height (Real width, Real h_inf, Real r_0)
 }
 
   /*
+
+
+  ^              x                    x                  
+  |
+height   <indent>
+  |
+  v      x                                    x
+
+  
+  
   For small w, the height should be proportional to w, for w ->
   infinity, the height should rise to a limit asymptotically.
 
@@ -55,9 +65,9 @@ slur_height (Real width, Real h_inf, Real r_0)
   r_0.
 
 
-  The indent is equals the height of the slur for small slurs.  For
-  large slurs, this gives a certain hookiness at the end, so we
-  increase the indent.
+  The indent is proportional to the height of the slur for small
+  slurs.  For large slurs, this gives a certain hookiness at the end,
+  so we increase the indent.
 
   ind = G(w)
 
index 64dfe31de245c54e0c3daa880275d4dd83038612..7d6aabd9bd283b6a5102f10b8fce43294a9e339e 100644 (file)
@@ -150,7 +150,7 @@ Paper_def::find_scaled_font (Font_metric *f, Real m)
   else
     {
       SCM scale_var = ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
-      SCM coding_var = ly_module_lookup (scope_, ly_symbol2scm ("inputcoding"));
+      SCM coding_var = ly_module_lookup (scope_, ly_symbol2scm ("inputencoding"));
 
       m /= ly_scm2double (scm_variable_ref (scale_var));
       val = Modified_font_metric::make_scaled_font_metric (scm_variable_ref (coding_var),
index 3b06ed338ceb984dc6e28626da9d1f7a65d52322..09ccdd37d5ed9a86430ca64cf8639988b53c11e7 100644 (file)
@@ -105,7 +105,7 @@ Tex_font_metric::make_tfm (String filename)
   
   tfm->encoding_table_ =
     scm_call_1 (ly_scheme_function ("get-coding-table"),
-               scm_makfrom0str (tfm->info_.coding_scheme.to_str0 ()));
+               scm_makfrom0str (tfm->coding_scheme ().to_str0 ()));
 
   return tfm->self_scm ();
 }
@@ -119,7 +119,13 @@ Tex_font_metric::design_size () const
 String
 Tex_font_metric::coding_scheme () const
 {
-  return info_.coding_scheme;
+  String scm = info_.coding_scheme;
+
+  for(int i = 0; i < scm.length (); i++)
+    if (scm[i] == ' ')
+      scm[i] = '-';
+
+  return scm;
 }
 
 int
index d0fa506b31a5d0941eeec7fb5906f024908ed551..1cb01b5c9b6df91f0f6bca6def6f6ee54546be01 100644 (file)
@@ -6,7 +6,7 @@ include $(depth)/make/stepmake.make
 
 AF_FILES = $(wildcard *.af) 
 
-EXTRA_DIST_FILES += README feta.tex
+EXTRA_DIST_FILES += README feta.tex cmr.enc
 
 # We don't use $(MF_FILES), because there's more .mf cruft here
 FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
@@ -23,7 +23,7 @@ LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
 TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
 AFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.afm) \
        $(AF_FILES:%.af=$(outdir)/%.afm)
-ENC_FILES = $(TEXTABLES:.tex=.enc)
+ENC_FILES = $(TEXTABLES:.tex=.enc) $(outdir)/cmr.enc
 TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
 FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
 
@@ -202,3 +202,5 @@ $(SAUTER_FONTS:%=$(outdir)/%.bla):
 $(outdir)/%.pfa: $(outdir)/%.bla
        $(MFTRACE) -I $(outdir)/ --pfa --simplify --keep-trying $(notdir $(basename $@))  && mv $(notdir $@) $(outdir)/
 
+$(outdir)/%.enc: %.enc
+       cp $< $@
diff --git a/mf/cmr.enc b/mf/cmr.enc
new file mode 100644 (file)
index 0000000..fca576b
--- /dev/null
@@ -0,0 +1,36 @@
+% Thomas Esser, Dec 2002. public domain
+%
+% Encoding for:
+%     cmb10 cmbx10 cmbx12 cmbx5 cmbx6 cmbx7 cmbx8 cmbx9 cmbxsl10
+%     cmdunh10 cmr10 cmr12 cmr17cmr6 cmr7 cmr8 cmr9 cmsl10 cmsl12 cmsl8
+%     cmsl9 cmss10cmss12 cmss17 cmss8 cmss9 cmssbx10 cmssdc10 cmssi10
+%     cmssi12 cmssi17 cmssi8cmssi9 cmssq8 cmssqi8 cmvtt10
+%
+/TeXf7b6d320Encoding [
+/Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega
+/ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve
+/macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash
+/suppress /exclam /quotedblright /numbersign /dollar /percent /ampersand
+/quoteright /parenleft /parenright /asterisk /plus /comma /hyphen
+/period /slash /zero /one /two /three /four /five /six /seven /eight
+/nine /colon /semicolon /exclamdown /equal /questiondown /question /at
+/A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X
+/Y /Z /bracketleft /quotedblleft /bracketright /circumflex /dotaccent
+/quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u
+/v /w /x /y /z /endash /emdash /hungarumlaut /tilde /dieresis /suppress
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+] def
index 254086cf6126f2c76f7400474d6a0041b3c97d45..4cff90aad6ab8314f3c8721929c54b6219cc33c7 100644 (file)
@@ -75,14 +75,14 @@ vector of symbols."
        
        '(
         ;; teTeX
-        ("TeX typewriter text" . "09fbbfac.enc") ;; cmtt10
-        ("TeX math symbols" . "10037936.enc") ;; cmbsy
-        ("ASCII caps and digits" . "1b6d048e.enc") ;; cminch
-        ("TeX math italic" . "aae443f0.enc")  ;; cmmi10
-        ("TeX extended ASCII" . "d9b29452.enc")
-        ("TeX text" . "f7b6d320.enc")
-        ("TeX text without f-ligatures" . "0ef0afca.enc")
-        ("Extended TeX Font Encoding - Latin" . "tex256.enc")
+        ("TeX-typewriter-text" . "09fbbfac.enc") ;; cmtt10
+        ("TeX-math-symbols" . "10037936.enc") ;; cmbsy
+        ("ASCII-caps-and-digits" . "1b6d048e.enc") ;; cminch
+        ("TeX-math-italic" . "aae443f0.enc")  ;; cmmi10
+        ("TeX-extended-ASCII" . "d9b29452.enc")
+        ("TeX-text" . "cmr.enc")
+        ("TeX-text-without-f-ligatures" . "0ef0afca.enc")
+        ("Extended-TeX-Font-Encoding---Latin" . "tex256.enc")
         
         ("T1" . "tex256.enc")
 
index 9c0869c8d8cdd8e0baab374457858f3464e5b32c..6ffd94ea9292d2aa6773486cee502b5360731180 100644 (file)
 
 ;; FIXME: explain ploblem: need to do something to make this really safe.  
 (define (output-tex-string s)
-  (if safe-mode?
-      (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
-      s))
+   (if safe-mode?
+       (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
+       s))
 
 (define (lily-def key val)
   (let ((tex-key
 
 (define (text font s)
   (let*
-      ((perm (assoc-get  'char-mapping (ly:font-encoding-alist font))))
+      ((mapping #f))
+
+      ;; TODO: we'd better do this for PS only
+      ;; LaTeX gets in the way, and we need to remap
+      ;; nonprintable chars.
+
+       ; (assoc-get  'char-mapping (ly:font-encoding-alist font))))
 
     (string-append "\\hbox{\\" (font-command font) "{}"
                   (output-tex-string
-                   (if (vector? perm)
-                       (reencode-string perm s)
+                   (if (vector? mapping)
+                       (reencode-string mapping s)
                        s))
                   "}")))