mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-08 01:54:37 +02:00
Fix parsing SVG fonts.
This commit is contained in:
parent
12f17d5961
commit
991b6be9ef
|
@ -5,6 +5,7 @@
|
|||
- Duplicate controls for main path nodes.
|
||||
- Fix compatibility with macOS 12+.
|
||||
- Fix regression. Formula wizard dialog doesn't show item alias in a list.
|
||||
- Fix parsing SVG fonts.
|
||||
|
||||
# Valentina 0.7.53 June 25, 2024
|
||||
- Fix layout sheet export with empty name.
|
||||
|
|
|
@ -298,15 +298,7 @@ auto VSvgFontReader::ReadFont() -> VSvgFontEngine
|
|||
SetFontFace(&font);
|
||||
engine = VSvgFontEngine(font);
|
||||
}
|
||||
else
|
||||
{
|
||||
skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
while (readNextStartElement())
|
||||
{
|
||||
if (name() == "missing-glyph"_L1 || name() == "glyph"_L1)
|
||||
else if (name() == "missing-glyph"_L1 || name() == "glyph"_L1)
|
||||
{
|
||||
ParseSvgGlyph(&engine, attributes());
|
||||
}
|
||||
|
@ -362,7 +354,7 @@ void VSvgFontReader::SetFontFace(VSvgFont *font)
|
|||
|
||||
QString const fontStyle = fontFaceAttr.value("font-style"_L1).toString();
|
||||
QString const fontWeight = fontFaceAttr.value("font-weight"_L1).toString();
|
||||
QString fontName;
|
||||
QString fontName = fontFamily;
|
||||
|
||||
while (readNextStartElement())
|
||||
{
|
||||
|
@ -373,12 +365,15 @@ void VSvgFontReader::SetFontFace(VSvgFont *font)
|
|||
if (name() == "font-face-name"_L1)
|
||||
{
|
||||
fontName = attributes().value("name"_L1).toString();
|
||||
readElementText();
|
||||
}
|
||||
else
|
||||
{
|
||||
skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
readElementText();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -393,6 +388,8 @@ void VSvgFontReader::SetFontFace(VSvgFont *font)
|
|||
font->SetDescent(descent);
|
||||
font->SetStyle(ParseFontStyle(fontStyle));
|
||||
font->SetWeight(ParseFontWeight(fontWeight));
|
||||
|
||||
readElementText();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue