Aracılığıyla paylaş


TextPaint Class

Definition

TextPaint is an extension of Paint that leaves room for some extra data used during text measuring and drawing.

[Android.Runtime.Register("android/text/TextPaint", DoNotGenerateAcw=true)]
public class TextPaint : Android.Graphics.Paint
[<Android.Runtime.Register("android/text/TextPaint", DoNotGenerateAcw=true)>]
type TextPaint = class
    inherit Paint
Inheritance
TextPaint
Attributes

Remarks

TextPaint is an extension of Paint that leaves room for some extra data used during text measuring and drawing.

Java documentation for android.text.TextPaint.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

TextPaint()
TextPaint(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

TextPaint(Paint)
TextPaint(PaintFlags)

Fields

CursorAfter
Obsolete.

Option for getTextRunCursor.

(Inherited from Paint)
CursorAt
Obsolete.

Option for getTextRunCursor.

(Inherited from Paint)
CursorAtOrAfter
Obsolete.

Option for getTextRunCursor.

(Inherited from Paint)
CursorAtOrBefore
Obsolete.

Option for getTextRunCursor.

(Inherited from Paint)
CursorBefore
Obsolete.

Option for getTextRunCursor.

(Inherited from Paint)
EndHyphenEditInsertArmenianHyphen

An integer representing the end of the line has Armentian hyphen (U+058A).

(Inherited from Paint)
EndHyphenEditInsertHyphen

An integer representing the end of the line has normal hyphen character (U+002D).

(Inherited from Paint)
EndHyphenEditInsertMaqaf

An integer representing the end of the line has maqaf (Hebrew hyphen, U+05BE).

(Inherited from Paint)
EndHyphenEditInsertUcasHyphen

An integer representing the end of the line has Canadian Syllabics hyphen (U+1400).

(Inherited from Paint)
EndHyphenEditInsertZwjAndHyphen

An integer representing the end of the line has Zero-Width-Joiner (U+200D) followed by normal hyphen character (U+002D).

(Inherited from Paint)
EndHyphenEditNoEdit

An integer representing the end of the line has no modification for hyphenation.

(Inherited from Paint)
EndHyphenEditReplaceWithHyphen

An integer representing the character at the end of the line is replaced with hyphen character (U+002D).

(Inherited from Paint)
HintingOff
Obsolete.

Font hinter option that disables font hinting.

(Inherited from Paint)
HintingOn
Obsolete.

Font hinter option that enables font hinting.

(Inherited from Paint)
StartHyphenEditInsertHyphen

An integer representing the starting of the line has normal hyphen character (U+002D).

(Inherited from Paint)
StartHyphenEditInsertZwj

An integer representing the starting of the line has Zero-Width-Joiner (U+200D).

(Inherited from Paint)
StartHyphenEditNoEdit

An integer representing the starting of the line has no modification for hyphenation.

(Inherited from Paint)

Properties

Alpha

Helper to getColor() that just returns the color's alpha value. -or- Helper to setColor(), that only assigns the color's alpha value, leaving its r,g,b values unchanged.

(Inherited from Paint)
AntiAlias

Helper for getFlags(), returning true if ANTI_ALIAS_FLAG bit is set AntiAliasing smooths out the edges of what is being drawn, but is has no impact on the interior of the shape. -or- Helper for setFlags(), setting or clearing the ANTI_ALIAS_FLAG bit AntiAliasing smooths out the edges of what is being drawn, but is has no impact on the interior of the shape.

(Inherited from Paint)
BaselineShift
BgColor
BlendMode

Get the paint's blend mode object. -or- Set or clear the blend mode.

(Inherited from Paint)
Class

Returns the runtime class of this Object.

(Inherited from Object)
Color

Return the paint's color in sRGB. -or- Set the paint's color.

(Inherited from Paint)
ColorFilter

Get the paint's colorfilter (maybe be null).

(Inherited from Paint)
ColorLong

Return the paint's color.

(Inherited from Paint)
Density
Dither

Helper for getFlags(), returning true if DITHER_FLAG bit is set Dithering affects how colors that are higher precision than the device are down-sampled. -or- Helper for setFlags(), setting or clearing the DITHER_FLAG bit Dithering affects how colors that are higher precision than the device are down-sampled.

(Inherited from Paint)
DrawableState
ElegantTextHeight

Get the elegant metrics flag. -or- Set the paint's elegant height metrics flag.

(Inherited from Paint)
EndHyphenEdit

Get the current value of end hyphen edit. -or- Set a end hyphen edit on the paint.

(Inherited from Paint)
FakeBoldText

Helper for getFlags(), returning true if FAKE_BOLD_TEXT_FLAG bit is set -or- Helper for setFlags(), setting or clearing the FAKE_BOLD_TEXT_FLAG bit

(Inherited from Paint)
FilterBitmap

Whether or not the bitmap filter is activated. -or- Helper for setFlags(), setting or clearing the FILTER_BITMAP_FLAG bit.

(Inherited from Paint)
Flags

Return the paint's flags. -or- Set the paint's flags.

(Inherited from Paint)
FontFeatureSettings

Returns the font feature settings. -or- Set font feature settings.

(Inherited from Paint)
FontSpacing

Return the recommend line spacing based on the current typeface and text size.

(Inherited from Paint)
FontVariationSettings

Returns the font variation settings.

(Inherited from Paint)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
Hinting

Return the paint's hinting mode. -or- Set the paint's hinting mode.

(Inherited from Paint)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LetterSpacing

Return the paint's letter-spacing for text. -or- Set the paint's letter-spacing for text.

(Inherited from Paint)
LinearText

Helper for getFlags(), returning true if LINEAR_TEXT_FLAG bit is set -or- Helper for setFlags(), setting or clearing the LINEAR_TEXT_FLAG bit

(Inherited from Paint)
LinkColor
MaskFilter

Get the paint's maskfilter object.

(Inherited from Paint)
PathEffect

Get the paint's patheffect object.

(Inherited from Paint)
PeerReference (Inherited from Object)
Rasterizer
Obsolete.

Get the paint's rasterizer (or null).

(Inherited from Paint)
Shader

Get the paint's shader object.

(Inherited from Paint)
ShadowLayerColor

Returns the color of the shadow layer.

(Inherited from Paint)
ShadowLayerColorLong

Returns the color of the shadow layer.

(Inherited from Paint)
ShadowLayerDx

Returns the x offset of the shadow layer.

(Inherited from Paint)
ShadowLayerDy

Returns the y offset of the shadow layer.

(Inherited from Paint)
ShadowLayerRadius

Returns the blur radius of the shadow layer.

(Inherited from Paint)
StartHyphenEdit

Get the current value of start hyphen edit. -or- Set a start hyphen edit on the paint.

(Inherited from Paint)
StrikeThruPosition

Distance from top of the strike-through line to the baseline in pixels.

(Inherited from Paint)
StrikeThruText

Helper for getFlags(), returning true if STRIKE_THRU_TEXT_FLAG bit is set -or- Helper for setFlags(), setting or clearing the STRIKE_THRU_TEXT_FLAG bit

(Inherited from Paint)
StrikeThruThickness

Returns the thickness of the strike-through line in pixels.

(Inherited from Paint)
StrokeCap

Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. -or- Set the paint's Cap.

(Inherited from Paint)
StrokeJoin

Return the paint's stroke join type. -or- Set the paint's Join.

(Inherited from Paint)
StrokeMiter

Return the paint's stroke miter value. -or- Set the paint's stroke miter value.

(Inherited from Paint)
StrokeWidth

Return the width for stroking. -or- Set the width for stroking.

(Inherited from Paint)
SubpixelText

Helper for getFlags(), returning true if SUBPIXEL_TEXT_FLAG bit is set -or- Helper for setFlags(), setting or clearing the SUBPIXEL_TEXT_FLAG bit

(Inherited from Paint)
TextAlign

Return the paint's Align value for drawing text. -or- Set the paint's text alignment.

(Inherited from Paint)
TextLocale

Get the text's primary Locale. -or- Set the text locale list to a one-member list consisting of just the locale.

(Inherited from Paint)
TextLocales

Get the text locale list. -or- Set the text locale list.

(Inherited from Paint)
TextScaleX

Return the paint's horizontal scale factor for text. -or- Set the paint's horizontal scale factor for text.

(Inherited from Paint)
TextSize

Return the paint's text size. -or- Set the paint's text size.

(Inherited from Paint)
TextSkewX

Return the paint's horizontal skew factor for text. -or- Set the paint's horizontal skew factor for text.

(Inherited from Paint)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Typeface

Get the paint's typeface object.

(Inherited from Paint)
UnderlineColor

Special value 0 means no custom underline

UnderlinePosition

Returns the distance from top of the underline to the baseline in pixels.

(Inherited from Paint)
UnderlineText

Helper for getFlags(), returning true if UNDERLINE_TEXT_FLAG bit is set -or- Helper for setFlags(), setting or clearing the UNDERLINE_TEXT_FLAG bit

(Inherited from Paint)
UnderlineThickness

Returns the thickness of the underline in pixels.

(Inherited from Paint)
WordSpacing

Return the paint's extra word-spacing for text. -or- Set the paint's extra word-spacing for text.

(Inherited from Paint)
Xfermode

Get the paint's transfer mode object.

(Inherited from Paint)

Methods

Ascent()

Return the distance above (negative) the baseline (ascent) based on the current typeface and text size.

(Inherited from Paint)
BreakText(Char[], Int32, Int32, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

(Inherited from Paint)
BreakText(ICharSequence, Int32, Int32, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

(Inherited from Paint)
BreakText(String, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

(Inherited from Paint)
BreakText(String, Int32, Int32, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

(Inherited from Paint)
ClearShadowLayer()

Clear the shadow layer.

(Inherited from Paint)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Descent()

Return the distance below (positive) the baseline (descent) based on the current typeface and text size.

(Inherited from Paint)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
EqualsForTextMeasurement(Paint)

Returns true of the passed Paint will have the same effect on text measurement

(Inherited from Paint)
GetFillPath(Path, Path)

Applies any/all effects (patheffect, stroking) to src, returning the result in dst.

(Inherited from Paint)
GetFontMetrics()

Allocates a new FontMetrics object, and then calls getFontMetrics(fm) with it, returning the object.

(Inherited from Paint)
GetFontMetrics(Paint+FontMetrics)

Allocates a new FontMetrics object, and then calls getFontMetrics(fm) with it, returning the object.

(Inherited from Paint)
GetFontMetricsInt()

Return the font's interline spacing, given the Paint's settings for typeface, textSize, etc.

(Inherited from Paint)
GetFontMetricsInt(Char[], Int32, Int32, Int32, Int32, Boolean, Paint+FontMetricsInt) (Inherited from Paint)
GetFontMetricsInt(ICharSequence, Int32, Int32, Int32, Int32, Boolean, Paint+FontMetricsInt) (Inherited from Paint)
GetFontMetricsInt(Paint+FontMetricsInt)

Return the font's interline spacing, given the Paint's settings for typeface, textSize, etc.

(Inherited from Paint)
GetFontMetricsInt(String, Int32, Int32, Int32, Int32, Boolean, Paint+FontMetricsInt) (Inherited from Paint)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetOffsetForAdvance(Char[], Int32, Int32, Int32, Int32, Boolean, Single)

Get the character offset within the string whose position is closest to the specified horizontal position.

(Inherited from Paint)
GetOffsetForAdvance(ICharSequence, Int32, Int32, Int32, Int32, Boolean, Single) (Inherited from Paint)
GetOffsetForAdvance(String, Int32, Int32, Int32, Int32, Boolean, Single) (Inherited from Paint)
GetRunAdvance(Char[], Int32, Int32, Int32, Int32, Boolean, Int32)

Measure cursor position within a run of text.

(Inherited from Paint)
GetRunAdvance(ICharSequence, Int32, Int32, Int32, Int32, Boolean, Int32) (Inherited from Paint)
GetRunAdvance(String, Int32, Int32, Int32, Int32, Boolean, Int32) (Inherited from Paint)
GetRunCharacterAdvance(Char[], Int32, Int32, Int32, Int32, Boolean, Int32, Single[], Int32)

Measure the advance of each character within a run of text and also return the cursor position within the run.

(Inherited from Paint)
GetRunCharacterAdvance(ICharSequence, Int32, Int32, Int32, Int32, Boolean, Int32, Single[], Int32) (Inherited from Paint)
GetRunCharacterAdvance(String, Int32, Int32, Int32, Int32, Boolean, Int32, Single[], Int32) (Inherited from Paint)
GetStyle()

Return the paint's style, used for controlling how primitives' geometries are interpreted (except for drawBitmap, which always assumes FILL_STYLE).

(Inherited from Paint)
GetTextBounds(Char[], Int32, Int32, Rect)

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).

(Inherited from Paint)
GetTextBounds(ICharSequence, Int32, Int32, Rect)

Retrieve the text boundary box and store to bounds.

(Inherited from Paint)
GetTextBounds(String, Int32, Int32, Rect)

Retrieve the text boundary box and store to bounds.

(Inherited from Paint)
GetTextPath(Char[], Int32, Int32, Single, Single, Path)

Return the path (outline) for the specified text.

(Inherited from Paint)
GetTextPath(String, Int32, Int32, Single, Single, Path)

Return the path (outline) for the specified text.

(Inherited from Paint)
GetTextRunAdvances(Char[], Int32, Int32, Int32, Int32, Boolean, Single[], Int32)

Retrieve the character advances of the text.

(Inherited from Paint)
GetTextRunCursor(Char[], Int32, Int32, Boolean, Int32, Int32)

Returns the next cursor position in the run.

(Inherited from Paint)
GetTextRunCursor(ICharSequence, Int32, Int32, Boolean, Int32, Int32)

Returns the next cursor position in the run.

(Inherited from Paint)
GetTextRunCursor(String, Int32, Int32, Boolean, Int32, Int32)

Returns the next cursor position in the run.

(Inherited from Paint)
GetTextWidths(Char[], Int32, Int32, Single[])

Return the advance widths for the characters in the string.

(Inherited from Paint)
GetTextWidths(ICharSequence, Int32, Int32, Single[])

Return the advance widths for the characters in the string.

(Inherited from Paint)
GetTextWidths(String, Int32, Int32, Single[])

Return the advance widths for the characters in the string.

(Inherited from Paint)
GetTextWidths(String, Single[])

Return the advance widths for the characters in the string.

(Inherited from Paint)
HasGlyph(String)

Determine whether the typeface set on the paint has a glyph supporting the string.

(Inherited from Paint)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
MeasureText(Char[], Int32, Int32)

Return the width of the text.

(Inherited from Paint)
MeasureText(ICharSequence, Int32, Int32)

Return the width of the text.

(Inherited from Paint)
MeasureText(String, Int32, Int32)

Return the width of the text.

(Inherited from Paint)
MeasureText(String)

Return the width of the text.

(Inherited from Paint)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Reset()

Restores the paint to its default settings.

(Inherited from Paint)
Set(Paint)

Copy the fields from src into this paint.

(Inherited from Paint)
Set(TextPaint)

Copy the fields from tp into this TextPaint, including the fields inherited from Paint.

SetARGB(Int32, Int32, Int32, Int32)

Helper to setColor(), that takes a,r,g,b and constructs the color int

(Inherited from Paint)
SetColor(Int64)

Set the paint's color with a ColorLong.

(Inherited from Paint)
SetColorFilter(ColorFilter)

Set or clear the paint's colorfilter, returning the parameter.

(Inherited from Paint)
SetFontVariationSettings(String)

Sets TrueType or OpenType font variation settings.

(Inherited from Paint)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetMaskFilter(MaskFilter)

Set or clear the maskfilter object.

(Inherited from Paint)
SetPathEffect(PathEffect)

Set or clear the patheffect object.

(Inherited from Paint)
SetRasterizer(Rasterizer)
Obsolete.

Set or clear the rasterizer object.

(Inherited from Paint)
SetShader(Shader)

Set or clear the shader object.

(Inherited from Paint)
SetShadowLayer(Single, Single, Single, Color)

This draws a shadow layer below the main layer, with the specified offset and color, and blur radius.

(Inherited from Paint)
SetShadowLayer(Single, Single, Single, Int64)

This draws a shadow layer below the main layer, with the specified offset and color, and blur radius.

(Inherited from Paint)
SetStyle(Paint+Style)

Set the paint's style, used for controlling how primitives' geometries are interpreted (except for drawBitmap, which always assumes Fill).

(Inherited from Paint)
SetTypeface(Typeface)

Set or clear the typeface object.

(Inherited from Paint)
SetXfermode(Xfermode)

Set or clear the transfer mode object.

(Inherited from Paint)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to