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