org.foray.font
Class FontSelector

java.lang.Object
  extended by org.foray.font.FontSelector
Direct Known Subclasses:
FontSelectorCBC

public abstract class FontSelector
extends Object

Abstract superclass for all font-selection strategies.


Constructor Summary
FontSelector(FontConsumer4a consumer)
          Constructor.
 
Method Summary
protected  FontConsumer4a getConsumer()
          Returns the parent font consumer instance.
abstract  RegisteredFontDesc selectFont(List<String> familyList, org.axsl.font.Font.Style style, org.axsl.font.Font.Weight weight, org.axsl.font.Font.Variant variant, org.axsl.font.Font.Stretch stretch, int size, int codePoint)
          Selectes a font.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontSelector

public FontSelector(FontConsumer4a consumer)
Constructor.

Parameters:
consumer - The font consumer for whom this selector is being created.
Method Detail

selectFont

public abstract RegisteredFontDesc selectFont(List<String> familyList,
                                              org.axsl.font.Font.Style style,
                                              org.axsl.font.Font.Weight weight,
                                              org.axsl.font.Font.Variant variant,
                                              org.axsl.font.Font.Stretch stretch,
                                              int size,
                                              int codePoint)
                                       throws org.axsl.font.FontException
Selectes a font.

Parameters:
familyList - The list of families that are eligible for selection.
style - The font style (normal, italic, etc.).
weight - The font weight (100, 200, normal, bold, etc.).
variant - The font variant (normal, small-caps).
stretch - The font stretch (normal, condensed, etc.).
size - The font size, in millipoints. This is used only for bitmapped fonts.
codePoint - The Unicode code point which must be encodable by the selected font.
Returns:
The best registered font description matching the selection criteria.
Throws:
org.axsl.font.FontException - For invalid input.

getConsumer

protected FontConsumer4a getConsumer()
Returns the parent font consumer instance.

Returns:
The font consumer.


Copyright © 2017. All rights reserved.