flyx / OpenGLAda

Thick Ada binding for OpenGL and GLFW
flyx.github.io/OpenGLAda/
MIT License
96 stars 13 forks source link

file "strings_edit.ads" not found #109

Closed sbianti closed 6 years ago

sbianti commented 6 years ago

This package is mentioned several times but not implemented in this project. I guess it's some third party stuff (there is a such named project on sourceforge by dmitry-kazakov, but how to guess). Some clarification should be done on this cause no example compiles without it.

rogermc2 commented 6 years ago

I think it is by dmitry-kazakov. Its used in src/text/gl-text.adb To use src/text, I'm fairly sure that strings_edit.ads from dmitry-kazakov needs to be installed on your system.

sbianti commented 6 years ago

Indeed, is that string_edit project famous ? Absolutely no mention is made on it. I think the maintainer should drop a line on readme.txt

flyx commented 6 years ago

It is mentioned in the documentation of GL.Text. However, I agree that it should be mentioned somewhere in the readme.

Note that you do not need it unless you depend on opengl-text.gpr.

flyx commented 6 years ago

btw, the dependency on Strings_Edit exists for the sole reason of decoding UTF-8. I am not very happy about it but I am also not very motivated to implement it myself. Ada 2012 has introduced Ada.Strings.UTF_Encoding but sadly, that does not include the possibility to iterate over the code points of an UTF-8 encoded string which is what I need. Also I'd like this project to stay Ada 2005 for now.

rogermc2 commented 6 years ago

What would be involved in implementing it. If not too difficult I might have a go myself.

flyx commented 6 years ago

The basic implementation would be fairly simple; the UTF-8 article on Wikipedia should give you enough information to get the job done.

However, a robust implementation should also check for all edge cases (for example, detect invalid byte sequences and raise an appropriate exception). All code points that are no valid unicode characters should also be rejected (this includes surrogate pair halves, see the WTF-8 section in the linked article).

The interface should be similar to Strings_Edit since that one works pretty well.

rogermc2 commented 6 years ago

Looks a bit too complicated for me.