[Pythonmac-SIG] aligning proportional text

Charles Hartman charles.hartman at conncoll.edu
Sat Aug 8 04:56:46 CEST 2009


This may not be the right list, but I think the question may be at  
least partly Mac-specific.

I have lines of text in a proportional font.  Within each line I have  
the index of a certain character.  I want to adjust each line  
horizontally so those indexed characters are vertically aligned.   
Since I obviously can't just count characters as with a monospaced  
font, how do I go about translating from character index in the line  
to pixels?

Any hint much appreciated.  (Any nudge toward pre-existing libraries  
or functions, even more!)  This is all within wxPython, if that  
matters; I don't see anything in the wx.StyledTextControl  
documentation that looks helpful, and I imagine I need something lower- 
level.

Charles Hartman




More information about the Pythonmac-SIG mailing list