All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.klimt.font.FontPosition Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.klimt.font;

public enum FontPosition {
	NORMAL, EXPOSANT, INDICE;

	public int getSpace() {
		if (this == EXPOSANT)
			return -6;

		if (this == INDICE)
			return 3;

		return 0;
	}

	public UFont mute(UFont font) {
		if (this == NORMAL)
			return font;

		int size = font.getSize() - 3;
		if (size < 2)
			size = 2;

		return font.withSize((float) size);
	}

	// ::comment when __HAXE__
	public String getHtmlTag() {
		if (this == EXPOSANT)
			return "sup";

		if (this == INDICE)
			return "sub";

		throw new UnsupportedOperationException();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy