> OK. I have string with some length (m = strlen(s);) and I have n - > quantity of characters which I can print. > I can calculate k = fl_utf_nb_char(s, m); > > If k <= n then no problem : fl_draw(s,x,y); > > Otherwise? > In cycle decrease the source text by one byte and check for > length, yes?
It's pretty easy to scan a UTF8 string and determine where each glyph begins, so you'd want to chop a whole glyph off the end of your string, not just one byte, I imagine. I think there might even be a fltk helper function for finding the glyph positions in the string - or am I remembering some other toolkit...? SELEX Galileo Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
