Re: Pango manual rendering



On 14-08-01 11:04 AM, Edu García wrote:
Hi,

I want to use Pango for layout, but not for rendering. I have a proof of
concept that works, but I think it's not the right way of doing things :)

I create a PangoLayout with my text, then get a PangoLayoutIter, then I start
calling next_line() on it until it returns FALSE. On every iteration, I get a
run (that returns a PangoGlyphItem) and iterate over the contained
PangoGlyphString.

This works but, as I said, I think it's the wrong thing to do, I'm not sure if
depending on "next_line()" is a good idea, I'm not sure if there is a
correlation between that call and the call to "get_run()".

I think that's how you are supposed to call it.


The second problem is that for every glyph, I get the PangoGlyphGeometry, but
the X and Y offsets are always 0. This might be just because the font's I've
tried work like that, but I just want to make sure.

Keep accumulating the advance.  Just add X / Y offsets to the sum of advances
of previous glyphs on the line, to get the position of current glyph.


Another unrelated question is, how can I disable ligatures using Pango?

Currently you can't.


Sorry if this is a bit confusing, but there is little to no information about
what I'm trying to do.


-- 
behdad
http://behdad.org/


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