lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Encoding Problems


From: Carl Sorensen
Subject: Re: Encoding Problems
Date: Fri, 06 Aug 2004 20:10:55 -0400

On Fri, 2004-08-06 at 10:08, Jan Nieuwenhuizen wrote:
> Carl Sorensen writes:
> 
> > (font-encoding . TeX-text).  In later releases, although scm/font.scm
> 
> Why do you ask for an ecoding?  I think you should ask for: family . sans
> 
Empirically, I found that in order for it to work, I needed to give a
full specification, including encoding, family, series, shape, and
size.  Perhaps I don't know how to do it right.  (An example is given
below).


> > I found that changes were made to scm/encoding.scm for release 2.3.7,
> > which I believe are responsible for the problem, but I don't know enough
> > about how the fonts work in lilypond to fix it.
> 
> What changes did you find?

THey're listed below, but I was probably presumptuous in assuming that
this was the source of the problem.  It was the only thing I found in
the changelog that mentioned working with fonts.

address@hidden lilypond]$ diff -u 2.3.6/lilypond/scm/encoding.scm
2.3.7/lilypond/scm/encoding.scm
--- 2.3.6/lilypond/scm/encoding.scm     2004-04-09 05:04:20.000000000
-0400
+++ 2.3.7/lilypond/scm/encoding.scm     2004-07-14 21:33:07.000000000
-0400
@@ -12,7 +12,7 @@
  
 (define-public (read-encoding-file filename)
   "Read .enc file, return (COMMAND-NAME . VECTOR-OF-SYMBOLS)."
-  (let* ((raw (ly:kpathsea-gulp-file filename))
+  (let* ((raw (ly:gulp-file (ly:kpathsea-expand-path filename)))
         (string (regexp-substitute/global #f "%[^\n]*" raw 'pre ""
'post))
         (command (match:substring
                (string-match "/([^ \t\n\r]*)[ \t\n\r]+[[]" string) 1))
@@ -88,7 +88,8 @@
         ;; aliases
         ("T1" . "tex256.enc")
         ("adobe" . "8a.enc")
-        ("latin1" . "cork.enc")
+        ("latin1" . "latin1.enc")
+        ("ec" . "EC.enc")
          
         ;; LilyPond.
         ("fetaBraces" . "feta-braces-a.enc")
@@ -99,7 +100,15 @@
  
 (define (get-coding coding-name)
   (let ((entry (assoc-get coding-name coding-alist)))
-    (cons (car entry) (force (cdr entry)))))
+    (if entry (cons (car entry) (force (cdr entry)))
+       (if (equal? coding-name "feta-music")
+           (begin
+             (ly:warn "installation problem: deprecated encoding
requested: ~S" coding-name)
+             (exit 1))
+       (let ((fallback "latin1"))
+         (ly:warn "programming error: no such encoding: ~S"
coding-name)
+         (ly:warn "programming error: cross thumbs, using: ~S:"
fallback)
+         (get-coding fallback))))))
  
 (define-public (get-coding-filename coding-name)
   (car (get-coding coding-name)))
[
> 
> > Could I get either (a) a fix to lilypond so that the current font
> > requests in fret-diagrams work properly again, or (b) a description of
> > how I should fix the font requests so that they work properly?
> 
> A small example often helps.
> 
> Jan.

Sorry, I had a brain cramp.  I hadn't figured out (then) an easy way to
make a small example.  Now, it's right here.

#(def-markup-command (sans-serif-text paper props defstring) (string?)
  "Display markup text in sans-serif font."
   (let (
         (font (ly:paper-get-font paper `(((font-encoding . TeX-text)
                                           (font-family . sans)
                                           (font-series . medium) 
                                           (font-shape . upright)
                                           (font-size . 1))))))
        (fontify-text font defstring)))


 
\score {
    \notes {
        a'2.^\markup \sans-serif-text  #"abcde"
    }
  \paper{ raggedright = ##t }
}


This code results in the attached images under 2.3.6 and 2.3.7.


Thanks,

Carl

Attachment: font-test-2.3.6.png
Description: PNG image

Attachment: font-test-2.3.7.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]