net.rim.device.api.ui
Class DrawTextParam.AdvancedDrawTextParam

java.lang.Object
  extended by net.rim.device.api.ui.DrawTextParam.AdvancedDrawTextParam
Enclosing class:
DrawTextParam

public static class DrawTextParam.AdvancedDrawTextParam
extends Object

Advanced text drawing parameters. A DrawTextParam can optionally have a reference to an object of this type.

Since:
BlackBerry API 6.0.0

Field Summary
static int ALPHABETIC_BASELINE
          Value for iBaseline: this identifies the baseline used by most alphabetic and syllabic scripts.
static int BOTTOM_BASELINE
          Value for iBaseline: a baseline that is (descent + leading below) lower than the alphabetic baseline.
static int CENTRAL_BASELINE
          Value for iBaseline: identifies a computed baseline that is at the center of the EM box.
static int DEFAULT_BASELINE
          Value for iBaseline: the default baseline allows the baseline to be specified by DrawTextParam.iAlignment, which supports fewer baselines but is backward-compatible.
static int HANGING_BASELINE
          Value for iBaseline: this identifies the baseline used by certain Indic scripts.
static int HIGH_CENTRAL_BASELINE
          Value for iBaseline: a baseline half way between TOP_BASELINE and ALPHABETIC_BASELINE.
static int IDEOGRAPHIC_BASELINE
          Value for iBaseline: this identifies the baseline used by ideographic scripts.
static int MATHEMATICAL_BASELINE
          Value for iBaseline: the baseline used for mathematical symbols.
static int MIDDLE_BASELINE
          Value for iBaseline: this identifies a baseline that is offset from the alphabetic baseline in the shift-direction by half the value of the x-height font characteristic.
static int TEXT_AFTER_EDGE_BASELINE
          Value for iBaseline: this identifies the after-edge of the EM box.
static int TEXT_BEFORE_EDGE_BASELINE
          Value for iBaseline: this identifies the before-edge of the EM box.
static int TEXT_CASE_CAPITALIZE
          Value for iTextCaseTransform: capitalizes the text.
static int TEXT_CASE_LOWER
          Value for iTextCaseTransform: changes the text to lower case.
static int TEXT_CASE_NONE
          Value for iTextCaseTransform: does not change the case of the text.
static int TEXT_CASE_TITLE
          Value for iTextCaseTransform: changes the text to Title Case.
static int TEXT_CASE_UPPER
          Value for iTextCaseTransform: changes the text to UPPER CASE.
static int TOP_BASELINE
          Value for iBaseline: a baseline that is (ascent + leading above) higher than the alphabetic baseline.
static int WORD_SPACE_ADD
          Value for iWordSpacing: the supplied word space size is added to the natural word space size.
static int WORD_SPACE_MULTIPLY
          Value for iWordSpacing: the supplied word space size is multiplied by the natural word space size.
static int WORD_SPACE_NATURAL
          Value for iWordSpacing: uses the natural word spacing.
static int WORD_SPACE_OVERRIDE
          Value for iWordSpacing: the supplied word space size is used instead of the natural word space size.
 boolean iAllowStartOverlap
          If true, allows the first glyph group to kern left of the origin.
 int iBaseLine
          The baseline controls how the text is aligned on the path on which it is drawn.
 boolean iCopyFit
          If true, copy-fits the text - that is, stretches it or shrinks it to fit a certain rectangle, relative to the point at which the text is drawn.
 int iCopyFitRectBottom
          The bottom edge of the copy-fit rectangle.
 int iCopyFitRectLeft
          The left edge of the copy-fit rectangle.
 int iCopyFitRectRight
          The right edge of the copy-fit rectangle.
 int iCopyFitRectTop
          The top edge of the copy-fit rectangle.
 boolean iKern
          If true, kerning is done normally, otherwise kerning is suppressed.
 int iStartOffset
          Where to start along the path.
 int iSupplementaryRotation
          The amount in degrees by which to rotate each character around the drawing position after any transformations needed to position it on the path.
 int iTextCaseTransform
          If iTextCaseTransform is not TEXT_CASE_NONE, changes the case of the text while drawing or measuring it.
 int iWordSpaceMode
          If iWordSpaceMode is non-zero, overrides word spacing by using the value of iWordSpacing in various ways (see the WORD_SPACE_* constants).
 int iWordSpacing
          If iWordSpaceMode is non-zero this value in pixels overrides the natural width of a word space (U+0020).
 
Constructor Summary
DrawTextParam.AdvancedDrawTextParam()
          Creates an AdvancedDrawTextParam object with default parameters.
 
Method Summary
 void reset()
          Sets all parameters to their default values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

DEFAULT_BASELINE

public static final int DEFAULT_BASELINE
Value for iBaseline: the default baseline allows the baseline to be specified by DrawTextParam.iAlignment, which supports fewer baselines but is backward-compatible.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ALPHABETIC_BASELINE

public static final int ALPHABETIC_BASELINE
Value for iBaseline: this identifies the baseline used by most alphabetic and syllabic scripts. These include, but are not limited to, many Western, Southern Indic, Southeast Asian (non-ideographic) scripts.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

IDEOGRAPHIC_BASELINE

public static final int IDEOGRAPHIC_BASELINE
Value for iBaseline: this identifies the baseline used by ideographic scripts.

For historical reasons, this baseline is at the bottom of the ideographic EM box and not in the centre of the ideographic EM box. See the "central" baseline. The ideographic scripts include Chinese, Japanese, Korean, and Vietnamese Chu Nom.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

HANGING_BASELINE

public static final int HANGING_BASELINE
Value for iBaseline: this identifies the baseline used by certain Indic scripts. These scripts include Devanagari, Gurmukhi and Bengali.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

MATHEMATICAL_BASELINE

public static final int MATHEMATICAL_BASELINE
Value for iBaseline: the baseline used for mathematical symbols.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

CENTRAL_BASELINE

public static final int CENTRAL_BASELINE
Value for iBaseline: identifies a computed baseline that is at the center of the EM box.

This baseline lies halfway between the text-before-edge and text-after-edge baselines. For ideographic fonts, this baseline is often used to align the glyphs; it is an alternative to the ideographic baseline.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

MIDDLE_BASELINE

public static final int MIDDLE_BASELINE
Value for iBaseline: this identifies a baseline that is offset from the alphabetic baseline in the shift-direction by half the value of the x-height font characteristic.

The position of this baseline may be obtained from the font data or, for fonts that have a font characteristic for x-height, it may be computed using half the x-height. Lacking either of these pieces of information, the position of this baseline may be approximated by the central baseline.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_BEFORE_EDGE_BASELINE

public static final int TEXT_BEFORE_EDGE_BASELINE
Value for iBaseline: this identifies the before-edge of the EM box.

The position of this baseline may be specified in the baseline table or it may be calculated. The position of this baseline is normally around or at the top of the ascenders, but it may not encompass all accents that can appear above a glyph. For these fonts the value of the ascent font characteristic is used. For ideographic fonts, the position of this baseline is normally 1 EM in the shiftdirection from the ideographic baseline. However, some ideographic fonts have a reduced width in the inline-progression-direction to allow tighter setting. When such a font, designed only for vertical writing-modes, is used in a horizontal writing-mode, the text-before-edge baseline may be less than 1 EM from the text-after-edge.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_AFTER_EDGE_BASELINE

public static final int TEXT_AFTER_EDGE_BASELINE
Value for iBaseline: this identifies the after-edge of the EM box.

The position of this baseline may be specified in the baselinetable or it may be calculated. For fonts with descenders, the position of this baseline is normally around or at the bottom of the descenders. For these fonts the value of the descent font characteristic is used. For ideographic fonts, the position of this baseline is normally at the ideographic baseline.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TOP_BASELINE

public static final int TOP_BASELINE
Value for iBaseline: a baseline that is (ascent + leading above) higher than the alphabetic baseline.

It is higher than TEXT_BEFORE_EDGE_BASELINE by the leading above.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

HIGH_CENTRAL_BASELINE

public static final int HIGH_CENTRAL_BASELINE
Value for iBaseline: a baseline half way between TOP_BASELINE and ALPHABETIC_BASELINE.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

BOTTOM_BASELINE

public static final int BOTTOM_BASELINE
Value for iBaseline: a baseline that is (descent + leading below) lower than the alphabetic baseline.

It is lower than TEXT_AFTER_EDGE_BASELINE by the leading below.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

WORD_SPACE_NATURAL

public static final int WORD_SPACE_NATURAL
Value for iWordSpacing: uses the natural word spacing.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

WORD_SPACE_OVERRIDE

public static final int WORD_SPACE_OVERRIDE
Value for iWordSpacing: the supplied word space size is used instead of the natural word space size.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

WORD_SPACE_ADD

public static final int WORD_SPACE_ADD
Value for iWordSpacing: the supplied word space size is added to the natural word space size.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

WORD_SPACE_MULTIPLY

public static final int WORD_SPACE_MULTIPLY
Value for iWordSpacing: the supplied word space size is multiplied by the natural word space size.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_CASE_NONE

public static final int TEXT_CASE_NONE
Value for iTextCaseTransform: does not change the case of the text.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_CASE_LOWER

public static final int TEXT_CASE_LOWER
Value for iTextCaseTransform: changes the text to lower case.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_CASE_TITLE

public static final int TEXT_CASE_TITLE
Value for iTextCaseTransform: changes the text to Title Case.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_CASE_UPPER

public static final int TEXT_CASE_UPPER
Value for iTextCaseTransform: changes the text to UPPER CASE.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TEXT_CASE_CAPITALIZE

public static final int TEXT_CASE_CAPITALIZE
Value for iTextCaseTransform: capitalizes the text. Converts the first character of each word to upper or title case; does not change other characters.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

iStartOffset

public int iStartOffset
Where to start along the path.

If there is no path this value is used as an offset along an implicit path, which is an infinitely long line in the direction of the baseline. Defined as a 16.16 fixed-point number.

For example, if the curved path is 100 units long, and you want to draw a label on it that is 37 units long and you want the label to be in the middle of the path, calculate the start position along the path as (100 - 37) / 2 = 31.5, then set iStartOffset to that value.

Since:
BlackBerry API 6.0.0

iBaseLine

public int iBaseLine
The baseline controls how the text is aligned on the path on which it is drawn. It can take a value of one of the *_BASELINE constants defined in this class.

Since:
BlackBerry API 6.0.0

iSupplementaryRotation

public int iSupplementaryRotation
The amount in degrees by which to rotate each character around the drawing position after any transformations needed to position it on the path. Defined as a 16.16 fixed-point number.

Since:
BlackBerry API 6.0.0

iWordSpacing

public int iWordSpacing
If iWordSpaceMode is non-zero this value in pixels overrides the natural width of a word space (U+0020). Defined as a 16.16 fixed-point number.

This parameter is scaled by the transform applied to the font used to draw the text, unless iWordSpaceMode is WORD_SPACE_MULTIPLY.

Since:
BlackBerry API 6.0.0

iWordSpaceMode

public int iWordSpaceMode
If iWordSpaceMode is non-zero, overrides word spacing by using the value of iWordSpacing in various ways (see the WORD_SPACE_* constants).

Since:
BlackBerry API 6.0.0

iKern

public boolean iKern
If true, kerning is done normally, otherwise kerning is suppressed.

The default value is true.

Since:
BlackBerry API 6.0.0

iAllowStartOverlap

public boolean iAllowStartOverlap
If true, allows the first glyph group to kern left of the origin. If false, this is prevented from happening by inserting a compensating kern.

If a piece of connected text is drawn as more than one run, iAllowStartOverlap should be set to true for all runs except the first.

The default value is false.

Since:
BlackBerry API 6.0.0

iTextCaseTransform

public int iTextCaseTransform
If iTextCaseTransform is not TEXT_CASE_NONE, changes the case of the text while drawing or measuring it. The text supplied to the drawing or measuring function is not itself changed.

Character counts returned in the text metrics, like the number of characters drawn, reflect the original text, not the transformed text.

Since:
BlackBerry API 6.0.0

iCopyFit

public boolean iCopyFit
If true, copy-fits the text - that is, stretches it or shrinks it to fit a certain rectangle, relative to the point at which the text is drawn.

The rectangle is given by the parameters iCopyFitRectLeft, iCopyFitTop, etc., which define the copy-fit rectangle: the desired rectangle before any rotation resulting from the font instance transformation. If the copy-fit rectangle is empty the bounds of the unrotated text are used, allowing rotated text to be forced to the same size as unrotated text. If the copy-fit rectangle has non-zero height but zero width, the width of the unrotated text is used but the text is fitted to the height of the copy-fit rectangle, and vice versa.

The default value is false.

Since:
BlackBerry API 6.0.0

iCopyFitRectLeft

public int iCopyFitRectLeft
The left edge of the copy-fit rectangle.

This parameter is scaled by the transform applied to the font used to draw the text.

Since:
BlackBerry API 6.0.0

iCopyFitRectTop

public int iCopyFitRectTop
The top edge of the copy-fit rectangle.

This parameter is scaled by the transform applied to the font used to draw the text.

Since:
BlackBerry API 6.0.0

iCopyFitRectRight

public int iCopyFitRectRight
The right edge of the copy-fit rectangle.

This parameter is scaled by the transform applied to the font used to draw the text.

Since:
BlackBerry API 6.0.0

iCopyFitRectBottom

public int iCopyFitRectBottom
The bottom edge of the copy-fit rectangle.

This parameter is scaled by the transform applied to the font used to draw the text.

Since:
BlackBerry API 6.0.0


Constructor Detail

DrawTextParam.AdvancedDrawTextParam

public DrawTextParam.AdvancedDrawTextParam()
Creates an AdvancedDrawTextParam object with default parameters.

Since:
BlackBerry API 6.0.0


Method Detail

reset

public void reset()
Sets all parameters to their default values.

Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.