Methods' Details |
queryTextShapes
- Description
- Extract the polygonal shapes of the layouted text.
Each glyph is represented by a separate
XPolyPolygon2D in the returned sequence.
- Returns
- a sequence of XPolyPolygon2D in font
coordinate space, one for every glyph.
|
|
queryInkMeasures
- Description
- Query the ink bounding boxes for every glyph in the layouted
text.
Ink, or tight bounding boxes in this case means that for
e.g. an 'a', the bounding box for the
XPolyPolygon2D describing the glyph 'a' is
returned, not the logical dimensions of the character in the
font.
- Returns
- a sequence of rectangles in font coordinate space,
specifying the bounds, one for every glyph.
- See also
- XTextLayout::queryMeasures()
|
|
queryMeasures
- Description
- Query the logical bounding boxes of every character in the
given text string.
Logical bounding boxes means the space that the font allocates
for the given character, which, e.g. for a '.', might be
significantly broader than the bounds returned via
XTextLayout::queryInkMeasures().
- Returns
- a sequence of rectangles specifying the bounds in
font coordinate space, one for every glyph.
- See also
- XTextLayout::queryInkMeasures()
|
|
queryLogicalAdvancements
sequence< double > |
queryLogicalAdvancements(); |
- Description
- Query the advancements for every character in the input string.
This method returns a sequence of advancements, one for each
character in the input string (not for every
glyph. There might be multiple glyphs per input character, or
multiple input characters per glyph). Adding up all
advancements yields the total advancement of this layout. To
manipulate the layout of a string on the level of characters,
this method can be used to query for the layout's default
advancements, which can subsequently be changed and applied to
the layout via
XTextLayout::applyLogicalAdvancements().
- Returns
- a sequence of ::double specifying the
advancements per character in font coordinate space.
- See also
- XTextLayout::applyLogicalAdvancements()
|
|
applyLogicalAdvancements
- Description
- Apply explicit advancements for every character in the layout
string.
This method applies the specified advancements to every
logical character in the input string (not for every
glyph. There might be multiple glyphs per input character, or
multiple input characters per glyph). This is useful to
explicitely manipulate the exact output positions of
characters, e.g. relative to a reference output device.
- Parameter aAdvancements
- A sequence of character advancements, in font coordinate
space.
- Throws
- com::sun::star::lang::IllegalArgumentException
if the size of aAdvancements does not match the number of
characters in the text.
- See also
- XTextLayout::queryLogicalAdvancements()
|
|
queryTextBounds
- Description
- Query the overall bounding box of the text.
This method is similar to
XTextLayout::queryTextMeasures, only that the
overall bounds are returned by this method.
- Returns
- the overall bounding box for the given layout, in font
coordinate space.
|
|
justify
- Description
- Justify the text to the given size.
This method is the core of the XTextLayout
interface, because it layouts the text in a typographically
correct way into the available space.
- Parameter nSize
- The requested size of the text after justification (either
width or height, depending on the writing mode). This
parameter is interpreted in font coordinate space.
- Returns
- the actual size of the text after the justification in
the font coordinate space. Depending on the font and the
script type, this might be somewhat different from the size
requested. If the requested size was smaller than the
justification algorithm could compress the text, this value
might even be significantly larger than nSize.
- Throws
- com::sun::star::lang::IllegalArgumentException
if nSize is 0 or negative.
|
|
combinedJustify
- Description
- Justify a number of text layouts to the given size.
This method can be used to combine the layout of a text line
into a single justification run. This is e.g. useful if the
line consists of several text portions (e.g. because of
different fonts or colors), but it is desirable to spread the
available space more globally across the different layout
objects. If, for example, one layout object contains
significantly more whitespace or Kashidas than the rest, this
method can assign proportionally more space to this layout
object.
- Parameter aNextLayouts
- A sequence of layouts following this one in logical text
order.
- Parameter nSize
- The requested size of the text for all
XTextLayouts after justification in font
coordinate space (either width or height, depending on the
writing mode).
- Returns
- the actual size of the text after the justification,
in font coordinate space. Depending on the font and the
script type, this might be somewhat different from the size
requested. If the requested size was smaller than the
justification algorithm could compress the text, this value
might even be significantly larger than nSize.
- Throws
- com::sun::star::lang::IllegalArgumentException
if one of the parameters are not in the valid range.
|
|
getTextHit
- Description
- This method determines the hit position in the text.
This method determines the index of the character hit at the
specified position (in font coordinate space).
- Parameter aHitPoint
- The position in font coordinate space to determine the
underlying character index for.
|
|
getCaret
- Description
- This method converts an insertion index to a caret.
This method generates caret information for a given insertion
point in the layout text.
- Parameter nInsertionIndex
- The insertion index, as e.g. returned by
XTextLayout::getTextHit(). This value must be
in the range 0 up to the number of characters in the string.
- Parameter bExcludeLigatures
- Set this to true, to skip the positions inside ligatures as
valid caret placements. That means, on cannot e.g. set the
caret between the 'f' and the 'i' in a 'fi' ligature.
- Returns
- the generated Caret structure.
- Throws
- com::sun::star::lang::IndexOutOfBoundsException
if nInsertionIndex is outside the permissible range.
|
|
getNextInsertionIndex
long |
getNextInsertionIndex( |
[in] long |
nStartIndex, |
| [in] long |
nCaretAdvancement, |
| [in] boolean |
bExcludeLigatures ) |
raises( |
::com::sun::star::lang::IndexOutOfBoundsException ); |
- Description
- This method calculates a new insertion index.
This method calculates a new insertion index, given a start
index and the number of characters to skip. This is most
useful for caret traveling.
- Parameter nStartIndex
- The insertion index to start from.
- Parameter nCaretAdvancement
- For values greater than 0, the caret is visually moved to the
right. For values smaller than 0, the caret is visually moved
to the left.
- Returns
- the new insertion index.
- Throws
- com::sun::star::lang::IndexOutOfBoundsException
if nStartIndex or nCaretAdvancement is outside the permissible
range.
|
|
queryVisualHighlighting
- Description
- This method generates a highlight polygon.
This method generates a highlighting polygon from two
insertion indices. This polygon will be visually continuous,
i.e. will not have non-highlighted text in between.
- Parameter nStartIndex
- Start of the selection range.
- Parameter nEndIndex
- End of the selection range.
- Returns
- the highlight polygon in the font coordinate space.
- Throws
- com::sun::star::lang::IndexOutOfBoundsException
if nStartIndex or nEndIndex are outside the permissible
range.
|
|
queryLogicalHighlighting
- Description
- This method generates a highlight polygon.
This method generates a highlighting polygon from two
insertion indices. This polygon will not always be visually
continuous, if e.g. the text direction changes in the middle
of the selection, the might be parts visually between start
and end position that are not selected.
- Parameter nStartIndex
- Start of the selection range.
- Parameter nEndIndex
- End of the selection range.
- Returns
- the highlight polygon in the font coordinate space.
- Throws
- com::sun::star::lang::IndexOutOfBoundsException
if nStartIndex or nEndIndex are outside the permissible
range.
|
|
getBaselineOffset
double |
getBaselineOffset(); |
- Description
- This method yields the baseline offset.
This method returns the baseline offset for this layout
object, either measured from the top or the left edge,
depending on the writing direction (horizontally or
vertically). Since rendering this layout via
XCanvas::drawTextLayout() outputs relative to
the layout object's baseline, this method can be used to
e.g. output relative to the left, top edge.
- Returns
- the distance of the main baseline from the top or the
left edge of this object, depending on the writing direction.
|
|
getMainTextDirection
byte |
getMainTextDirection(); |
- Description
- This method returns the main writing direction.
This method returns the main writing direction of this layout,
i.e. either LEFT_TO_RIGHT or RIGHT_TO_LEFT.
- Returns
- the main text direction of this layout.
|
|
getFont
- Description
- Request the associated font for this layout..
- Returns
- the associated font for this layout.
|
|
getText
- Description
- Request the text this layout contains.
- Returns
- the text this layout contains.
|
|
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.