Package icyllis.modernui.text.style
Class TypefaceSpan
java.lang.Object
icyllis.modernui.text.style.CharacterStyle
icyllis.modernui.text.style.MetricAffectingSpan
icyllis.modernui.text.style.TypefaceSpan
- All Implemented Interfaces:
- icyllis.modernui.text.ParcelableSpan,- UpdateAppearance,- UpdateLayout,- Parcelable,- Cloneable
public class TypefaceSpan
extends MetricAffectingSpan
implements icyllis.modernui.text.ParcelableSpan
- 
Nested Class SummaryNested classes/interfaces inherited from interface icyllis.modernui.util.ParcelableParcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>, Parcelable.WriteFlags
- 
Constructor SummaryConstructorsConstructorDescriptionTypefaceSpan(Typeface typeface) Constructs aTypefaceSpanfrom aTypeface.TypefaceSpan(Parcel src) TypefaceSpan(String family) Constructs aTypefaceSpanbased on the font family.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the font family name set in the span.intReturn a special type identifier for this span class.Returns the typeface set in the span.voidupdateMeasureState(TextPaint paint) Classes that extendMetricAffectingSpanimplement this method to update the text formatting in a way that can change the width or height of characters.voidwriteToParcel(Parcel dest, int flags) The subclass implements the method to flatten its contents by calling the methods ofParcelfor its primitive values.Methods inherited from class icyllis.modernui.text.style.MetricAffectingSpanupdateDrawStateMethods inherited from class icyllis.modernui.text.style.CharacterStyleclone, wrap
- 
Constructor Details- 
TypefaceSpanConstructs aTypefaceSpanbased on the font family. The previous style of the TextPaint is kept. If the font family is null, the text paint is not modified.- Parameters:
- family- The font family for this typeface. Examples include "monospace", "serif", and "sans-serif"
 
- 
TypefaceSpanConstructs aTypefaceSpanfrom aTypeface. The previous style of the TextPaint is overridden and the style of the typeface is used.- Parameters:
- typeface- the typeface
 
- 
TypefaceSpan
 
- 
- 
Method Details- 
getSpanTypeIdpublic int getSpanTypeId()Return a special type identifier for this span class.- Specified by:
- getSpanTypeIdin interface- icyllis.modernui.text.ParcelableSpan
 
- 
writeToParcelDescription copied from interface:ParcelableThe subclass implements the method to flatten its contents by calling the methods ofParcelfor its primitive values.- Specified by:
- writeToParcelin interface- Parcelable
- Parameters:
- dest- the parcel to write the object's data to
- flags- the flags about how the object should be written
 
- 
getFamilyReturns the font family name set in the span.- Returns:
- the font family name
- See Also:
 
- 
getTypefaceReturns the typeface set in the span.- Returns:
- the typeface set
- See Also:
 
- 
updateMeasureStateDescription copied from class:MetricAffectingSpanClasses that extendMetricAffectingSpanimplement this method to update the text formatting in a way that can change the width or height of characters.- Specified by:
- updateMeasureStatein class- MetricAffectingSpan
- Parameters:
- paint- the paint used for measuring the text
 
 
-