lilypond-user-fr
[Top][All Lists]
Advanced

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

Re: Snippet Accents et SmallCaps : tous les accents ?


From: Pierre Perol-Schneider
Subject: Re: Snippet Accents et SmallCaps : tous les accents ?
Date: Thu, 27 Sep 2012 12:31:32 +0200

Voici une liste (exhaustive je l'espère) des caractères dispo et accentués pour le fonte smallCaps :

\version "2.16.0"

#(use-modules (ice-9 regex)) 
#(define-public string-upper-case #f) 
#(define accented-char-upper-case? #f) 
#(define accented-char-lower-case? #f) 
#(let ((lower-case-accented-string "áàâäǎăāãåąæǣćĉčçďđðéèêëěĕēęəĝğģĥħíìîïǐĭīĩįĵķĺŀľļłńňñóòôöǒŏōõǫőøœŕřśŝšşťţþúùûüǔŭūųǘǜǚŵýŷÿȳźž")  
       (upper-case-accented-string "ÁÀÂÄǍĂĀÃÅĄÆǢĆĈČÇĎĐÐÉÈÊËĚĔĒĘƏĜĞĢĤĦÍÌÎÏǏĬĪĨĮĴĶĹĿĽĻŁŃŇÑÓÒÔÖǑŎŌÕǪŐØŒŔŘŚŜŠŞŤŢÞÚÙÛÜǓŬŪŲǗǛǙŴÝŶŸȲŹŽ")) 
   (define (group-by-2 chars result)  
      (if (or (null? chars) (null? (cdr chars))) 
          (reverse! result) 
          (group-by-2 (cddr chars) 
                      (cons (string (car chars) (cadr chars)) 
                            result)))) 
   (let ((lower-case-accented-chars 
          (group-by-2 (string->list lower-case-accented-string) (list))) 
         (upper-case-accented-chars 
          (group-by-2 (string->list upper-case-accented-string) (list)))) 
     (set! string-upper-case 
           (lambda (str) 
             (define (replace-chars str froms tos) 
               (if (null? froms) 
                   str 
                   (replace-chars (regexp-substitute/global #f (car froms) str 
                                                            'pre (car tos) 'post) 
                                  (cdr froms) 
                                  (cdr tos)))) 
             (string-upcase (replace-chars str 
                                           lower-case-accented-chars 
                                           upper-case-accented-chars)))) 
     (set! accented-char-upper-case? 
           (lambda (char1 char2) 
             (member (string char1 char2) upper-case-accented-chars string=?))) 
     (set! accented-char-lower-case? 
           (lambda (char1 char2) 
             (member (string char1 char2) lower-case-accented-chars string=?))))) 
#(define-markup-command (smallCaps layout props text) (markup?) 
  (define (string-list->markup strings lower) 
    (let ((final-string (string-upper-case 
                         (apply string-append (reverse strings))))) 
      (if lower 
          (markup #:fontsize -2 final-string) 
          final-string))) 
  (define (make-small-caps rest-chars currents current-is-lower prev-result) 
    (if (null? rest-chars) 
        (make-concat-markup (reverse! (cons (string-list->markup 
                                              currents current-is-lower) 
                                            prev-result))) 
        (let* ((ch1 (car rest-chars)) 
               (ch2 (and (not (null? (cdr rest-chars))) (cadr rest-chars))) 
               (this-char-string (string ch1)) 
               (is-lower (char-lower-case? ch1)) 
               (next-rest-chars (cdr rest-chars))) 
          (cond ((and ch2 (accented-char-lower-case? ch1 ch2)) 
                 (set! this-char-string (string ch1 ch2)) 
                 (set! is-lower #t) 
                 (set! next-rest-chars (cddr rest-chars))) 
                ((and ch2 (accented-char-upper-case? ch1 ch2)) 
                 (set! this-char-string (string ch1 ch2)) 
                 (set! is-lower #f) 
                 (set! next-rest-chars (cddr rest-chars)))) 
          (if (or (and current-is-lower is-lower) 
                  (and (not current-is-lower) (not is-lower))) 
              (make-small-caps next-rest-chars 
                               (cons this-char-string currents) 
                               is-lower 
                               prev-result) 
              (make-small-caps next-rest-chars 
                               (list this-char-string) 
                               is-lower 
                               (if (null? currents) 
                                   prev-result 
                                   (cons (string-list->markup 
                                            currents current-is-lower) 
                                         prev-result))))))) 
  (interpret-markup layout props 
    (if (string? text) 
        (make-small-caps (string->list text) (list) #f (list)) 
        text))) 
        
\markup \smallCaps "A a Á á À à Â â Ä ä Ǎ ǎ Ă ă Ā ā Ã ã Å å Ą ą Æ æ Ǣ ǣ"   
\markup \smallCaps "B b"
\markup \smallCaps "C c Ć ć Ĉ ĉ Č č Ç ç"  
\markup \smallCaps "D d Ď ď Đ đ Ð ð"
\markup \smallCaps "E e É é È è Ê ê Ë ë Ě ě Ĕ ĕ Ē ē Ę ę Ə ə"
\markup \smallCaps "F f"
\markup \smallCaps "G g Ĝ ĝ Ğ ğ Ģ ģ"
\markup \smallCaps "H h Ĥ ĥ Ħ ħ"
\markup \smallCaps "I i Í í Ì ì Î î Ï ï Ǐ ǐ Ĭ ĭ Ī ī Ĩ ĩ Į į"
\markup \smallCaps "J j Ĵ ĵ"   
\markup \smallCaps "K k Ķ ķ"
\markup \smallCaps "L l Ĺ ĺ Ŀ ŀ Ľ ľ Ł ł"
\markup \smallCaps "M m"
\markup \smallCaps "N n Ń ń Ň ň Ñ ñ"   
\markup \smallCaps "O o Ó ó Ò ò Ô ô Ö ö Ǒ ǒ Ŏ ŏ Ō ō Õ õ Ǫ ǫ Ő ő Ø ø Œ œ"
\markup \smallCaps "P p"
\markup \smallCaps "Q q"
\markup \smallCaps "R r Ŕ ŕ Ř ř"  
\markup \smallCaps "S s Ś ś Ŝ ŝ Š š Ş ş ß"
\markup \smallCaps "T t Ť ť Ţ ţ Þ þ"
\markup \smallCaps "U u Ú ú Ù ù Û û Ü ü Ǔ ǔ Ŭ ŭ Ū ū Ų ų Ǘ ǘ Ǜ ǜ Ǚ ǚ"   
\markup \smallCaps "V v"   
\markup \smallCaps "W w Ŵ ŵ"
\markup \smallCaps "X x"
\markup \smallCaps "Y y Ý ý Ŷ ŷ Ÿ ÿ Ȳ ȳ"
\markup \smallCaps "Z z Ź ź Ž ž" 

Tous les autres caractères posent problèmes.
A priori, tous les caractères majuscules avec un seul point au dessus ou en dessous s'affichent mal et/ou dérangent l'affichage d'autres caractères.

Le 27 septembre 2012 11:51, Pierre Perol-Schneider <address@hidden> a écrit :
Désolé Jean-Christophe je ne comprends pas à quelle table tu fais référence.

Pour v2.16 et v2.17 : 

"Note: \smallCaps does not support accented characters."
cf : http://lilypond.org/doc/v2.16/Documentation/notation/font


Le 26 septembre 2012 20:18, Jean-Christophe D <address@hidden> a écrit :

Pierre Perol-Schneider wrote
> ... ê et ñ...

Bonsoir,

Une table des lettre accentuées n'a-t-elle pas été ajoutée dans la dernière
version ?


Jean-Christophe



--
View this message in context: http://lilypond-french-users.1298960.n2.nabble.com/Snippet-Accents-et-SmallCaps-tous-les-accents-tp7578489p7578490.html
Sent from the LilyPond French Users mailing list archive at Nabble.com.

_______________________________________________
liste de diffusion lilypond-user-fr
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user-fr



reply via email to

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