Package com.inet.html
Class InetHtmlFactory.DefaultFontFactory
java.lang.Object
com.inet.html.InetHtmlFactory.DefaultFontFactory
- All Implemented Interfaces:
InetHtmlFontFactory
- Enclosing class:
- InetHtmlFactory
public static class InetHtmlFactory.DefaultFontFactory
extends Object
implements InetHtmlFontFactory
default implementation: use normal Font constructor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the font object for a requested font with a fractional size.Returns the font object for a requested font.booleanThis method indicates whether the font factory requires the text part which will be displayed by a certain font instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.inet.html.InetHtmlFontFactory
searchFontFor
-
Constructor Details
-
DefaultFontFactory
public DefaultFontFactory()
-
-
Method Details
-
getFont
Returns the font object for a requested font. Please note that the returned font may differ in type, size or style depending on the properties of the targeted render context.- Specified by:
getFontin interfaceInetHtmlFontFactory- Parameters:
name- The name / family of the requested fontstyle- the style constant(s)size- the size in pixeltext- the text part which should be displayed by the requested font, can benull!- Returns:
- the best match for the requested font
-
getFont
Returns the font object for a requested font with a fractional size. Please note that the returned font may differ in type, size or style depending on the properties of the targeted render context.
However, the method will prioritize font name over character availability, so if a font with said name is available it will be returned even if not all characters can be displayed. A fallback can and will only be used if not font with the name is available.- Specified by:
getFontin interfaceInetHtmlFontFactory- Parameters:
name- The name / family of the requested fontstyle- the style constant(s)size- the size in pixeltext- the text part which should be displayed by the requested font, can benull!- Returns:
- the best match for the requested font
-
requiresText
public boolean requiresText()This method indicates whether the font factory requires the text part which will be displayed by a certain font instance. An factory, which requires to adopt the font according to it's displayable characters should returntruehere. Please note returningtruehere has a negative performance impact.- Specified by:
requiresTextin interfaceInetHtmlFontFactory- Returns:
- true if the text should be set when getFont is called, false if not
-