net.sourceforge.plantuml.asciiart.TextStringBounder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.asciiart;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.klimt.font.StringBounderRaw;
import net.sourceforge.plantuml.klimt.font.UFont;
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextStringBounder extends StringBounderRaw {
public TextStringBounder() {
super(FileFormat.gg.getFontRenderContext());
}
protected XDimension2D calculateDimensionInternal(UFont font, String text) {
final int length1 = text.codePointCount(0, text.length());
final int length2 = text.length();
final int length3 = Wcwidth.length(text);
return new XDimension2D(length2, 1);
}
@Override
public boolean matchesProperty(String propertyName) {
return false;
}
}