lilypond-user
[Top][All Lists]
Advanced

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

Re: Fonts for TextScripts


From: Aaron Hill
Subject: Re: Fonts for TextScripts
Date: Fri, 26 Jun 2020 03:33:50 -0700
User-agent: Roundcube Webmail/1.4.2

On 2020-06-26 3:05 am, Aberforth D - Instrumentals wrote:
Hello,

I have a problem obtaining the correct font for TextScripts. When I type
the following command:

c4^\markup \italic "legato"

it shows up all right in Frescobaldi but the svg file does not produce the correct font. Indeed, the source-code of the svg file only states "serif"
as font.

I cannot reproduce this behavior.  Here is my MWE for reference:

%%%%
\version "2.20.0"
{ b'4 ^\markup \italic "Hello" }
%%%%

The relevant excerpt from the SVG file:
====
<text transform="translate(17.2358, 1.6730)" font-family="serif" font-style="italic" font-size="2.2001" text-anchor="start" fill="currentColor">
<tspan>Hello</tspan>
</text>
====

When I specify an explicit font in the voice context like this:

\context {
    \Voice
    \override TextScript.font-name = #"Times New Roman"
}

the text is no longer in italic, even though I left the markup line
unchanged. The svg file states:
font-family="Times New"
so it seems the "Roman" is stripped away and the font is not recognized.
There is also no tag that the font-style should be italic.

Two things here:

1) "Roman" can be confused with a style, so you need to add a comma after the font family.

%%%%
\version "2.20.0"
{ b'4 -\tweak font-name "Times New Roman," ^"Hello" }
%%%%

2) When specifying an explicit font-name, things like \italic no longer work. You must then manually specify the style after the font family.

%%%%
\version "2.20.0"
{ b'4 -\tweak font-name "Times New Roman, Italic" ^"Hello" }
%%%%


-- Aaron Hill



reply via email to

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