]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/font.scm
* input/test/temporary-stave.ly (texidoc): New example based on an
[lilypond.git] / scm / font.scm
index 025f8f99036cfc18fb478d13ad157ccd4684cf1e..22c7b5f4703ebbcff7d2bc28c366b85b0fb148d4 100644 (file)
        ))
 
 
-
-;; most of these routines have been reimplemented in C++ 
-
-;; TODO TODO . (should not use filtering?)
-;; this is bad, since we generate garbage every font-lookup.
-;; otoh, if the qualifiers is narrow enough , we don't generate much garbage.
-
-(define (filter-field field-name value font-descr-alist)
-  "return those descriptions from FONT-DESCR-LIST whose FIELD-NAME matches VALUE"
-      (filter
-       (lambda (x) (let* (field-value (font-field field-name (car x))) 
-                    (or (eq? field-value '*) (eq? value field-value))))
-       font-descr-alist)
-      )
-
-
 (define size-independent-fonts
   `(
     ((* * * braces *) . ("feta-braces00"
     ((-4 medium upright roman 5) . "cmr5" )
     ((-5 medium upright roman 5) . "cmr5" )
 
+    ((4 medium upright sans 17) . "cmss17")
+    ((3 medium upright sans 17) . "cmss17")
+    ((2 medium upright sans 14) . "cmss14")
+    ((1 medium upright sans 12) . "cmss12")
+    ((0 medium upright sans 10) . "cmss10")
+    ((-1 medium upright sans 9) . "cmss9" )
+    ((-2 medium upright sans 8) . "cmss8" )
+    ((-3 medium upright sans 7) . "cmss7" )
+    ((-4 medium upright sans 6) . "cmss6" )
+    ((-5 medium upright sans 5) . "cmss5" )
+    
     ((3 medium italic roman 12) . "cmti12")
     ((2 medium italic roman 12) . "cmti12")
     ((1 medium italic roman 12) . "cmti12") ;;; ugh. Should add magnification here! 
     ((0 medium italic roman 10) . "cmti10")
     ((-1 medium italic roman 8) . "cmti8")    
     ((-2 medium italic roman 7) . "cmti7")
-    ((-3 medium italic roman 7) . "cmti7")    
+    ((-3 medium italic roman 6) . "cmti6")    
+    ((-4 medium italic roman 5) . "cmti5")    
+    ((-5 medium italic roman 5) . "cmti5")    
 
     ;;; cmbx17 is sauter, not commonly available as Type1.
     ((4 bold upright roman 17) . "cmbx17") 
     ((0 bold upright roman 10) . "cmbx10")
     ((-1 bold upright roman 8) . "cmbx8")
     ((-2 bold upright roman 7) . "cmbx7")
-    
+    ((-3 bold upright roman 6) . "cmbx6")
+    ((-4 bold upright roman 5) . "cmbx5")
+    ((-5 bold upright roman 5) . "cmbx5")
+     
+     
     ((2 bold italic roman 12) . "cmbxti12")
     ((1 bold italic roman 12) . "cmbxti12")
     ((0 bold italic roman 10) . "cmbxti10")
 
     ((-1 bold italic roman 8) . "cmbxti8")
     ((-2 bold italic roman 7) . "cmbxti7")
-    
+    ((-3 bold italic roman 6) . "cmbxti6")
+    ((-4 bold italic roman 5) . "cmbxti5")
+    ((-5 bold italic roman 5) . "cmbxti5")
+     
     ((4 medium upright typewriter 17) . "cmtt17")
     ((3 medium upright typewriter 17) . "cmtt17")
     ((2 medium upright typewriter 12) . "cmtt12")
 
 (define (change-rhs-size font-desc from to )
   (cons (car font-desc)
-       (regexp-substitute/global #f from (cdr font-desc) 'pre to 'post))
-
-  )
+       (regexp-substitute/global #f from (cdr font-desc) 'pre to 'post)))
   
-;; 
-(define (map-alist-keys func list)
-  "map a  function FUNC over the keys of an alist LIST, leaving the vals. "
-  (if (null?  list)
-      '()
-      (cons (cons (func (caar list)) (cdar list))
-           (map-alist-keys func (cdr list)))
-      ))
-
-;; 
-(define (map-alist-vals func list)
-  "map a function FUNC over the vals of  LIST, leaving the keys."
-  (if (null?  list)
-      '()
-      (cons (cons  (caar list) (func (cdar list)))
-           (map-alist-vals func (cdr list)))
-      ))
 
 (define (change-style-sheet-relative-size sheet x)
   (map-alist-keys (lambda (descr) (change-relative-size descr  x)) sheet))
                    (paper20 . 0)
                    (paper23 . 1)
                    (paper26 . 2)
-                   ))
-  )
+                   )))
 
 ;;
 ;; make a kludged up paper-19 style sheet. Broken by virtual fonts.
          (cdr (assoc sym font-list-alist))))
 
 
-
-(define (wild-eq? x y)
-  (or (eq? x y)
-      (eq? x '*)
-      (eq? y '*)))
-       
-(define (font-qualifies? qualifiers font-desc)
-  "does FONT-DESC satisfy QUALIFIERS?"
-  (if (null? qualifiers) #t
-      (if (wild-eq? (font-field (caar qualifiers) font-desc) (cdar qualifiers))
-         (font-qualifies? (cdr qualifiers) font-desc)
-         #f)))
-
-(define (find-first-font qualifiers fonts)
-  (if (null? fonts)
-      ""
-      (if (font-qualifies? qualifiers (caar fonts))
-         (cdar fonts)
-         (find-first-font qualifiers (cdr fonts))
-       )
-      ))
-
-
-(define (select-unique-font qualifiers fonts)
-  "return a single font from FONTS (or a default, if none found)
-and warn if the selected font is not unique.
-"
-  (let*  (
-         (err (current-error-port))
-         )
-    
-
-  (if (not (= (length fonts) 1))
-      (begin
-       (display "\ncouldn't find unique font satisfying " err)
-       (write qualifiers err)
-       (display " found " err)
-       (if (null? fonts)
-           (display "none" err)
-           (write (map cdr  fonts) err))
-       ))
-  
-  (if (null? fonts)
-      "cmr10"
-      (cdar fonts))    ; return the topmost.
-  
-  ))
-
-
-; there used to be a Scheme  properties-to-font-name function,
-; but that is  superseeded by the C++ version  out of speed concerns.
-
-
-(define-public (markup-to-properties abbrev-alist style-alist markup)
-  "DOCME."
-  ;; (display "markup: `")
-  ;; (write markup)
-  ;; (display "'\n")
-  
-  (if (pair? markup)
-      ;; This is hairy.  We want to allow:
-      ;;    ((foo bar) "text")
-      ;;    ((foo (bar . 1)) "text")
-      ;;    ((foo . (0 . 1))) 
-      
-      (if (and (symbol? (car markup))
-              (or (not (pair? (cdr markup)))
-                  (number? (cadr markup))))
-         (if (equal? '() (cdr markup))
-             (markup-to-properties abbrev-alist style-alist (car markup))
-             (list markup))
-         
-         (if (equal? '() (cdr markup))
-             (markup-to-properties abbrev-alist style-alist (car markup))
-             (append (markup-to-properties abbrev-alist style-alist (car markup))
-                     (markup-to-properties abbrev-alist style-alist (cdr markup)))))
-      
-      ;; markup is single abbreviation
-      (let ((entry (assoc markup
-                         ;; assoc-chain?
-                         (append abbrev-alist style-alist))))
-       (if entry
-           (cdr entry)
-           (list (cons markup #t))))))
-
-
 ;;; ascii-script font init
 (define as-font-sheet-alist
   '((as5 . (((* * * braces *) . ("as-braces9"))