- (else (error "unknown unit" (ly:unit)))))
-
-;;; font
-(define-public (font-family font)
- (let ((name (ly:font-name font)))
- (if name
- (regexp-substitute/global #f "^GNU-(.*)-[.0-9]*$" name 'pre 1 'post)
- (begin
- ;;(stderr "font-name: ~S\n" (ly:font-name font))
- ;;(stderr "font-file-name: ~S\n" (ly:font-file-name font))
- (ly:font-file-name font)))))
-
-(define-public (char->unicode-index font char)
- ;; (format (current-error-port) "UNICODE:~S:~S:~S\n"
- ;; font (ly:font-encoding font) (char->integer char))
- ;; (force-output (current-error-port))
- (+ (case (ly:font-encoding font)
- ((fetaMusic) (- #xe000 #x20))
- ((fetaBraces) (- #xe000 #x40))
- ((fetaBraces) (- #xe000 #x40))
- ;;(else 0))
- ;; FIXME: bigcheese says FontSpecific
- (else (if (string=? (font-family font) "bigcheese20")
- ;;#xf000 0)))
- ;; FIXME: hmm, why does name_to_index not return actual
- ;; unicode mapping?
-
- ;; ugh, we must know which font from bigcheese;
- ;; feta-proper starts at 0xefc
- ;; but we cannot display feta-nummer or feta-din characters
- ;; this way
- #xe0fc 0)))
- (char->integer char)))
+ (else (ly:error (_ "unknown unit: ~S") (ly:unit)))))
+
+(define-public lily-unit->mm-factor
+ (* 25.4 (/ lily-unit->bigpoint-factor 72)))
+
+;;; FONT may be font smob, or pango font string...
+(define-public (font-name-style font)
+ ;; FIXME: ughr, (ly:font-name) sometimes also has Style appended.
+ (let* ((font-name (ly:font-name font))
+ (full-name (if font-name font-name (ly:font-file-name font)))
+ (name-style (string-split full-name #\-)))
+ ;; FIXME: ughr, barf: feta-alphabet is actually emmentaler
+ (if (string-prefix? "feta-alphabet" full-name)
+ (list "emmentaler"
+ (substring full-name (string-length "feta-alphabet")))
+ (if (not (null? (cdr name-style)))
+ name-style
+ (append name-style '("Regular"))))))
+
+(define-public (modified-font-metric-font-scaling font)
+ (let* ((designsize (ly:font-design-size font))
+ (magnification (* (ly:font-magnification font)))
+ (scaling (* magnification designsize)))
+ (debugf "scaling:~S\n" scaling)
+ (debugf "magnification:~S\n" magnification)
+ (debugf "design:~S\n" designsize)
+ scaling))
+
+(define-public (version-not-seen-message input-file-name)
+ (ly:message
+ (string-append
+ input-file-name ": 0: " (_ "warning: ")
+ (format #f
+ (_ "no \\version statement found, please add~afor future compatibility")
+ (format #f "\n\n\\version ~s\n\n" (lilypond-version))))))
+
+(define-public (old-relative-not-used-message input-file-name)
+ (ly:message
+ (string-append
+ input-file-name ": 0: " (_ "warning: ")
+ (_ "old relative compatibility not used"))))