Skip to content

Commit 791573e

Browse files
committed
For #161 - Use a per-thread font factory for MathML support.
1 parent 55bab5f commit 791573e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

openhtmltopdf-mathml-support/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>de.rototor.jeuclid</groupId>
4141
<artifactId>jeuclid-core</artifactId>
42-
<version>3.1.11</version>
42+
<version>3.1.12</version>
4343
</dependency>
4444
</dependencies>
4545

openhtmltopdf-mathml-support/src/main/java/com/openhtmltopdf/mathmlsupport/MathMLDrawer.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ public class MathMLDrawer implements SVGDrawer {
3636
private final Map<String, List<String>> _availabelFontFamilies = new HashMap<String, List<String>>();
3737

3838
public MathMLDrawer() {
39-
this._fontFactory = FontFactory.getInstance();
40-
// TODO: instead...
41-
// this._fontFactory = new DefaultFontFactory();
42-
// FontFactory.setThreadFontFactory(factory);
39+
this._fontFactory = new DefaultFontFactory();
40+
FontFactory.setThreadFontFactory(this._fontFactory);
4341
}
4442

4543
@Override
@@ -120,13 +118,12 @@ public SVGImage buildSVGImage(Element mathMlElement, Box box, CssContext c, doub
120118
List<String> fontList = Arrays.asList(fonts);
121119

122120
MathMLImage img = new MathMLImage(mathMlElement, cssWidth, cssHeight, cssMaxWidth, cssMaxHeight, dotsPerPixel, fontList);
123-
121+
124122
return img;
125123
}
126124

127125
@Override
128126
public void close() throws IOException {
129-
// TODO:
130-
// FontFactory.clearThreadFontFactory();
127+
FontFactory.clearThreadFontFactory();
131128
}
132129
}

0 commit comments

Comments
 (0)