diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/Arial.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/Arial.java index 0ab876fb9..c34cca4b9 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/Arial.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/Arial.java @@ -29,7 +29,7 @@ package org.antlr.v4.runtime.tree.gui; -public class Arial extends FontMetrics { +public class Arial extends BasicFontMetrics { { maxCharHeight = 781; widths[32] = 277; // space diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/ArialBlack.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/ArialBlack.java index d3069ef8b..8235ab818 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/ArialBlack.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/ArialBlack.java @@ -29,7 +29,7 @@ package org.antlr.v4.runtime.tree.gui; -public class ArialBlack extends FontMetrics { +public class ArialBlack extends BasicFontMetrics { { maxCharHeight = 770; widths[32] = 333; // space diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/FontMetrics.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/BasicFontMetrics.java similarity index 98% rename from runtime/Java/src/org/antlr/v4/runtime/tree/gui/FontMetrics.java rename to runtime/Java/src/org/antlr/v4/runtime/tree/gui/BasicFontMetrics.java index 054beb162..f45864ae6 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/FontMetrics.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/BasicFontMetrics.java @@ -67,7 +67,7 @@ package org.antlr.v4.runtime.tree.gui; Units are 1000th of an 'em'. */ -public abstract class FontMetrics { +public abstract class BasicFontMetrics { protected int maxCharHeight; protected int[] widths = new int[128]; diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/CourierNew.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/CourierNew.java index b4dc5ad14..c483b0043 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/CourierNew.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/CourierNew.java @@ -29,7 +29,7 @@ package org.antlr.v4.runtime.tree.gui; -public class CourierNew extends FontMetrics { +public class CourierNew extends BasicFontMetrics { { maxCharHeight = 678; for (int i=0; i<128; i++) widths[i] = 600; diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/PostScriptDocument.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/PostScriptDocument.java index 2d930a9a3..7ab69a833 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/PostScriptDocument.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/PostScriptDocument.java @@ -33,7 +33,7 @@ public class PostScriptDocument { protected int boundingBoxWidth; protected int boundingBoxHeight; - protected FontMetrics fontMetrics; + protected BasicFontMetrics fontMetrics; protected String fontName; protected int fontSize = 12; protected double lineWidth = 0.3; @@ -98,7 +98,7 @@ public class PostScriptDocument { this.fontSize = fontSize; try { Class c = Class.forName("org.antlr.v4.runtime.tree.gui." + fontName); - this.fontMetrics = (FontMetrics)c.newInstance(); + this.fontMetrics = (BasicFontMetrics)c.newInstance(); } catch (Exception e) { throw new UnsupportedOperationException("No font metrics for "+fontName); diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TimesNewRoman.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TimesNewRoman.java index 52c18d281..2ca20c520 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TimesNewRoman.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TimesNewRoman.java @@ -29,7 +29,7 @@ package org.antlr.v4.runtime.tree.gui; -public class TimesNewRoman extends FontMetrics { +public class TimesNewRoman extends BasicFontMetrics { { maxCharHeight = 717; widths[32] = 250; // space diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TreePostScriptGenerator.java b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TreePostScriptGenerator.java index 6876bf521..debf0730d 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TreePostScriptGenerator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/gui/TreePostScriptGenerator.java @@ -163,7 +163,7 @@ public class TreePostScriptGenerator { t.addChild(b); b.addChild(c); b.addChild(d); - TreePostScriptGenerator psgen = new TreePostScriptGenerator(null, t, "TimesNewRoman", 11); + TreePostScriptGenerator psgen = new TreePostScriptGenerator(null, t, "CourierNew", 11); System.out.println(psgen.getPS()); } }