Package org.apache.jorphan.gui.ui
Class KerningOptimizer
java.lang.Object
org.apache.jorphan.gui.ui.KerningOptimizer
Text rendering might be slow for long lines when kerning is enabled, so it is worth disabling kerning for long
 texts.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidconfigureKerning(JComponent component, int documentLength) Configures text kerning according to the expected document length.intvoidinstallKerningListener(JTextComponent textComponent) Adds a listener that disables kerning if text length reaches a certain threshold.voidsetMaxTextLengthWithKerning(int length) Configures the maximum document length for rendering with kerning enabled.voiduninstallKerningListener(JTextComponent textComponent) Removes the listener that disables kerning if text length reaches a certain threshold.
- 
Field Details- 
INSTANCE
 
- 
- 
Constructor Details- 
KerningOptimizerpublic KerningOptimizer()
 
- 
- 
Method Details- 
setMaxTextLengthWithKerningpublic void setMaxTextLengthWithKerning(int length) Configures the maximum document length for rendering with kerning enabled.- Parameters:
- length- maximum document length for rendering with kerning enabled
 
- 
getMaxTextLengthWithKerningpublic int getMaxTextLengthWithKerning()
- 
configureKerningConfigures 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 configuration
- documentLength- expected document length
 
- 
installKerningListenerAdds a listener that disables kerning if text length reaches a certain threshold.- Parameters:
- textComponent- text component for kerning configuration
 
- 
uninstallKerningListenerRemoves the listener that disables kerning if text length reaches a certain threshold.- Parameters:
- textComponent- text component for kerning configuration
 
 
-