Re: How to figure out position of ellipse in ellipsized text?

On 07/13/2009 09:38 AM, Stefan Landvogt wrote:
Let's assume, that the PangoLayout is ellipsised at the end with

Now the text ist too long and pango_layout_is_ellipsized
(m_PangoLayout) actually returns true.

How do I figure out, where the actual ellipse is located, and where my
text in that line ends?

When I iterate through the lines of text and look at a line with
PangoLayoutLine *pangoLayoutLine = pango_layout_get_line_readonly(
m_PangoLayout, line );
and then retrieve
pangoLayoutLine->start and pangoLayoutLine->length,
then I get a longer text, then actually displayed.

All the rest of the text is put in one cluster, mapping to the glyph (or glyphs) for the ellipsis.

The weird thing is: The graphems that are not displayed anymore have
the width of 2.255

Any hint on how to figure out, where the ellipse is actually located
is creatly appreciated!

This is not exposed right now.  Question is, why do you need that exactly?


Kind regards,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]