Re: [fltk/fltk] In Fl_Text_Display style should apply to UTF-8 characters. (#233)

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] In Fl_Text_Display style should apply to UTF-8 characters. (#233) Albrecht Schlosser 03:34 May 20 top right image

I think this is not a bug, but maybe the documentation could be improved. Sure, the style buffer must be in sync with the text buffer, but the user code is expected to do this synchronization, for instance when text is deleted from or added to the text buffer. The user can add modify-callbacks and will get a byte range of deleted and added characters. I don't know how the Fl_Text_Display widget could do the synchronization other than scanning the whole buffer and count characters rather than using the known byte positions to affect the drawing of text.

Disclaimer: this is off the top of my head, w/o actually looking at the code, and I assume that the documentation hasn't been updated with UTF-8 in mind regarding this particular aspect since the transition to UTF-8 in 1.3.0 and later.

I agree that this should be clarified in the docs but I suspect that it will not be changed to make the style buffer use character positions rather than byte positions. This should be investigated...

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.