Re: Is pango_break suitable for breaking text into lines?
- From: Behdad Esfahbod <behdad behdad org>
- To: Roman Beslik <rabeslik gmail com>
- Cc: gtk-i18n-list gnome org
- Subject: Re: Is pango_break suitable for breaking text into lines?
- Date: Mon, 19 Sep 2011 10:50:32 -0400
Yes, use the width from PangoGlyphGeometry. A cluster is an undividable piece
of text and its corresponding glyphs.
b
On 09/18/11 04:36, Roman Beslik wrote:
> Thank you for your anwser. I admit that I should calculate it myself, but I
> still do not know where can I get width of a cluster. BTW, what is a
> "cluster"? Pango manual does not have a glossary. Maybe I should get data from
> "pango_shape" and "PangoGlyphString" and "PangoGlyphInfo" and
> "PangoGlyphGeometry"? There are no glyph extents in "PangoGlyphGeometry", so I
> am stuck again.
>
> On 17.09.11 16:32, Behdad Esfahbod wrote:
>> On 09/17/11 06:48, Roman Beslik wrote:
>>> Hello.
>>>
>>> Is "pango_break" suitable for breaking text into lines such that each line has
>>> width less then some number? I know I can achieve this with "PangoLayout" and
>>> "pango_layout_set_width", but can "pango_break" do the same? I can not find a
>>> function which sets line width.
>>>
>>> As "PangoLayout" is considered "high-level" and "pango_break" is considered
>>> "low-level", I guess that the low-level API should have this feature too. More
>>> common case is when a low-level API has features that a high-level API does
>>> not.
>>
>> You get the output of pango_break, then walk over the clusters yourself and
>> decide where you want to break. That's the difference between highlevel and
>> lowlevel: using the lowlevel API you need to do some work yourself.
>>
>> behdad
>>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]