MicroTeX
MicroTeX copied to clipboard
Qt interface
Hi -
Are there any objections to looking at a possible Qt interface?
Yes, basically you need to warp the Qt graphical backend to implement the interfaces declared in the file src/graphic/graphic.h
(see the demo app in src/platform/cairo/graphic_cairo.cpp
), and you can check the demo app src/samples/gtkmm_main.cpp
to see how it works.
Thanks very much. I've attempted to translate the graphics interface. I'm now trying to make a demo app to see if it works...
That is awesome! Make me know if you have any problems. 😄
The good news is that I'm getting an almost pixel-perfect copy of the Gtk output using my Qt backend for almost all of the samples. Unfortunately here are my current problems:
-
I have an issue with the "\Omega" character. This is being displayed as a "«", unlike the other Greek letters. The code being passed in the wstring is 171, as the source implies. I can only imagine that Qt is doing something special with this character. I'll have to investigate in its internals... It's also not working with \bigtriangleup, \bigtriangledown, \rightleftharpoons (\dashleftarrow and \dashrightarrow don't work in the GTK version). These are also broken
\begin{tabular}{*8l} \Lbag &\Rbag &\lbag & \rbag \ \llceil &\rrceil &\llfloor & \rrfloor \ \llbracket &\rrbracket \end{tabular}
-
The wstrings passed to drawText have a zero character at the end. I have to strip these off as Qt renders them as a dotted box. Are they there for a reason?
-
There are lots of deprecation warnings on building saying warning: dynamic exception specifications are deprecated in C++11 (gcc 9.3).
-
The ASCII test has some non printable characters in the GTK version. What are they testing? "". Qt doesn't render these, but GTK does.
-
In the example with "\begin{align}" it looks a bit strange in the GTK version:
This looks quite different to the Qt version:
(note also the \Omega problem here). Is the GTK version correct? This section also seems to move right when I click the "rendering" button a second time (maybe something isn't initialised), and the page is very wide.
PS Thanks in advance for any help!
Do you mind you create a PR include your Qt implementation to this repository? I'm trying to test these commands and to fix these issues.
Very appreciate!
The PR was merged. The \Omega
command is likely related to the TTF
font file that cannot be rendered correctly on Qt graphical backend. Actually, I have met this problem on Android, modify the cmap
table (character to glyph map) finally solved this problem, but that is not a long-term solution.
I'm planning to transfer from plain ASCII TeX to Unicode-math font that can use these much modern OTF fonts (see issue #21), so this issue could be solved.