]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 5164: Doc: Add usage of OpenType font feature
authorMasamichi Hosoda <trueroad@trueroad.jp>
Wed, 26 Jul 2017 12:04:33 +0000 (21:04 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 7 Aug 2017 21:55:56 +0000 (06:55 +0900)
This commit adds the usage of OpenType font feature
added in Issue 1388 to the document.

Documentation/changes.tely
Documentation/notation/text.itely

index 3f3413c5ae3a50bdfe7947115b7c63ec006cf038..482bbbdd659d598db0ef027dc0336ccce51bf063 100644 (file)
@@ -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
index 39e9d815c3af58b5cc6dd0fdb4225607495c2dc0..fabee1a937628909748f2d94d01e25dd157cb045 100644 (file)
@@ -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}.