I am trying to figure out how I can get Old Style numerals to be used for the page numbers. I found some scheme code here (http://www.mrlauer.org/music/) that defines a markup command oldStyleNum that will replace any digit with the unicode string for the appropriate old style numeral. However, I don't know how to make this work with the page number, because when I try to put \oldStyleNum\fromproperty #'page:page-number-string the oldStyleNum command isn't getting the numeric string to process, but something else, and I don't really know scheme at all, and haven't been able to figure this out after looking at it for a few hours, and I thought someone else might know.
What follows is sample code that shows old style numerals in the title and (unfortunately) regular numerals for the page number. Thanks, Ben --------------------- \version "2.14.2" % Michael's utilities %% UTF-8 utilities #(define (utf-8->list str) (define (numBytes leader) (cond ((< leader #x80) 1) ((< leader #xc0) (begin (stderr "programming-error: bad utf- 8:~x\n" leader) 1)) ((< leader #xe0) 2) ((< leader #xf0) 3) ((< leader #xf8) 4) (else (begin (stderr "programming-error: utf-8 too big:~x\n" leader) 1)))) (define (helper start l n) (if (= n 0) start (helper (+ (* start #x40) (modulo (car l) #x40)) (cdr l) (- n 1)))) (define (utf-8->int l) (let* ((leader (car l)) (n (- (numBytes leader) 1)) (fac (/ #x80 (expt 2 n))) (rest (cdr l)) (result (helper (modulo leader fac) rest n))) result)) (define (toListHelper lst chars) (if (null? lst) (reverse chars) (let* ((c (utf-8->int lst)) (n (numBytes (car lst))) (t (list-tail lst n)) (newC (cons c chars))) (toListHelper t newC)))) (toListHelper (map char->integer (string->list str)) '() )) %These are appropriate for Junicode, and other fonts. Override as necessary oldStyleZeroCode = ##xF730 smallCapsACode = ##xF761 %For Linux Libertine oldStyleZeroCodeLL = ##xE01A smallCapsACodeLL = ##xE051 #(define (change-char-helper aa test? offset) (if (string? aa) (let* ((chars (utf-8->list aa)) (tosc (map (lambda (c) (if (and (<= c 127) (test? (integer->char c))) (ly:wide-char->utf-8 (+ c offset)) (if (and (<= c 255) (>= c 224)) (ly:wide-char->utf-8 (+ c offset)) (if (= c #x0153) (ly:wide-char->utf-8 #xF6FA) (ly:wide-char->utf-8 c) ) ) ) ) chars)) (newStr (apply string-append tosc))) newStr) aa) ) #(define (to-old-style str) (change-char-helper str char-numeric? (- oldStyleZeroCode (char->integer #\0)))) #(define (to-small-caps str) (change-char-helper str char-lower-case? (- smallCapsACode (char->integer #\a)))) #(define-markup-command (realCaps layout props str) (markup?) "Real small capitals" (interpret-markup layout props (to-small-caps str))) #(define-markup-command (oldStyleNum layout props str) (markup?) "Old-style numerals" (interpret-markup layout props (to-old-style str))) #(define-markup-command (smallCapsOldStyle layout props str) (markup?) "Real small caps and old-style numerals" (interpret-markup layout props (to-old-style (to-small-caps str)))) %%% #(define-public (bar-number-print grob) "Print function for making oldStyle numbers. Useful for BarNumber, for example" (let* ((text (ly:grob-property grob 'text)) (layout (ly:grob-layout grob)) (defs (ly:output-def-lookup layout 'text-font-defaults)) (props (ly:grob-alist-chain grob defs))) (ly:text-interface::interpret-markup layout props (if (string? text) (markup #:oldStyleNum text) text)))) \header { title = \markup{\oldStyleNum"1234567890" "1234567890"} } \paper { two-sided = ##t print-first-page-number = ##t oddHeaderMarkup = \markup\fill-line{ \combine \fill-line{"" \on-the-fly #print-page-number-check-first \oldStyleNum\fromproperty #'page:page-number-string } "" } evenHeaderMarkup = \markup { \combine \on-the-fly #print-page-number-check-first \oldStyleNum\fromproperty #'page:page-number-string "" } } {c'4} _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user