Re: smallCaps and accented letters

2013-12-21 Thread Josiah Boothby
> I noticed in a score that I've recently typeset that smallCaps doesn't
> support accented characters (which is indeed written in the manual).
...
> For now, is there a workaround?

I don't remember how I found this (possibly through searching through
the mailing list archives, because that's how I found it again), but
Michael Lauer has a website that provides, among other things, some
include files that aid in some advanced formatting—including true small
caps, if they are supported by the font you use. I typically use Linux
Libertine, which looks nice enough and has all the characters I'm
likely to ever need to use. 

Links: 

Michael Lauer's music site 

Linux Libertine fonts: 

Best,

Josiah

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: smallCaps and accented letters

2013-12-21 Thread Pierre Perol-Schneider
2013/12/20 Yann 

>
> Hello everybody :)
>
> I noticed in a score that I've recently typeset that smallCaps doesn't
> support accented characters (which is indeed written in the manual).
>
> Is there a plan to extend smallCaps to support accented letters in future
> versions ?
> For now, is there a workaround ?
>

Hi Yann,

Here's the code I use for years.
As far as I remember, the original code was made by Nicolas Sceaux but it's
pretty old now and I could be wrong.

%% Snippet 
\version "2.17.95"

#(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)))


% % Examples 

\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 Ź ź Ž ž"

%%%


Cheers,

Pierre
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: smallCaps and accented letters

2013-12-20 Thread Shane Brandes
Good Yann might need it. Boston 1851 came to mind since I made it. I
am sure there are others. Just not a lot compared to the vasty sum of
fonts available.

S.

On Fri, Dec 20, 2013 at 11:05 PM, Mark Stephen Mrotek
 wrote:
> Mr. Brandes
>
> Bulmer MT has accented small caps as part of the font family.
> http://www.fonts.com/font/adobe/bulmer/complete-family-pack
>
> Mark
>
> -Original Message-
> From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
> [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
> Shane Brandes
> Sent: Friday, December 20, 2013 7:31 PM
> To: Yann
> Cc: Lilypond-User Mailing List
> Subject: Re: smallCaps and accented letters
>
> Small caps are an interesting typological beast. They are generally caps
> that are shrunk to the x height. But are not simply scaled down if made
> correctly. They are supposed to retain the weight of the regular majuscules.
> In any event that was the case in real world physical type. Now it is
> possible to simply shrink things and not really get the right effect. So
> that aside, computer fonts that support actual smallcaps are not necessarily
> numerous in comparison to the amount of fonts available and fonts that
> support additional oddities are to my experience even less common. So the
> need for such a condition may be small. However it might be possible to
> compose a small cap character with an accent with the proper accent mark by
> using the unicode combination characters for accents although results might
> vary widely in quality of the result. Boston 1851 small caps is part of a
> font family that has less limited array of accented characters, over 350.
> Anyway best of luck.
>
> regards,
> Shane
>
> On Fri, Dec 20, 2013 at 5:21 PM, Yann  wrote:
>> Hello everybody :)
>>
>> I noticed in a score that I've recently typeset that smallCaps doesn't
>> support accented characters (which is indeed written in the manual).
>>
>> Is there a plan to extend smallCaps to support accented letters in
>> future versions ?
>> For now, is there a workaround ?
>>
>> Yann
>>
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


RE: smallCaps and accented letters

2013-12-20 Thread Mark Stephen Mrotek
Mr. Brandes

Bulmer MT has accented small caps as part of the font family.
http://www.fonts.com/font/adobe/bulmer/complete-family-pack

Mark

-Original Message-
From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
Shane Brandes
Sent: Friday, December 20, 2013 7:31 PM
To: Yann
Cc: Lilypond-User Mailing List
Subject: Re: smallCaps and accented letters

Small caps are an interesting typological beast. They are generally caps
that are shrunk to the x height. But are not simply scaled down if made
correctly. They are supposed to retain the weight of the regular majuscules.
In any event that was the case in real world physical type. Now it is
possible to simply shrink things and not really get the right effect. So
that aside, computer fonts that support actual smallcaps are not necessarily
numerous in comparison to the amount of fonts available and fonts that
support additional oddities are to my experience even less common. So the
need for such a condition may be small. However it might be possible to
compose a small cap character with an accent with the proper accent mark by
using the unicode combination characters for accents although results might
vary widely in quality of the result. Boston 1851 small caps is part of a
font family that has less limited array of accented characters, over 350.
Anyway best of luck.

regards,
Shane

On Fri, Dec 20, 2013 at 5:21 PM, Yann  wrote:
> Hello everybody :)
>
> I noticed in a score that I've recently typeset that smallCaps doesn't 
> support accented characters (which is indeed written in the manual).
>
> Is there a plan to extend smallCaps to support accented letters in 
> future versions ?
> For now, is there a workaround ?
>
> Yann
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: smallCaps and accented letters

2013-12-20 Thread Shane Brandes
Small caps are an interesting typological beast. They are generally
caps that are shrunk to the x height. But are not simply scaled down
if made correctly. They are supposed to retain the weight of the
regular majuscules. In any event that was the case in real world
physical type. Now it is possible to simply shrink things and not
really get the right effect. So that aside, computer fonts that
support actual smallcaps are not necessarily numerous in comparison to
the amount of fonts available and fonts that support additional
oddities are to my experience even less common. So the need for such a
condition may be small. However it might be possible to compose a
small cap character with an accent with the proper accent mark by
using the unicode combination characters for accents although results
might vary widely in quality of the result. Boston 1851 small caps is
part of a font family that has less limited array of accented
characters, over 350. Anyway best of luck.

regards,
Shane

On Fri, Dec 20, 2013 at 5:21 PM, Yann  wrote:
> Hello everybody :)
>
> I noticed in a score that I've recently typeset that smallCaps doesn't
> support accented characters (which is indeed written in the manual).
>
> Is there a plan to extend smallCaps to support accented letters in future
> versions ?
> For now, is there a workaround ?
>
> Yann
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


smallCaps and accented letters

2013-12-20 Thread Yann
Hello everybody :)

I noticed in a score that I've recently typeset that smallCaps doesn't
support accented characters (which is indeed written in the manual).

Is there a plan to extend smallCaps to support accented letters in future
versions ?
For now, is there a workaround ?

Yann
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user