Re: extending Pango Attributes

2009-03-02 Thread Behdad Esfahbod
Paul Plaquette wrote:
 Hello,
 
 for a project I have to add specific tag  that come with attributes.
 I also have to support pango span tag and its attributes as the set of
 pango facility markups.
 
 Looking at PangoAttributes,  I am thinking to use that data structure as
 a basis and to extend it for the use of my specific markup call it mymarkup
 and its attributes. It should also possible to use most of the mecanism
 that deals with pango attributes and list of attributes.
 
 i could first parse my own set of markups and attributes using Markup.
 and then parse the reste of the text using pango_parse_markup().

That should work.

 i send this message to take advice form the community:
 do you think it is possible to do it ?

Should be possible, but a bit of a pain.  We want to make pango markup
extensible, but have not came up with the design yet.

behdad



 thanks,
 Trilda
 ___
 gtk-i18n-list mailing list
 gtk-i18n-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
 
___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


Re: pango layout in irregular (non-rectangular) bounding shape

2009-03-02 Thread Behdad Esfahbod
august wrote:
 hey y'all,
 
I'm just getting started with cairo and pango and trying to figure
out how to render text within a non-rectangular bounding shape?   I
can already render stuff to screen and bound a text segment by width
and heightbut still haven't figgered out how to translate it by
x,y.

If you are using pango_cairo_show_layout(), you need a cairo_move_to() before
that.

   In addition, I'd like to render text inside a polygon shape. 

This is not possible yet.  Here is the bug tracking this issue:

  http://bugzilla.gnome.org/show_bug.cgi?id=435706

Can someone point me in the right direction?  I've been reading the
mailinglist archives and looking at the online api reference trying
to figure this out.  I've also started to inspect the Inkscape code
to see how they do itbut can't yet see where.
 
Do I need to iterate through the text segment, character by
character, and draw each glyph to screen, measuring it's x and y?
Is that slow?  

No.  Just do that one line at a time.

behdad

Any help or pointers would be much appreciated.
 
many thanks -august.
 ___
 gtk-i18n-list mailing list
 gtk-i18n-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
 
___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


Re: pango layout in irregular (non-rectangular) bounding shape

2009-03-02 Thread august
 august,
 
  I
  can already render stuff to screen and bound a text segment by width
  and height
 
 I guess you tried PangoLayout and friends.
 
  how to render text within a non-rectangular bounding shape?
 
  Can someone point me in the right direction?
 
 If I were you, I'd be using PangoItem, PangoGlyphString, and friends.
 They are lower layer interface to pango, and you need to write more
 codes than using PangoLayout, but it gives you better control over
 layout.  (There may be some easier ways if you only needs fill texts
 ina non rectangular area, but I don't know.)
 
 The following outlines what you need to do:
 
 (1) Call pango_itemize() once for your text,
 (2) Call pango_break() for your entire text,
 (3) Call pango_shape() for each PangoItem you got,
 (4) Fold the text into lines, scanning the list of PangoItems, calling
 pango_glyph_string_get_width() for each PangoGlyphString you got,
 also breaking several PangoItem in a middle, referring to
 PangoLogAttr array you got (This will be the most complicated step),
 (5) Either call pango_reorder_items() for each folded line and somehow
 refrect the results to your list of PangoGlyphString (or does an
 equivalent processing manually as suggested by pango document...), and
 (6) Call pango_cairo_show_glyph_string() for each PangoGlyphString,
 moving the cairo current point appropriately.
 
 Hope this helps,
 Alissa

Alissa,

thanks so much for taking the time to outline all of this.  I am
still learning the pango api and this helps.

-august.
___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


Re: pango layout in irregular (non-rectangular) bounding shape

2009-03-02 Thread august
 
In addition, I'd like to render text inside a polygon shape. 
 
 This is not possible yet.  Here is the bug tracking this issue:
 
   http://bugzilla.gnome.org/show_bug.cgi?id=435706


Behdad,

How far did you get with that?  I also see you were looking at
Nathan Hurst's code for inkscape.  I'd love to study some of 
that
code...but it seems like most of the links on that page are gone
now.  Is this something I could help implement?

-august.

___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


PangoCairo help

2009-03-02 Thread Ricchetti, Andrea
Hi,

 

I'm very new user of Linux World.

I'm doing a program for rendering text using pango cairo.

 

I need rendered text on the Video Memory. I've developd a class to
access to the frame buffer, and it's work correctly.

Which is the correct way to start? I mean I've to created a cairo
context and the I've to copy byte per byte (copy the context on the
frame buffer with an appropriate loop).

 

Can you tell me more or send some example?

 

 

Thanks a lot.

Andrea

 

 

 

Andrea Ricchetti

ElectronicDepartment

Software Engineer

 

Snap-on Equipment 

Via Prov. per Carpi, 33

42015 Correggio (RE) - ITALY

Tel: +39-0522 733411- Fax: +39-0522 733410

andrea.ricche...@snapon.com

 

 

___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list