From a8a7c2e12d1ea0413488abfee810c54adabd551e Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 8 Apr 2004 00:09:28 +0000 Subject: [PATCH] * 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. --- ChangeLog | 11 ++++++++ input/mutopia/F.Schubert/morgenlied.ly | 1 + lily/bezier-bow.cc | 16 +++++++++--- lily/paper-def.cc | 2 +- lily/tfm.cc | 10 +++++-- mf/GNUmakefile | 6 +++-- mf/cmr.enc | 36 ++++++++++++++++++++++++++ scm/encoding.scm | 16 ++++++------ scm/output-tex.scm | 18 ++++++++----- 9 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 mf/cmr.enc diff --git a/ChangeLog b/ChangeLog index 7f2b2a3643..a634d1063e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,20 @@ +2004-04-08 Han-Wen Nienhuys + + * 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 * scm/output-ps.scm (define-fonts): More re/encoding tweaking. 2004-04-08 Han-Wen Nienhuys + * 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. diff --git a/input/mutopia/F.Schubert/morgenlied.ly b/input/mutopia/F.Schubert/morgenlied.ly index 0f6401914f..0de034dc0b 100644 --- a/input/mutopia/F.Schubert/morgenlied.ly +++ b/input/mutopia/F.Schubert/morgenlied.ly @@ -183,6 +183,7 @@ pianoLH = \notes \relative c'' \repeat volta 2 { \StaffContext minimumVerticalExtent = #'(-3. . 6) } + inputencoding = #"latin1" } \midi { \tempo 4 = 70 diff --git a/lily/bezier-bow.cc b/lily/bezier-bow.cc index 257529a7b8..85d116e78c 100644 --- a/lily/bezier-bow.cc +++ b/lily/bezier-bow.cc @@ -26,6 +26,16 @@ slur_height (Real width, Real h_inf, Real r_0) } /* + + + ^ x x + | +height + | + 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) diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 64dfe31de2..7d6aabd9bd 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -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), diff --git a/lily/tfm.cc b/lily/tfm.cc index 3b06ed338c..09ccdd37d5 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -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 diff --git a/mf/GNUmakefile b/mf/GNUmakefile index d0fa506b31..1cb01b5c9b 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -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 index 0000000000..fca576b7b4 --- /dev/null +++ b/mf/cmr.enc @@ -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 diff --git a/scm/encoding.scm b/scm/encoding.scm index 254086cf61..4cff90aad6 100644 --- a/scm/encoding.scm +++ b/scm/encoding.scm @@ -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") diff --git a/scm/output-tex.scm b/scm/output-tex.scm index 9c0869c8d8..6ffd94ea92 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -250,9 +250,9 @@ ;; 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 @@ -312,12 +312,18 @@ (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)) "}"))) -- 2.39.5