ch.sahits.game.graphic.image.ITextSizingpublic class TextSizingUtility
extends java.lang.Object
implements ch.sahits.game.graphic.image.ITextSizing
| Constructor | Description |
|---|---|
TextSizingUtility() |
| Modifier and Type | Method | Description |
|---|---|---|
javafx.geometry.Dimension2D |
calculate(int size,
javafx.scene.text.Font font) |
Calculate the dimensions of a string using the font with the number of characters.
|
javafx.geometry.Dimension2D |
calculate(java.lang.String text,
javafx.scene.text.Font font) |
Calculate the dimensions of a string using the font with the characters in the string.
|
int |
guessNumberOfCharacters(double destWidth,
javafx.scene.text.Font font) |
Guess the number of characters that can be displayed in
destWidth. |
public javafx.geometry.Dimension2D calculate(int size,
javafx.scene.text.Font font)
calculate in interface ch.sahits.game.graphic.image.ITextSizingsize - number of carachters for wich to calculate the dimensionsfont - to be usedpublic int guessNumberOfCharacters(double destWidth,
javafx.scene.text.Font font)
destWidth.
The number is guessed as an arbitrary width per character for the font is assumed.destWidth - destination withfont - to used for the textdestWidthpublic javafx.geometry.Dimension2D calculate(java.lang.String text,
javafx.scene.text.Font font)
calculate in interface ch.sahits.game.graphic.image.ITextSizingtext - for which to calculate the dimensionsfont - to be used for the calculationCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.