Package com.mta.tehreer.graphics
Class TypefaceManager
java.lang.Object
com.mta.tehreer.graphics.TypefaceManager
The
TypefaceManager class provides management activities related to typefaces.-
Method Summary
Modifier and TypeMethodDescriptionstatic List<TypeFamily>Returns a list of available type families sorted by their names in ascending order.Returns a list of available typefaces sorted by their family and style names in ascending order.static TypefacegetTypeface(Object tag) Returns the typeface registered against the specified tag.static TypefacegetTypefaceByName(String fullName) Looks for a registered typeface having specified full name.static ObjectgetTypefaceTag(Typeface typeface) Returns the tag of a registered typeface.static TypeFamilygetTypeFamily(String familyName) Looks for a type family having specified family name.static voidregisterTypeface(Typeface typeface, Object tag) Registers a typeface inTypefaceManager.static voidunregisterTypeface(Typeface typeface) Unregisters a typeface inTypefaceManager.
-
Method Details
-
registerTypeface
Registers a typeface inTypefaceManager.- Parameters:
typeface- The typeface that will be registered.tag- An optional tag to identify the typeface.- Throws:
IllegalArgumentException- iftypefaceis already registered, ortagis already taken.
-
unregisterTypeface
Unregisters a typeface inTypefaceManager.- Parameters:
typeface- The typeface to unregister.- Throws:
IllegalArgumentException- iftypefaceis not registered.
-
getTypeface
Returns the typeface registered against the specified tag.- Parameters:
tag- The tag object that identifies the typeface.- Returns:
- The registered typeface, or
nullif no typeface is registered against the specified tag.
-
getTypefaceTag
Returns the tag of a registered typeface.- Parameters:
typeface- The typeface whose tag is returned.- Returns:
- The tag of the typeface, or
nullif no tag was specified while registration. - Throws:
IllegalArgumentException- iftypefaceis not registered.
-
getTypeFamily
Looks for a type family having specified family name.- Parameters:
familyName- The name of the family.- Returns:
- A type family having specified family name.
-
getTypefaceByName
Looks for a registered typeface having specified full name.- Parameters:
fullName- The full name of the typeface.- Returns:
- The typeface having specified full name, or
nullif no such typeface is registered.
-
getAvailableFamilies
Returns a list of available type families sorted by their names in ascending order.- Returns:
- A list of available type families.
-
getAvailableTypefaces
Returns a list of available typefaces sorted by their family and style names in ascending order.- Returns:
- A list of available typefaces.
-