From 54afac2f270df882664f020b1971cf0db37218de Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sat, 14 Jan 2023 11:49:57 +0100 Subject: [PATCH] Fix https://github.com/plantuml/plantuml/discussions/1264 --- .../sourceforge/plantuml/nwdiag/next/LinkedElement.java | 8 ++++---- src/net/sourceforge/plantuml/style/Style.java | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java b/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java index fb1542d54..69f670ccc 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java @@ -134,7 +134,7 @@ public class LinkedElement { new VerticalLine(ynet1, ynet1 + alpha, Collections.emptySet()) .drawU(ug.apply(UTranslate.dx(xLinkPos + network.magicDelta()))); - drawCenter(ug, link1(), xMiddle + network.magicDelta(), ynet1 + posLink1); + drawCenter(ug, getTextBlockLink1(), xMiddle + network.magicDelta(), ynet1 + posLink1); final double seven = 9.0; double x = xLinkPos - (conns.size() - 2) * seven / 2; @@ -160,7 +160,7 @@ public class LinkedElement { } - private TextBlock link1() { + private TextBlock getTextBlockLink1() { return conns.get(network); } @@ -182,8 +182,8 @@ public class LinkedElement { } public XDimension2D naturalDimension(StringBounder stringBounder) { - final XDimension2D dimLink1 = link1() == null ? new XDimension2D(0, 0) - : link1().calculateDimension(stringBounder); + final XDimension2D dimLink1 = getTextBlockLink1() == null ? new XDimension2D(0, 0) + : getTextBlockLink1().calculateDimension(stringBounder); final XDimension2D dimBox = box.calculateDimension(stringBounder); final XDimension2D dimLink2 = link2() == null ? new XDimension2D(0, 0) : link2().calculateDimension(stringBounder); diff --git a/src/net/sourceforge/plantuml/style/Style.java b/src/net/sourceforge/plantuml/style/Style.java index 333486d7b..ac7fce565 100644 --- a/src/net/sourceforge/plantuml/style/Style.java +++ b/src/net/sourceforge/plantuml/style/Style.java @@ -42,6 +42,7 @@ import java.util.StringTokenizer; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.LineBreakStrategy; +import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -179,7 +180,8 @@ public class Style { } public UFont getUFont() { - final String family = value(PName.FontName).asString(); + final String family = StringUtils + .eventuallyRemoveStartingAndEndingDoubleQuote(value(PName.FontName).asString()); final int fontStyle = value(PName.FontStyle).asFontStyle(); int size = value(PName.FontSize).asInt(true); if (size == -1)