Word Underlining



Currently, I see Pango has the ability to do underlines, but it doesn't
break for white-spaces (namely spaces, though tabs seem to be in there
as well).  I am wanting to work on this to get this fixed.  I see adding
the following enums:

  PANGO_ATTR_UNDERLINE_WORD,	/* PangoAttrInt - This doesn't underline
whitespace */ to PangoAttrType;

  PANGO_UNDERLINE_SPECIAL       /* This should underline with a squigly
bit for spell checking, etc. */ to PangoUnderline;

I am thinking of doing something like this: 

I plan on creating a structure similar to ink_rect that looks a bit like
this:

struct _PangoRectangleList
{
  int x;
  int y;
  int width;
  int height;
  _PangoRectangleList *next
};

Or, it could just be a wrapper struct, whichever is preffered (i.e.
struct PRList { _PangoRectangle PangoRectangle; _PangoRectangle *next};

Either way, the use of this is to only create the line where there is
actually a shape (i.e. no whitespace).

Is this desireable?  Myself and others are wanting to use Pango for
Desktop Publishing functionality.  This is needed for that use.

The final design decision beyond the above is this:

Should, the underline code use this same structure (linked list, or
linked list of arrays (32 words per line sounds good, so 32 elements)
and more or less the same code (except to create the rectangles)?

I would prefer they all use the same structure and code, except for the
ink rectangle setups.

Two final questions: For compatibility, I assume I should add these new
enums, etc. to the end of lists so that programs don't have to be
recompiled (my ABI understanding is a bit shaky, but this seems right). 
Is it?

And, I plan on adding word processing style spell checking underline. 
This is what the UNDERLINE_SPECIAL is for.  It would require some
addition logic, not sure what yet, a choice of crazy line styles I guess
as well as color, so a few variables and a few functions.  Is this
acceptable?  Any thoughts?

Upon receiving an answer to these questions, I plan on coding this in
and supplying a patch in short order.

Please, carbon copy me as I am not on the list and I really desire to
know these answers.

Also, is it too late to get these into 2.4 or whatever the next
pango/gtk release will be?

Thank you,
Trever Adams
--
"One Woman can make you fly like an eagle Another can give you the
strength of a lion But only One in the cycle of life can fill your heart
with wonder And the wisdom that you have known a singular joy." --
Unknown




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