Drawing text with OpenGL seems to be interesting and portable possibility. After a little bit of trying i’ve got many different Unicode code points from different languages shown in OpenGL context:
mdzTextViewer is also available as 64-bit Windows 10 “S mode” package in Microsoft Store.
For macOS: XCode + SwiftUI/Cocoa + mdz_containers/mdz_editor libs looks promising.
For Linux: GTK + mdz_containers/mdz_editor libs seems to work. Code compiles and works just fine under Ubuntu 18.04 (showing main window, menu-bar, tabs-view, text-files under separate tabs) using GTK 2.0.
It works in both GNOME:
Weird is: under Ubuntu 14.04 the same code compiles and runs but shows only empty main window.
I decided not to touch Qt yet, because of commercial license limitations.
Also option of XLib + GLX looks interesting. Kind of “maximal portability” solution but without “native” look and fill.
mdzTextViewer is appeared. This Windows application allows viewing of text files with different Unicode encodings and converting/saving these files in different Unicode encodings.
Text convertions into different encodings are made using mdz_containers. The software is pretty fast (also with very large files), tiny and supports older platforms from Windows 2000.
The main engine of the program is a portable “mdz_editor” library which is yet has to be published. The library works under Android, macOS and Linux (Ubuntu) and i’d like to make port of viewer in one (or maybe a couple) of there OSes just for checking portability issues and demonstration.
At the moment UI part of Windows application is GDI-based. Maybe it worth to try OpenGL for UI code-portability on other platforms.
Recently during integration of UTF-16 support in mdz_containers I came across pretty popular Notepad++ to create text files with different Unicode BOMs. And it seems that Notepad++ (at least last version 7.8.4) lacks a couple of useful things.
- Unicode surrogate characters: if file is UTF-16 (doesn’t matter LE or BE) the characters are shown like this:
If file is UTF-8 everything is ok:
- Other problem is navigation/editing Unicode “grapheme clusters” which should be treated as a single character. Looks like it is possible to navigate inside of them in Notepad++ and consequently break them during editing. It looks like this:
- One more inconvenience happened after I tried to edit ca. 500 MB large text file somewhere in the beginning of it. Notepad++ just hanged without any success.
Maybe these are limitations of Scintilla (editing component which Notepad++ is based on) and not of Notepad++ itself.
This brought me to an idea of writing own text editor/editing component for Windows (“mdzTextEditor” ?), which could be also a good demonstration of mdz_containers abilities concerning texts/data handling correctness and speed…
I’m Maksym Dzyubenko and I enjoy doing programming already more than 20 years. In this blog I’d like to describe and discuss things we are making in maxdz Software GmbH
We are keen to develop solutions which are 1) highly performant 2) highly portable 3) with a small memory footprint 4) with as little as possible external dependencies.
We strive to develop fastest and tiniest libraries/components on the market while being portable. Therefore code of all our basis libraries/components comply with C89/C90 standard. Where possible OS-independent APIs like POSIX are used.
Such solutions not only spare processor ticks (which actually may be very handy for mobile and embedded devices) but also significantly spare costs. They can run even on very old (or minimalistic) hardware. And they are green. 🙂