| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3153
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Unicode support |
Summary: | fl_nonspacing() contains questionable code |
Version: | 1.3.3 |
Created By: | AlbrechtS |
Assigned To: | AlbrechtS |
Fix Version: | 1.3.4 (SVN: v10758) |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | AlbrechtS 08:16 Nov 15, 2014 |
| fl_nonspacing is defined in src/fl_utf8.cxx (currently line #357++):
/** returns true if the character is non-spacing. \todo explain what non-spacing means. */ unsigned int fl_nonspacing(unsigned int ucs) { #ifdef __APPLE__ return (ucs==0x20); // FIXME: what does this really do? #else return (unsigned int) XUtf8IsNonSpacing(ucs); #endif }
This code is questionable for several reasons that should be checked... | |
|
#2 | AlbrechtS 08:19 Nov 15, 2014 |
| #ifdef __APPLE__ return (ucs==0x20); // FIXME: what does this really do?
This seems to return the wrong value. It should probably read:
return (ucs != 0x20); // FIXME: what does this really do?
Also I'm not sure if this function is called at all under Mac OS X (__APPLE__). I got the impression that it is not. Needs to be investigated. | |
|
#3 | AlbrechtS 08:31 Nov 15, 2014 |
| Furthermore there seems to be no reason not to call XUtf8IsNonSpacing() under Mac OS X. Despite its name this function is probably not X11 related, but only UTF-8, and should be called on all platforms, if needed.
The file src/xutf8/README states that libXutf8 must be linked with the application (-lXutf8) an gives a tip how to use autoconf to find the lib and the function within that lib. However, I think this is obsolete because FLTK doesn't use an extra library for these UTF-8 functions. | |
|
#4 | ianmacarthur 14:21 May 28, 2015 |
| Agree with Albrecht; we should just call XUtf8IsNonSpacing on all platforms.
The stuff about libXutf8 is archaic and dates back to oksid's old utf8 patches for 1.1.6; we have merged much of that code in the interim. | |
|
#5 | AlbrechtS 07:32 Jun 15, 2015 |
| Fixed in Subversion repository.
Note: comment #2 is now moot since there is no distinction of platforms anymore.
@Ian: please feel free to correct my explanation of "non-spacing". You may have more insights than I have.
STR closed anyway. | |
|
#6 | AlbrechtS 08:23 Jun 15, 2015 |
| Reopening. Docs need some fixes. | |
|
#7 | AlbrechtS 08:45 Jun 15, 2015 |
| @Manolo: Thanks for fixing the typos and character encoding. I missed to check the docs (as I had intended, but I forgot).
There are still some references in the docs with questions like " [What are non-spacing characters?]". We should fix this as well... | |
|
#8 | AlbrechtS 16:10 Jun 28, 2015 |
| Documentation was fixed in svn r 10759. Closed. | |
[ Return to Bugs & Features ]
|
| |