From 07125596018d32e3235e80627915cfac77323272 Mon Sep 17 00:00:00 2001 From: Masamichi Hosoda Date: Wed, 26 Jul 2017 21:04:33 +0900 Subject: [PATCH] Issue 5164: Doc: Add usage of OpenType font feature This commit adds the usage of OpenType font feature added in Issue 1388 to the document. --- Documentation/changes.tely | 27 +++++++++++++++++++++++ Documentation/notation/text.itely | 36 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/Documentation/changes.tely b/Documentation/changes.tely index 3f3413c5ae..482bbbdd65 100644 --- a/Documentation/changes.tely +++ b/Documentation/changes.tely @@ -1063,6 +1063,33 @@ the next font listed will be used instead for that character. For details of alias definitions, please see to @code{00-lilypond-fonts.conf} under the installed directory. +@item +When using OpenType fonts, font features can be used. +Note: Not all OpenType fonts have all functions. + +@lilypond[quote,verbatim] +% True small caps +\markup { Normal Style: Hello HELLO } +\markup { \caps { Small Caps: Hello } } +\markup { \override #'(font-features . ("smcp")) + { True Small Caps: Hello } } + +% Number styles +\markup { Normal Number Style: 0123456789 } +\markup { \override #'(font-features . ("onum")) + { Old Number Style: 0123456789 } } + +% Stylistic Alternates +\markup { \override #'(font-features . ("salt 0")) + { Stylistic Alternates 0: εφπρθ } } +\markup { \override #'(font-features . ("salt 1")) + { Stylistic Alternates 1: εφπρθ } } + +% Multiple features +\markup { \override #'(font-features . ("onum" "smcp" "salt 1")) + { Multiple features: Hello 0123456789 εφπρθ } } +@end lilypond + @end itemize @ifhtml diff --git a/Documentation/notation/text.itely b/Documentation/notation/text.itely index 39e9d815c3..fabee1a937 100644 --- a/Documentation/notation/text.itely +++ b/Documentation/notation/text.itely @@ -1477,6 +1477,42 @@ is preferable to use the simpler syntax explained in } @end lilypond +@noindent +When using OpenType fonts, font features can be used. +OpenType font scripts and languages can not be specified. +Note: Not all OpenType fonts have all functions. +If you request a feature that doesn't exist in the chosen font, +then the feature is simply ignored. + +@lilypond[quote,verbatim] +% True small caps +\markup { Normal Style: Hello HELLO } +\markup { \caps { Small Caps: Hello } } +\markup { \override #'(font-features . ("smcp")) + { True Small Caps: Hello } } + +% Number styles +\markup { Normal Number Style: 0123456789 } +\markup { \override #'(font-features . ("onum")) + { Old Number Style: 0123456789 } } + +% Stylistic Alternates +\markup { \override #'(font-features . ("salt 0")) + { Stylistic Alternates 0: εφπρθ } } +\markup { \override #'(font-features . ("salt 1")) + { Stylistic Alternates 1: εφπρθ } } + +% Multiple features +\markup { \override #'(font-features . ("onum" "smcp" "salt 1")) + { Multiple features: Hello 0123456789 εφπρθ } } +@end lilypond + +@noindent For the full OpenType font feature list please see: +@uref{https://www.microsoft.com/typography/otspec/featurelist.htm} + +@noindent For identifying features of OpenType fonts please see: +@uref{http://lists.gnu.org/archive/html/lilypond-devel/2017-08/msg00004.html} + Although it is easy to switch between preconfigured fonts, it is also possible to use other fonts, as explained in the following sections: @ref{Single entry fonts} and @ref{Entire document fonts}. -- 2.39.2