mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-19 04:02:09 +01:00
Added support for font-family style parameters
This commit is contained in:
parent
0f8478c380
commit
441ccc59d0
@ -155,6 +155,7 @@ void Style::text(QXmlStreamReader &reader, const Rule &rule,
|
|||||||
const QXmlStreamAttributes &attr = reader.attributes();
|
const QXmlStreamAttributes &attr = reader.attributes();
|
||||||
int fontSize = 9;
|
int fontSize = 9;
|
||||||
bool bold = false, italic = false;
|
bool bold = false, italic = false;
|
||||||
|
QString fontFamily("Helvetica");
|
||||||
|
|
||||||
if (attr.hasAttribute("k"))
|
if (attr.hasAttribute("k"))
|
||||||
ri._key = attr.value("k").toLatin1();
|
ri._key = attr.value("k").toLatin1();
|
||||||
@ -177,10 +178,20 @@ void Style::text(QXmlStreamReader &reader, const Rule &rule,
|
|||||||
italic = true;
|
italic = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (attr.hasAttribute("font-family")) {
|
||||||
|
QString family(attr.value("font-family").toString());
|
||||||
|
if (family == "monospace")
|
||||||
|
fontFamily = "Courier New";
|
||||||
|
else if (family == "serif")
|
||||||
|
fontFamily = "Times New Roman";
|
||||||
|
}
|
||||||
|
|
||||||
|
ri._font.setFamily(fontFamily);
|
||||||
ri._font.setPixelSize(fontSize);
|
ri._font.setPixelSize(fontSize);
|
||||||
ri._font.setBold(bold);
|
ri._font.setBold(bold);
|
||||||
ri._font.setItalic(italic);
|
ri._font.setItalic(italic);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < lists.size(); i++)
|
for (int i = 0; i < lists.size(); i++)
|
||||||
lists[i]->append(ri);
|
lists[i]->append(ri);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user