Package com.inet.html
Interface InetHtmlFontFactory
- All Known Implementing Classes:
InetHtmlFactory.DefaultFontFactory
public interface InetHtmlFontFactory
Factory to resolve font requests. Can be overwritten to implement a font mapping.
-
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.default FontsearchFontFor(String characters, int style, float size) Searches for a font, which is able to display the complete string
-
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.- 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
- Since:
- 1.05
-
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.- 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
- Since:
- 1.08
-
requiresText
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.- Returns:
- true if the text should be set when getFont is called, false if not
- Since:
- 1.05
-
searchFontFor
Searches for a font, which is able to display the complete string- Parameters:
characters- the string to displaystyle- the style for the new Fontsize- the size for the new Font- Returns:
- a font, which can display the string or null, if none was found
- Since:
- 1.12
-