summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src/SVGTree.cpp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-01-12 03:01:29 +0000
committerNorbert Preining <norbert@preining.info>2023-01-12 03:01:29 +0000
commit6a7900c93acc16d1bbd2f1e26286c7dd7387e6c0 (patch)
tree76196287351cba68a51934c49468bf1a7846aa76 /dviware/dvisvgm/src/SVGTree.cpp
parentc1c19023b4b1d43cb874f84df5102b485853e672 (diff)
CTAN sync 202301120301
Diffstat (limited to 'dviware/dvisvgm/src/SVGTree.cpp')
-rw-r--r--dviware/dvisvgm/src/SVGTree.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/dviware/dvisvgm/src/SVGTree.cpp b/dviware/dvisvgm/src/SVGTree.cpp
index 1fed40b443..edfb926d0c 100644
--- a/dviware/dvisvgm/src/SVGTree.cpp
+++ b/dviware/dvisvgm/src/SVGTree.cpp
@@ -2,7 +2,7 @@
** SVGTree.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2022 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2023 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -91,6 +91,13 @@ void SVGTree::setFont (int num, const Font &font) {
}
+pair<int,const Font*> SVGTree::getFontPair () const {
+ if (_charHandler)
+ return {_charHandler->getFontID(), _charHandler->getFont()};
+ return {0, nullptr};
+}
+
+
bool SVGTree::setFontFormat (string formatstr) {
auto pos = formatstr.find(',');
string opt;
@@ -258,7 +265,7 @@ void SVGTree::append (const PhysicalFont &font, const set<int> &chars, GFGlyphTr
auto fontNode = util::make_unique<XMLElement>("font");
string fontname = font.name();
fontNode->addAttribute("id", fontname);
- fontNode->addAttribute("horiz-adv-x", font.hAdvance());
+ fontNode->addAttribute("horiz-adv-x", font.hAverageAdvance());
auto faceNode = util::make_unique<XMLElement>("font-face");
faceNode->addAttribute("font-family", fontname);