Package org.apache.jorphan.gui.ui
Class KerningOptimizer
-
- All Implemented Interfaces:
@API(since = "5.5", status = API.Status.INTERNAL) public class KerningOptimizerText rendering might be slow for long lines when kerning is enabled, so it is worth disabling kerning for long texts.
-
-
Field Summary
Fields Modifier and Type Field Description public final static KerningOptimizerINSTANCE
-
Constructor Summary
Constructors Constructor Description KerningOptimizer()
-
Method Summary
Modifier and Type Method Description voidsetMaxTextLengthWithKerning(int length)Configures the maximum document length for rendering with kerning enabled. intgetMaxTextLengthWithKerning()voidconfigureKerning(JComponent component, int documentLength)Configures text kerning according to the expected document length. voidinstallKerningListener(JTextComponent textComponent)Adds a listener that disables kerning if text length reaches a certain threshold. voiduninstallKerningListener(JTextComponent textComponent)Removes the listener that disables kerning if text length reaches a certain threshold. -
-
Method Detail
-
setMaxTextLengthWithKerning
void setMaxTextLengthWithKerning(int length)
Configures the maximum document length for rendering with kerning enabled.
- Parameters:
length- maximum document length for rendering with kerning enabled
-
getMaxTextLengthWithKerning
int getMaxTextLengthWithKerning()
-
configureKerning
void configureKerning(JComponent component, int documentLength)
Configures text kerning according to the expected document length. This might be useful before setting the document so the kerning is disabled before updating the document.
- Parameters:
component- text component for kerning configurationdocumentLength- expected document length
-
installKerningListener
void installKerningListener(JTextComponent textComponent)
Adds a listener that disables kerning if text length reaches a certain threshold.
- Parameters:
textComponent- text component for kerning configuration
-
uninstallKerningListener
void uninstallKerningListener(JTextComponent textComponent)
Removes the listener that disables kerning if text length reaches a certain threshold.
- Parameters:
textComponent- text component for kerning configuration
-
-
-
-