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 04:08 May 20 top right image

FTR: to see that the style handling works in action, please load text with UTF-8 (i.e. non-ASCII) characters in the test/editor example program, for instance this pseudo C++ code:

#include <FL/Fl_Text_Display.H>
int main() {
  // Style table
  Fl_Text_Display::Style_Table_Entry stable[] = {
  // ...
  if (b€c and €) { // text with '€' note: 'and' in code should be highlighted
    printf("This string with € and Umlauts %s is fine\n", "äöüßÄÖÜ");
  } else { // another (incorrect) French comment: déjà vû §
    printf("Incorrect French with German Umlauts %s. Déjà vû \n", "äöüß");
  // Style for text with 
  sbuff->text("AAAAAAAAAA\n ¢ £ ¤ ¥ \nCCCCCCCC\nDDDDDDDDDD\n");
  // still parses "return" fine:

You can add and remove text with or without non-ASCII characters and the style update works (except for some special cases that are different, i.e. non-UTF-8 issues). A better working (although harder to use) example would be to load such text into fluid in FLTK 1.4.x (git) which does the style parsing somewhat better.

Screenshot attached:


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 ''.