Tabs (and other whitespace)



	I'm writing a text widget that renders with Pango.

	One of the options I want in my widget is to be able to set the
tab width.  Should a tab represent 4 spaces?  8 spaces?

	I also want the ability to specify a GList of tab stops, i.e.,tab
stops at 2, 4, 8, 12, n+4.

	I did not see any tab-related functions in the Pango API.

	One thing I could do is substitute tabs with the appropriate
number of spaces before rendering.  But that tab-to-spaces mapping creates
many headaches with highlighting selected text, and correctly
interpreting/translating the results of pango_layout_xy_to_index() to the
appropriate tab character.  I think the tab-configurability should be
within Pango.

	If Owen agrees with this thinking, I will put together an API
proposal for some pango_layout_tab* functions.


	The second thing I want to do with whitespace is have an option to
make whitespace be "visible".  That is, I want a small dot where a " "
would normally be, and the paragraph symbol where a "\n" would normally
appear, and a "->|"-like glyph where a "\t" would normally be.  The color
of those glyphs would be light grey, instead of black like the text.
See MS Word or TextPad for an example of this functionality.

	What's the best way to deal with that?  Create my own font that
has those glyphs in it, and ask Pango to use that font?  Draw them with
Gdk after Pango does its rendering (ye gods!) ?  Add a
pango_layout_set_visible_whitespace(TRUE) function to the API?

	If Pango is the place for this feature, then I would be happy to
write up a proposal for visible whitespace, as well.


Thanks,
Derek Simkowiak
dereks@kd-dev.com

P.S.> Once I have my widget running, I will be happy to volunteer time
into implementing these features (since I want them in my widget :)





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