@simonklee/opentui-tex-native-source 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/LICENSE +674 -0
  2. package/LICENSE-PROJECT +21 -0
  3. package/README.md +7 -0
  4. package/build.zig +112 -0
  5. package/build.zig.zon +12 -0
  6. package/native/lib.zig +280 -0
  7. package/native/nanosvg.c +4 -0
  8. package/native/vendor/.bootstrap-v5 +1 -0
  9. package/native/vendor/LICENSE-NANOSVG +18 -0
  10. package/native/vendor/microtex/.clang-format +26 -0
  11. package/native/vendor/microtex/.github/workflows/ubuntu.yml +92 -0
  12. package/native/vendor/microtex/.github/workflows/windows-gdi.yml +34 -0
  13. package/native/vendor/microtex/.github/workflows/windows-qt.yml +52 -0
  14. package/native/vendor/microtex/CMakeLists.txt +110 -0
  15. package/native/vendor/microtex/LICENSE +21 -0
  16. package/native/vendor/microtex/MicroTeXInstall.cmake +42 -0
  17. package/native/vendor/microtex/README.md +600 -0
  18. package/native/vendor/microtex/build.zig +209 -0
  19. package/native/vendor/microtex/clatexmath.wrap +6 -0
  20. package/native/vendor/microtex/doc/meson.build +38 -0
  21. package/native/vendor/microtex/doc/microtex-doc.toml.in +47 -0
  22. package/native/vendor/microtex/doc/microtex.svg +39 -0
  23. package/native/vendor/microtex/doc/urlmap.js +6 -0
  24. package/native/vendor/microtex/example/gtk/CMakeLists.txt +68 -0
  25. package/native/vendor/microtex/example/gtk/gtk_main.c +170 -0
  26. package/native/vendor/microtex/example/gtk/isamples.cpp +21 -0
  27. package/native/vendor/microtex/example/gtk/isamples.h +15 -0
  28. package/native/vendor/microtex/example/gtk/meson.build +27 -0
  29. package/native/vendor/microtex/example/gtk/microtex-gtk.gresource.xml +6 -0
  30. package/native/vendor/microtex/example/gtk/microtex-gtk.ui +117 -0
  31. package/native/vendor/microtex/example/gtkmm/CMakeLists.txt +19 -0
  32. package/native/vendor/microtex/example/gtkmm/gtkmm_main.cpp +531 -0
  33. package/native/vendor/microtex/example/gtkmm/meson.build +19 -0
  34. package/native/vendor/microtex/example/memcheck/CMakeLists.txt +12 -0
  35. package/native/vendor/microtex/example/memcheck/mem_check_main.cpp +154 -0
  36. package/native/vendor/microtex/example/qt/CMakeLists.txt +37 -0
  37. package/native/vendor/microtex/example/qt/meson.build +25 -0
  38. package/native/vendor/microtex/example/qt/qt_main.cpp +70 -0
  39. package/native/vendor/microtex/example/qt/qt_mainwindow.cpp +107 -0
  40. package/native/vendor/microtex/example/qt/qt_mainwindow.h +40 -0
  41. package/native/vendor/microtex/example/qt/qt_skiatexwidget.cpp +149 -0
  42. package/native/vendor/microtex/example/qt/qt_skiatexwidget.h +48 -0
  43. package/native/vendor/microtex/example/qt/qt_tex_render.h +15 -0
  44. package/native/vendor/microtex/example/qt/qt_texqmlitem.cpp +56 -0
  45. package/native/vendor/microtex/example/qt/qt_texqmlitem.h +31 -0
  46. package/native/vendor/microtex/example/qt/qt_texwidget.cpp +62 -0
  47. package/native/vendor/microtex/example/qt/qt_texwidget.h +31 -0
  48. package/native/vendor/microtex/example/qtpng/CMakeLists.txt +11 -0
  49. package/native/vendor/microtex/example/qtpng/latex2png.cpp +115 -0
  50. package/native/vendor/microtex/example/samples/samples.cpp +52 -0
  51. package/native/vendor/microtex/example/samples/samples.h +32 -0
  52. package/native/vendor/microtex/example/win32/CMakeLists.txt +15 -0
  53. package/native/vendor/microtex/example/win32/meson.build +18 -0
  54. package/native/vendor/microtex/example/win32/win32_main.cpp +375 -0
  55. package/native/vendor/microtex/githooks/pre-commit +19 -0
  56. package/native/vendor/microtex/githooks/pre-push +103 -0
  57. package/native/vendor/microtex/lib/CMakeLists.txt +234 -0
  58. package/native/vendor/microtex/lib/atom/atom.cpp +14 -0
  59. package/native/vendor/microtex/lib/atom/atom.h +96 -0
  60. package/native/vendor/microtex/lib/atom/atom_accent.cpp +115 -0
  61. package/native/vendor/microtex/lib/atom/atom_accent.h +53 -0
  62. package/native/vendor/microtex/lib/atom/atom_basic.cpp +146 -0
  63. package/native/vendor/microtex/lib/atom/atom_basic.h +273 -0
  64. package/native/vendor/microtex/lib/atom/atom_box.cpp +41 -0
  65. package/native/vendor/microtex/lib/atom/atom_box.h +70 -0
  66. package/native/vendor/microtex/lib/atom/atom_char.cpp +99 -0
  67. package/native/vendor/microtex/lib/atom/atom_char.h +147 -0
  68. package/native/vendor/microtex/lib/atom/atom_delim.cpp +65 -0
  69. package/native/vendor/microtex/lib/atom/atom_delim.h +58 -0
  70. package/native/vendor/microtex/lib/atom/atom_fence.cpp +65 -0
  71. package/native/vendor/microtex/lib/atom/atom_fence.h +56 -0
  72. package/native/vendor/microtex/lib/atom/atom_font.cpp +20 -0
  73. package/native/vendor/microtex/lib/atom/atom_font.h +49 -0
  74. package/native/vendor/microtex/lib/atom/atom_frac.cpp +101 -0
  75. package/native/vendor/microtex/lib/atom/atom_frac.h +42 -0
  76. package/native/vendor/microtex/lib/atom/atom_matrix.cpp +756 -0
  77. package/native/vendor/microtex/lib/atom/atom_matrix.h +268 -0
  78. package/native/vendor/microtex/lib/atom/atom_misc.cpp +230 -0
  79. package/native/vendor/microtex/lib/atom/atom_misc.h +200 -0
  80. package/native/vendor/microtex/lib/atom/atom_operator.cpp +51 -0
  81. package/native/vendor/microtex/lib/atom/atom_operator.h +41 -0
  82. package/native/vendor/microtex/lib/atom/atom_root.cpp +61 -0
  83. package/native/vendor/microtex/lib/atom/atom_root.h +27 -0
  84. package/native/vendor/microtex/lib/atom/atom_row.cpp +334 -0
  85. package/native/vendor/microtex/lib/atom/atom_row.h +176 -0
  86. package/native/vendor/microtex/lib/atom/atom_scripts.cpp +182 -0
  87. package/native/vendor/microtex/lib/atom/atom_scripts.h +52 -0
  88. package/native/vendor/microtex/lib/atom/atom_sideset.cpp +92 -0
  89. package/native/vendor/microtex/lib/atom/atom_sideset.h +24 -0
  90. package/native/vendor/microtex/lib/atom/atom_space.cpp +22 -0
  91. package/native/vendor/microtex/lib/atom/atom_space.h +38 -0
  92. package/native/vendor/microtex/lib/atom/atom_stack.cpp +117 -0
  93. package/native/vendor/microtex/lib/atom/atom_stack.h +103 -0
  94. package/native/vendor/microtex/lib/atom/atom_text.cpp +17 -0
  95. package/native/vendor/microtex/lib/atom/atom_text.h +33 -0
  96. package/native/vendor/microtex/lib/atom/atom_vrow.cpp +96 -0
  97. package/native/vendor/microtex/lib/atom/atom_vrow.h +47 -0
  98. package/native/vendor/microtex/lib/atom/atom_zstack.cpp +66 -0
  99. package/native/vendor/microtex/lib/atom/atom_zstack.h +37 -0
  100. package/native/vendor/microtex/lib/atom/colors_def.cpp +157 -0
  101. package/native/vendor/microtex/lib/atom/meson.build +50 -0
  102. package/native/vendor/microtex/lib/box/box.cpp +49 -0
  103. package/native/vendor/microtex/lib/box/box.h +184 -0
  104. package/native/vendor/microtex/lib/box/box_factory.cpp +162 -0
  105. package/native/vendor/microtex/lib/box/box_factory.h +24 -0
  106. package/native/vendor/microtex/lib/box/box_group.cpp +503 -0
  107. package/native/vendor/microtex/lib/box/box_group.h +285 -0
  108. package/native/vendor/microtex/lib/box/box_single.cpp +179 -0
  109. package/native/vendor/microtex/lib/box/box_single.h +157 -0
  110. package/native/vendor/microtex/lib/box/meson.build +15 -0
  111. package/native/vendor/microtex/lib/core/debug_config.cpp +3 -0
  112. package/native/vendor/microtex/lib/core/debug_config.h +24 -0
  113. package/native/vendor/microtex/lib/core/formula.cpp +180 -0
  114. package/native/vendor/microtex/lib/core/formula.h +137 -0
  115. package/native/vendor/microtex/lib/core/formula_def.cpp +167 -0
  116. package/native/vendor/microtex/lib/core/glue.cpp +108 -0
  117. package/native/vendor/microtex/lib/core/glue.h +55 -0
  118. package/native/vendor/microtex/lib/core/localized_num.cpp +51 -0
  119. package/native/vendor/microtex/lib/core/meson.build +19 -0
  120. package/native/vendor/microtex/lib/core/parser.cpp +874 -0
  121. package/native/vendor/microtex/lib/core/parser.h +306 -0
  122. package/native/vendor/microtex/lib/core/split.cpp +185 -0
  123. package/native/vendor/microtex/lib/core/split.h +40 -0
  124. package/native/vendor/microtex/lib/env/env.cpp +141 -0
  125. package/native/vendor/microtex/lib/env/env.h +221 -0
  126. package/native/vendor/microtex/lib/env/meson.build +11 -0
  127. package/native/vendor/microtex/lib/env/units.cpp +109 -0
  128. package/native/vendor/microtex/lib/env/units.h +61 -0
  129. package/native/vendor/microtex/lib/graphic/font_style.cpp +63 -0
  130. package/native/vendor/microtex/lib/graphic/font_style.h +61 -0
  131. package/native/vendor/microtex/lib/graphic/graphic.cpp +38 -0
  132. package/native/vendor/microtex/lib/graphic/graphic.h +314 -0
  133. package/native/vendor/microtex/lib/graphic/graphic_basic.cpp +44 -0
  134. package/native/vendor/microtex/lib/graphic/graphic_basic.h +131 -0
  135. package/native/vendor/microtex/lib/graphic/meson.build +13 -0
  136. package/native/vendor/microtex/lib/macro/macro.cpp +143 -0
  137. package/native/vendor/microtex/lib/macro/macro.h +155 -0
  138. package/native/vendor/microtex/lib/macro/macro_accent.cpp +50 -0
  139. package/native/vendor/microtex/lib/macro/macro_accent.h +61 -0
  140. package/native/vendor/microtex/lib/macro/macro_boxes.h +68 -0
  141. package/native/vendor/microtex/lib/macro/macro_colors.cpp +42 -0
  142. package/native/vendor/microtex/lib/macro/macro_colors.h +42 -0
  143. package/native/vendor/microtex/lib/macro/macro_decl.h +16 -0
  144. package/native/vendor/microtex/lib/macro/macro_def.cpp +418 -0
  145. package/native/vendor/microtex/lib/macro/macro_delims.cpp +56 -0
  146. package/native/vendor/microtex/lib/macro/macro_delims.h +73 -0
  147. package/native/vendor/microtex/lib/macro/macro_env.h +212 -0
  148. package/native/vendor/microtex/lib/macro/macro_fonts.cpp +53 -0
  149. package/native/vendor/microtex/lib/macro/macro_fonts.h +78 -0
  150. package/native/vendor/microtex/lib/macro/macro_frac.cpp +138 -0
  151. package/native/vendor/microtex/lib/macro/macro_frac.h +50 -0
  152. package/native/vendor/microtex/lib/macro/macro_misc.cpp +211 -0
  153. package/native/vendor/microtex/lib/macro/macro_misc.h +217 -0
  154. package/native/vendor/microtex/lib/macro/macro_scripts.cpp +32 -0
  155. package/native/vendor/microtex/lib/macro/macro_scripts.h +17 -0
  156. package/native/vendor/microtex/lib/macro/macro_sizes.h +110 -0
  157. package/native/vendor/microtex/lib/macro/macro_space.cpp +31 -0
  158. package/native/vendor/microtex/lib/macro/macro_space.h +17 -0
  159. package/native/vendor/microtex/lib/macro/macro_styles.cpp +45 -0
  160. package/native/vendor/microtex/lib/macro/macro_styles.h +22 -0
  161. package/native/vendor/microtex/lib/macro/macro_types.h +48 -0
  162. package/native/vendor/microtex/lib/macro/meson.build +33 -0
  163. package/native/vendor/microtex/lib/meson.build +102 -0
  164. package/native/vendor/microtex/lib/microtex.cpp +208 -0
  165. package/native/vendor/microtex/lib/microtex.h +225 -0
  166. package/native/vendor/microtex/lib/microtexConfig.cmake.in +2 -0
  167. package/native/vendor/microtex/lib/microtexapi.h +22 -0
  168. package/native/vendor/microtex/lib/microtexconfig.h.in +7 -0
  169. package/native/vendor/microtex/lib/microtexexport.h +31 -0
  170. package/native/vendor/microtex/lib/otf/clm.cpp +405 -0
  171. package/native/vendor/microtex/lib/otf/clm.h +61 -0
  172. package/native/vendor/microtex/lib/otf/fontsense.cpp +191 -0
  173. package/native/vendor/microtex/lib/otf/fontsense.h +20 -0
  174. package/native/vendor/microtex/lib/otf/glyph.cpp +53 -0
  175. package/native/vendor/microtex/lib/otf/glyph.h +384 -0
  176. package/native/vendor/microtex/lib/otf/math_consts.h +154 -0
  177. package/native/vendor/microtex/lib/otf/meson.build +18 -0
  178. package/native/vendor/microtex/lib/otf/otf.cpp +84 -0
  179. package/native/vendor/microtex/lib/otf/otf.h +177 -0
  180. package/native/vendor/microtex/lib/otf/otfconfig.h +32 -0
  181. package/native/vendor/microtex/lib/otf/path.cpp +187 -0
  182. package/native/vendor/microtex/lib/otf/path.h +120 -0
  183. package/native/vendor/microtex/lib/render/builder.cpp +68 -0
  184. package/native/vendor/microtex/lib/render/builder.h +73 -0
  185. package/native/vendor/microtex/lib/render/meson.build +11 -0
  186. package/native/vendor/microtex/lib/render/render.cpp +136 -0
  187. package/native/vendor/microtex/lib/render/render.h +59 -0
  188. package/native/vendor/microtex/lib/unimath/font_meta.h +22 -0
  189. package/native/vendor/microtex/lib/unimath/font_src.cpp +21 -0
  190. package/native/vendor/microtex/lib/unimath/font_src.h +61 -0
  191. package/native/vendor/microtex/lib/unimath/math_type.cpp +318 -0
  192. package/native/vendor/microtex/lib/unimath/math_type.h +105 -0
  193. package/native/vendor/microtex/lib/unimath/meson.build +18 -0
  194. package/native/vendor/microtex/lib/unimath/uni_char.cpp +121 -0
  195. package/native/vendor/microtex/lib/unimath/uni_char.h +109 -0
  196. package/native/vendor/microtex/lib/unimath/uni_font.cpp +248 -0
  197. package/native/vendor/microtex/lib/unimath/uni_font.h +139 -0
  198. package/native/vendor/microtex/lib/unimath/uni_symbol.cpp +2929 -0
  199. package/native/vendor/microtex/lib/unimath/uni_symbol.h +31 -0
  200. package/native/vendor/microtex/lib/utils/dict_tree.h +68 -0
  201. package/native/vendor/microtex/lib/utils/exceptions.h +61 -0
  202. package/native/vendor/microtex/lib/utils/log.h +34 -0
  203. package/native/vendor/microtex/lib/utils/meson.build +18 -0
  204. package/native/vendor/microtex/lib/utils/nums.h +24 -0
  205. package/native/vendor/microtex/lib/utils/string_utils.cpp +85 -0
  206. package/native/vendor/microtex/lib/utils/string_utils.h +130 -0
  207. package/native/vendor/microtex/lib/utils/types.h +152 -0
  208. package/native/vendor/microtex/lib/utils/utf.cpp +115 -0
  209. package/native/vendor/microtex/lib/utils/utf.h +58 -0
  210. package/native/vendor/microtex/lib/utils/utils.cpp +40 -0
  211. package/native/vendor/microtex/lib/utils/utils.h +88 -0
  212. package/native/vendor/microtex/lib/wrapper/byte_seq.cpp +46 -0
  213. package/native/vendor/microtex/lib/wrapper/byte_seq.h +70 -0
  214. package/native/vendor/microtex/lib/wrapper/callback.cpp +10 -0
  215. package/native/vendor/microtex/lib/wrapper/callback.h +72 -0
  216. package/native/vendor/microtex/lib/wrapper/cwrapper.cpp +206 -0
  217. package/native/vendor/microtex/lib/wrapper/cwrapper.h +305 -0
  218. package/native/vendor/microtex/lib/wrapper/graphic_wrapper.cpp +211 -0
  219. package/native/vendor/microtex/lib/wrapper/graphic_wrapper.h +159 -0
  220. package/native/vendor/microtex/lib/wrapper/meson.build +22 -0
  221. package/native/vendor/microtex/meson.build +75 -0
  222. package/native/vendor/microtex/meson_options.txt +29 -0
  223. package/native/vendor/microtex/platform/cairo/CMakeLists.txt +36 -0
  224. package/native/vendor/microtex/platform/cairo/graphic_cairo.cpp +384 -0
  225. package/native/vendor/microtex/platform/cairo/graphic_cairo.h +119 -0
  226. package/native/vendor/microtex/platform/cairo/meson.build +47 -0
  227. package/native/vendor/microtex/platform/cairo/microtex-cairoConfig.cmake.in +11 -0
  228. package/native/vendor/microtex/platform/flutter/microtex/.metadata +10 -0
  229. package/native/vendor/microtex/platform/flutter/microtex/CHANGELOG.md +3 -0
  230. package/native/vendor/microtex/platform/flutter/microtex/LICENSE +1 -0
  231. package/native/vendor/microtex/platform/flutter/microtex/README.md +15 -0
  232. package/native/vendor/microtex/platform/flutter/microtex/analysis_options.yaml +4 -0
  233. package/native/vendor/microtex/platform/flutter/microtex/android/build.gradle +56 -0
  234. package/native/vendor/microtex/platform/flutter/microtex/android/settings.gradle +1 -0
  235. package/native/vendor/microtex/platform/flutter/microtex/android/src/main/AndroidManifest.xml +3 -0
  236. package/native/vendor/microtex/platform/flutter/microtex/android/src/main/kotlin/io/nano/microtex/microtex/MicrotexPlugin.kt +35 -0
  237. package/native/vendor/microtex/platform/flutter/microtex/example/.metadata +10 -0
  238. package/native/vendor/microtex/platform/flutter/microtex/example/README.md +16 -0
  239. package/native/vendor/microtex/platform/flutter/microtex/example/analysis_options.yaml +31 -0
  240. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/build.gradle +68 -0
  241. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/debug/AndroidManifest.xml +7 -0
  242. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/AndroidManifest.xml +34 -0
  243. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/kotlin/io/nano/microtex/microtex_example/MainActivity.kt +6 -0
  244. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
  245. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
  246. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  247. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  248. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  249. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  250. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  251. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values/styles.xml +18 -0
  252. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values-night/styles.xml +18 -0
  253. package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/profile/AndroidManifest.xml +7 -0
  254. package/native/vendor/microtex/platform/flutter/microtex/example/android/build.gradle +31 -0
  255. package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  256. package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle.properties +3 -0
  257. package/native/vendor/microtex/platform/flutter/microtex/example/android/settings.gradle +11 -0
  258. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
  259. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Debug.xcconfig +2 -0
  260. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Release.xcconfig +2 -0
  261. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile +41 -0
  262. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile.lock +22 -0
  263. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/AppDelegate.swift +13 -0
  264. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
  265. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
  266. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
  267. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
  268. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
  269. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
  270. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
  271. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
  272. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
  273. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
  274. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
  275. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
  276. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
  277. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
  278. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
  279. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
  280. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
  281. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
  282. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
  283. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
  284. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
  285. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
  286. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/Main.storyboard +26 -0
  287. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Info.plist +49 -0
  288. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Runner-Bridging-Header.h +1 -0
  289. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.pbxproj +549 -0
  290. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  291. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  292. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  293. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
  294. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  295. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  296. package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  297. package/native/vendor/microtex/platform/flutter/microtex/example/lib/main.dart +23 -0
  298. package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_in_one.dart +0 -0
  299. package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_screen.dart +208 -0
  300. package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/convert_spans.dart +63 -0
  301. package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/string_ext.dart +10 -0
  302. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/cmp.dart +118 -0
  303. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/draggable.dart +75 -0
  304. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/rich.dart +23 -0
  305. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/split.dart +72 -0
  306. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_highlight_controller.dart +66 -0
  307. package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_input_controller.dart +19 -0
  308. package/native/vendor/microtex/platform/flutter/microtex/example/linux/CMakeLists.txt +116 -0
  309. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/CMakeLists.txt +87 -0
  310. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.cc +15 -0
  311. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.h +15 -0
  312. package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugins.cmake +24 -0
  313. package/native/vendor/microtex/platform/flutter/microtex/example/linux/main.cc +6 -0
  314. package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.cc +104 -0
  315. package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.h +18 -0
  316. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
  317. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
  318. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/GeneratedPluginRegistrant.swift +12 -0
  319. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile +40 -0
  320. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile.lock +22 -0
  321. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/AppDelegate.swift +9 -0
  322. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  323. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  324. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
  325. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
  326. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
  327. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
  328. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
  329. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
  330. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
  331. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
  332. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Debug.xcconfig +2 -0
  333. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Release.xcconfig +2 -0
  334. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
  335. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/DebugProfile.entitlements +12 -0
  336. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Info.plist +32 -0
  337. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/MainFlutterWindow.swift +15 -0
  338. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Release.entitlements +8 -0
  339. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.pbxproj +633 -0
  340. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  341. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
  342. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
  343. package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  344. package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.lock +191 -0
  345. package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.yaml +56 -0
  346. package/native/vendor/microtex/platform/flutter/microtex/example/test/widget_test.dart +26 -0
  347. package/native/vendor/microtex/platform/flutter/microtex/example/windows/CMakeLists.txt +95 -0
  348. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/CMakeLists.txt +103 -0
  349. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.cc +14 -0
  350. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.h +15 -0
  351. package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugins.cmake +24 -0
  352. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/CMakeLists.txt +17 -0
  353. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/Runner.rc +121 -0
  354. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.cpp +61 -0
  355. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.h +33 -0
  356. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/main.cpp +43 -0
  357. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resource.h +16 -0
  358. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resources/app_icon.ico +0 -0
  359. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/runner.exe.manifest +20 -0
  360. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.cpp +64 -0
  361. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.h +19 -0
  362. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.cpp +245 -0
  363. package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.h +98 -0
  364. package/native/vendor/microtex/platform/flutter/microtex/ios/Assets/.gitkeep +0 -0
  365. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.h +4 -0
  366. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.m +19 -0
  367. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/SwiftMicrotexPlugin.swift +14 -0
  368. package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/dummy.h +4 -0
  369. package/native/vendor/microtex/platform/flutter/microtex/ios/microtex.podspec +27 -0
  370. package/native/vendor/microtex/platform/flutter/microtex/lib/microtex.dart +7 -0
  371. package/native/vendor/microtex/platform/flutter/microtex/lib/src/bindings.dart +218 -0
  372. package/native/vendor/microtex/platform/flutter/microtex/lib/src/bounds.dart +10 -0
  373. package/native/vendor/microtex/platform/flutter/microtex/lib/src/context.dart +205 -0
  374. package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontdesc.dart +14 -0
  375. package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontmeta.dart +14 -0
  376. package/native/vendor/microtex/platform/flutter/microtex/lib/src/pathcache.dart +17 -0
  377. package/native/vendor/microtex/platform/flutter/microtex/lib/src/render.dart +291 -0
  378. package/native/vendor/microtex/platform/flutter/microtex/lib/src/texstyle.dart +11 -0
  379. package/native/vendor/microtex/platform/flutter/microtex/lib/src/textlayout.dart +93 -0
  380. package/native/vendor/microtex/platform/flutter/microtex/lib/src/widget.dart +163 -0
  381. package/native/vendor/microtex/platform/flutter/microtex/linux/CMakeLists.txt +33 -0
  382. package/native/vendor/microtex/platform/flutter/microtex/linux/include/microtex/microtex_plugin.h +26 -0
  383. package/native/vendor/microtex/platform/flutter/microtex/linux/microtex_plugin.cc +70 -0
  384. package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/MicrotexPlugin.swift +20 -0
  385. package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/dummy.h +4 -0
  386. package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/microtex-Bridging-Header.h +1 -0
  387. package/native/vendor/microtex/platform/flutter/microtex/macos/microtex.podspec +26 -0
  388. package/native/vendor/microtex/platform/flutter/microtex/nativelib/CMakeLists.txt +44 -0
  389. package/native/vendor/microtex/platform/flutter/microtex/nativelib/builddarwin.sh +108 -0
  390. package/native/vendor/microtex/platform/flutter/microtex/pubspec.yaml +37 -0
  391. package/native/vendor/microtex/platform/flutter/microtex/test/microtex_test.dart +23 -0
  392. package/native/vendor/microtex/platform/flutter/microtex/windows/CMakeLists.txt +32 -0
  393. package/native/vendor/microtex/platform/flutter/microtex/windows/include/microtex/microtex_plugin.h +23 -0
  394. package/native/vendor/microtex/platform/flutter/microtex/windows/microtex_plugin.cpp +82 -0
  395. package/native/vendor/microtex/platform/gdi_win/CMakeLists.txt +20 -0
  396. package/native/vendor/microtex/platform/gdi_win/graphic_win32.cpp +352 -0
  397. package/native/vendor/microtex/platform/gdi_win/graphic_win32.h +137 -0
  398. package/native/vendor/microtex/platform/gdi_win/meson.build +39 -0
  399. package/native/vendor/microtex/platform/gtk/CMakeLists.txt +36 -0
  400. package/native/vendor/microtex/platform/gtk/meson.build +65 -0
  401. package/native/vendor/microtex/platform/gtk/microtex-gtkConfig.cmake.in +11 -0
  402. package/native/vendor/microtex/platform/gtk/microtexequation.cpp +708 -0
  403. package/native/vendor/microtex/platform/gtk/microtexequation.h +72 -0
  404. package/native/vendor/microtex/platform/qt/CMakeLists.txt +37 -0
  405. package/native/vendor/microtex/platform/qt/graphic_qt.cpp +355 -0
  406. package/native/vendor/microtex/platform/qt/graphic_qt.h +116 -0
  407. package/native/vendor/microtex/platform/qt/meson.build +38 -0
  408. package/native/vendor/microtex/platform/qt/microtex-qtConfig.cmake.in +7 -0
  409. package/native/vendor/microtex/platform/skia/CMakeLists.txt +46 -0
  410. package/native/vendor/microtex/platform/skia/graphic_skia.cpp +306 -0
  411. package/native/vendor/microtex/platform/skia/graphic_skia.h +125 -0
  412. package/native/vendor/microtex/platform/skia/microtex-skiaConfig.cmake.in +6 -0
  413. package/native/vendor/microtex/platform/wasm/CMakeLists.txt +38 -0
  414. package/native/vendor/microtex/platform/wasm/emscripten.cross +31 -0
  415. package/native/vendor/microtex/platform/wasm/main.cpp +15 -0
  416. package/native/vendor/microtex/platform/wasm/meson.build +8 -0
  417. package/native/vendor/microtex/platform/wasm/prebuild-example-meson.sh +21 -0
  418. package/native/vendor/microtex/platform/wasm/prebuild-example.sh +21 -0
  419. package/native/vendor/microtex/platform/wasm/prebuild-lib-meson.sh +28 -0
  420. package/native/vendor/microtex/platform/wasm/prebuild-lib.sh +31 -0
  421. package/native/vendor/microtex/platform/wasm/web/.babelrc +10 -0
  422. package/native/vendor/microtex/platform/wasm/web/example/examples.js +43 -0
  423. package/native/vendor/microtex/platform/wasm/web/example/hello.js +31 -0
  424. package/native/vendor/microtex/platform/wasm/web/example/index.html +55 -0
  425. package/native/vendor/microtex/platform/wasm/web/example/index.js +243 -0
  426. package/native/vendor/microtex/platform/wasm/web/example/styles.css +86 -0
  427. package/native/vendor/microtex/platform/wasm/web/example/utils.js +47 -0
  428. package/native/vendor/microtex/platform/wasm/web/lib/context.js +271 -0
  429. package/native/vendor/microtex/platform/wasm/web/lib/index.js +10 -0
  430. package/native/vendor/microtex/platform/wasm/web/lib/render.js +293 -0
  431. package/native/vendor/microtex/platform/wasm/web/lib/runtime.js +14 -0
  432. package/native/vendor/microtex/platform/wasm/web/lib/svg.js +237 -0
  433. package/native/vendor/microtex/platform/wasm/web/lib/textlayout.js +88 -0
  434. package/native/vendor/microtex/platform/wasm/web/package-lock.json +5931 -0
  435. package/native/vendor/microtex/platform/wasm/web/package.json +45 -0
  436. package/native/vendor/microtex/platform/wasm/web/publish-example.sh +17 -0
  437. package/native/vendor/microtex/platform/wasm/web/rollup.config.example.js +24 -0
  438. package/native/vendor/microtex/platform/wasm/web/rollup.config.lib.js +16 -0
  439. package/native/vendor/microtex/prebuilt/otf2clm.py +807 -0
  440. package/native/vendor/microtex/prebuilt/otf2clm.sh +9 -0
  441. package/native/vendor/microtex/prebuilt/preclms.sh +17 -0
  442. package/native/vendor/microtex/readme/example_bw_false.svg +680 -0
  443. package/native/vendor/microtex/readme/example_bw_true.svg +680 -0
  444. package/native/vendor/microtex/readme/example_cjk_trying.svg +54 -0
  445. package/native/vendor/microtex/readme/example_custom_symbols.svg +92 -0
  446. package/native/vendor/microtex/readme/example_debug.svg +764 -0
  447. package/native/vendor/microtex/readme/example_emoji.svg +199 -0
  448. package/native/vendor/microtex/readme/example_have_log.svg +79 -0
  449. package/native/vendor/microtex/readme/example_keep_trying.svg +101 -0
  450. package/native/vendor/microtex/readme/example_logos.svg +50 -0
  451. package/native/vendor/microtex/readme/example_ubuntu.png +0 -0
  452. package/native/vendor/microtex/readme/example_windows.png +0 -0
  453. package/native/vendor/microtex/readme/samples/sample_0.svg +665 -0
  454. package/native/vendor/microtex/readme/samples/sample_1.svg +1259 -0
  455. package/native/vendor/microtex/readme/samples/sample_10.svg +333 -0
  456. package/native/vendor/microtex/readme/samples/sample_11.svg +306 -0
  457. package/native/vendor/microtex/readme/samples/sample_2.svg +2461 -0
  458. package/native/vendor/microtex/readme/samples/sample_3.svg +2653 -0
  459. package/native/vendor/microtex/readme/samples/sample_4.svg +554 -0
  460. package/native/vendor/microtex/readme/samples/sample_5.svg +247 -0
  461. package/native/vendor/microtex/readme/samples/sample_6.svg +1082 -0
  462. package/native/vendor/microtex/readme/samples/sample_7.svg +518 -0
  463. package/native/vendor/microtex/readme/samples/sample_8.svg +529 -0
  464. package/native/vendor/microtex/readme/samples/sample_9.svg +1702 -0
  465. package/native/vendor/microtex/readme/samples.md +301 -0
  466. package/native/vendor/microtex/readme/tex_logo.svg +19 -0
  467. package/native/vendor/microtex/res/EXAMPLE.txt +25 -0
  468. package/native/vendor/microtex/res/SAMPLES.tex +946 -0
  469. package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm1 +0 -0
  470. package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm2 +0 -0
  471. package/native/vendor/microtex/res/firamath/FiraMath-Regular.otf +0 -0
  472. package/native/vendor/microtex/res/firamath/README.md +42 -0
  473. package/native/vendor/microtex/res/lm-math/README +92 -0
  474. package/native/vendor/microtex/res/lm-math/latinmodern-math.clm1 +0 -0
  475. package/native/vendor/microtex/res/lm-math/latinmodern-math.clm2 +0 -0
  476. package/native/vendor/microtex/res/lm-math/latinmodern-math.otf +0 -0
  477. package/native/vendor/microtex/res/tex-gyre/README-TeX-Gyre-DejaVu-Math.txt +82 -0
  478. package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm1 +0 -0
  479. package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm2 +0 -0
  480. package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.otf +0 -0
  481. package/native/vendor/microtex/res/xits/FONTLOG.txt +246 -0
  482. package/native/vendor/microtex/res/xits/OFL.txt +98 -0
  483. package/native/vendor/microtex/res/xits/README.txt +15 -0
  484. package/native/vendor/microtex/res/xits/XITS-Bold.clm1 +0 -0
  485. package/native/vendor/microtex/res/xits/XITS-Bold.clm2 +0 -0
  486. package/native/vendor/microtex/res/xits/XITS-Bold.otf +0 -0
  487. package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm1 +0 -0
  488. package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm2 +0 -0
  489. package/native/vendor/microtex/res/xits/XITS-BoldItalic.otf +0 -0
  490. package/native/vendor/microtex/res/xits/XITS-Italic.clm1 +0 -0
  491. package/native/vendor/microtex/res/xits/XITS-Italic.clm2 +0 -0
  492. package/native/vendor/microtex/res/xits/XITS-Italic.otf +0 -0
  493. package/native/vendor/microtex/res/xits/XITS-Regular.clm1 +0 -0
  494. package/native/vendor/microtex/res/xits/XITS-Regular.clm2 +0 -0
  495. package/native/vendor/microtex/res/xits/XITS-Regular.otf +0 -0
  496. package/native/vendor/microtex/res/xits/XITSMath-Bold.clm1 +0 -0
  497. package/native/vendor/microtex/res/xits/XITSMath-Bold.clm2 +0 -0
  498. package/native/vendor/microtex/res/xits/XITSMath-Bold.otf +0 -0
  499. package/native/vendor/microtex/res/xits/XITSMath-Regular.clm1 +0 -0
  500. package/native/vendor/microtex/res/xits/XITSMath-Regular.clm2 +0 -0
  501. package/native/vendor/microtex/res/xits/XITSMath-Regular.otf +0 -0
  502. package/native/vendor/microtex/test/clm/meson.build +10 -0
  503. package/native/vendor/microtex/test/clm/test_clm.cpp +140 -0
  504. package/native/vendor/microtex/test/env/meson.build +10 -0
  505. package/native/vendor/microtex/test/env/test_env.cpp +100 -0
  506. package/native/vendor/microtex/test/fuzzer/afl.native +20 -0
  507. package/native/vendor/microtex/test/fuzzer/fuzz.sh +135 -0
  508. package/native/vendor/microtex/test/fuzzer/fuzzer.cpp +61 -0
  509. package/native/vendor/microtex/test/fuzzer/generateSeed.java +33 -0
  510. package/native/vendor/microtex/test/fuzzer/meson.build +9 -0
  511. package/native/vendor/microtex/test/fuzzer/microtex.dict +3708 -0
  512. package/native/vendor/microtex/test/fuzzer/platform_none.cpp +100 -0
  513. package/native/vendor/microtex/test/has_filesystem.cpp +8 -0
  514. package/native/vendor/microtex/test/meson.build +6 -0
  515. package/native/vendor/nanosvg.h +3278 -0
  516. package/native/vendor/nanosvgrast.h +1472 -0
  517. package/native/vendor/zigtex/.github/assets/example.svg +27 -0
  518. package/native/vendor/zigtex/LICENSE +674 -0
  519. package/native/vendor/zigtex/README.md +52 -0
  520. package/native/vendor/zigtex/build.zig +52 -0
  521. package/native/vendor/zigtex/build.zig.zon +16 -0
  522. package/native/vendor/zigtex/fonts/latinmodern-math.clm2 +0 -0
  523. package/native/vendor/zigtex/src/main.zig +22 -0
  524. package/native/vendor/zigtex/src/root.zig +124 -0
  525. package/native/vendor/zigtex/src/svg.zig +273 -0
  526. package/native/vendor/zigtex/src/tex.zig +383 -0
  527. package/native/zigtex-0.16.patch +35 -0
  528. package/package.json +27 -0
  529. package/scripts/bootstrap-native +89 -0
@@ -0,0 +1,209 @@
1
+ const std = @import("std");
2
+
3
+ pub fn build(b: *std.Build) !void {
4
+ const target = b.standardTargetOptions(.{});
5
+ // TODO: results in undefined behaviour because debug build includes
6
+ // `-fsanitize=undefined`, which triggers an illegal instruction in
7
+ // `ByteSeq.put`
8
+ const optimize: std.builtin.OptimizeMode = .ReleaseFast;
9
+
10
+ const glyph_render_type = b.option(
11
+ []const u8,
12
+ "GLYPH_RENDER_TYPE",
13
+ "0: use path and typeface both (default). 1: use path only. 2: use typeface only.",
14
+ ) orelse "0";
15
+
16
+ const conf_header = b.addConfigHeader(
17
+ .{
18
+ .include_path = "microtexconfig.h",
19
+ .style = .{ .cmake = b.path("lib/microtexconfig.h.in") },
20
+ },
21
+ .{
22
+ .PROJECT_VERSION_MAJOR = 1,
23
+ .PROJECT_VERSION_MINOR = 0,
24
+ .PROJECT_VERSION_PATCH = 0,
25
+ .HAVE_AUTO_FONT_FIND = true,
26
+ },
27
+ );
28
+
29
+ const install_config = b.addInstallFileWithDir(
30
+ conf_header.getOutputFile(),
31
+ .header,
32
+ "microtexconfig.h",
33
+ );
34
+
35
+ const lib = b.addLibrary(.{
36
+ .name = "microtex",
37
+ .linkage = .static,
38
+ .root_module = b.createModule(.{
39
+ .target = target,
40
+ .optimize = optimize,
41
+ .pic = true,
42
+ }),
43
+ });
44
+
45
+ // also install the configuration header into the include directory
46
+ lib.step.dependOn(&install_config.step);
47
+
48
+ lib.root_module.link_libcpp = true;
49
+ lib.root_module.addConfigHeader(conf_header);
50
+
51
+ lib.root_module.addIncludePath(b.path("lib"));
52
+ lib.root_module.addCMacro("GLYPH_RENDER_TYPE", glyph_render_type);
53
+ lib.root_module.addCSourceFiles(.{
54
+ .root = b.path("lib"),
55
+ .files = SOURCE_FILES,
56
+ .flags = COMPILE_FLAGS,
57
+ });
58
+
59
+ inline for (INCLUDE_FILES) |path| {
60
+ lib.installHeader(b.path("lib/" ++ path), path);
61
+ }
62
+
63
+ // include the C wrapper
64
+ lib.root_module.addCSourceFiles(.{
65
+ .root = b.path("lib"),
66
+ .files = CWRAPPER_FILES,
67
+ .flags = COMPILE_FLAGS,
68
+ });
69
+ lib.root_module.addCMacro("HAVE_CWRAPPER", "");
70
+ inline for (CWRAPPER_INCLUDE) |path| {
71
+ lib.installHeader(b.path("lib/" ++ path), path);
72
+ }
73
+
74
+ b.installArtifact(lib);
75
+
76
+ // optionally link to the memcheck executable to ensure all symbols are defined
77
+ const exe = b.addExecutable(.{
78
+ .name = "memcheck",
79
+ .root_module = b.createModule(.{
80
+ .target = target,
81
+ .optimize = optimize,
82
+ .pic = true,
83
+ }),
84
+ });
85
+
86
+ exe.root_module.linkLibrary(lib);
87
+ exe.root_module.addIncludePath(b.path("zig-out/include"));
88
+ exe.root_module.addIncludePath(b.path("example/samples"));
89
+ exe.root_module.addIncludePath(b.path("example/memcheck"));
90
+ exe.root_module.addCSourceFiles(.{
91
+ .files = &.{
92
+ "example/samples/samples.cpp",
93
+ "example/memcheck/mem_check_main.cpp",
94
+ },
95
+ .flags = COMPILE_FLAGS,
96
+ });
97
+ exe.root_module.addIncludePath(b.path("lib"));
98
+
99
+ const memcheck_step = b.step("memcheck", "Build the memcheck binary.");
100
+ memcheck_step.dependOn(&b.addInstallArtifact(exe, .{}).step);
101
+ }
102
+
103
+ const CWRAPPER_FILES = &.{
104
+ "wrapper/callback.cpp",
105
+ "wrapper/graphic_wrapper.cpp",
106
+ "wrapper/cwrapper.cpp",
107
+ "wrapper/byte_seq.cpp",
108
+ };
109
+
110
+ const CWRAPPER_INCLUDE = &.{
111
+ "wrapper/cwrapper.h",
112
+ "wrapper/callback.h",
113
+ };
114
+
115
+ const INCLUDE_FILES = &.{
116
+ "microtexexport.h",
117
+ "microtex.h",
118
+ "utils/types.h",
119
+ "render/render.h",
120
+ "unimath/font_src.h",
121
+ "unimath/font_meta.h",
122
+ "graphic/graphic.h",
123
+ "graphic/font_style.h",
124
+ "graphic/graphic_basic.h",
125
+ };
126
+
127
+ const COMPILE_FLAGS = &.{
128
+ "-std=c++20",
129
+ // "-lstdc++fs",
130
+ };
131
+
132
+ const SOURCE_FILES = &.{
133
+ // atom folder
134
+ "atom/atom.cpp",
135
+ "atom/atom_basic.cpp",
136
+ "atom/atom_char.cpp",
137
+ "atom/atom_misc.cpp",
138
+ "atom/atom_matrix.cpp",
139
+ "atom/atom_row.cpp",
140
+ "atom/atom_space.cpp",
141
+ "atom/atom_stack.cpp",
142
+ "atom/atom_accent.cpp",
143
+ "atom/atom_scripts.cpp",
144
+ "atom/atom_vrow.cpp",
145
+ "atom/atom_operator.cpp",
146
+ "atom/atom_zstack.cpp",
147
+ "atom/atom_sideset.cpp",
148
+ "atom/atom_font.cpp",
149
+ "atom/atom_delim.cpp",
150
+ "atom/atom_root.cpp",
151
+ "atom/atom_frac.cpp",
152
+ "atom/atom_fence.cpp",
153
+ "atom/atom_box.cpp",
154
+ "atom/atom_text.cpp",
155
+ "atom/colors_def.cpp",
156
+ // box folder
157
+ "box/box.cpp",
158
+ "box/box_factory.cpp",
159
+ "box/box_group.cpp",
160
+ "box/box_single.cpp",
161
+ // core folder
162
+ "core/split.cpp",
163
+ "core/formula.cpp",
164
+ "core/formula_def.cpp",
165
+ "core/glue.cpp",
166
+ "core/localized_num.cpp",
167
+ "core/parser.cpp",
168
+ "core/debug_config.cpp",
169
+ // macro folder
170
+ "macro/macro.cpp",
171
+ "macro/macro_def.cpp",
172
+ "macro/macro_misc.cpp",
173
+ "macro/macro_scripts.cpp",
174
+ "macro/macro_accent.cpp",
175
+ "macro/macro_colors.cpp",
176
+ "macro/macro_space.cpp",
177
+ "macro/macro_delims.cpp",
178
+ "macro/macro_frac.cpp",
179
+ "macro/macro_styles.cpp",
180
+ "macro/macro_fonts.cpp",
181
+ // env folder
182
+ "env/env.cpp",
183
+ "env/units.cpp",
184
+ // utils folder
185
+ "utils/string_utils.cpp",
186
+ "utils/utf.cpp",
187
+ "utils/utils.cpp",
188
+ // otf folder
189
+ "otf/clm.cpp",
190
+ "otf/fontsense.cpp",
191
+ "otf/glyph.cpp",
192
+ "otf/otf.cpp",
193
+ "otf/path.cpp",
194
+ // unimath folder
195
+ "unimath/font_src.cpp",
196
+ "unimath/math_type.cpp",
197
+ "unimath/uni_char.cpp",
198
+ "unimath/uni_font.cpp",
199
+ "unimath/uni_symbol.cpp",
200
+ // graphic folder
201
+ "graphic/font_style.cpp",
202
+ "graphic/graphic_basic.cpp",
203
+ "graphic/graphic.cpp",
204
+ // render folder
205
+ "render/render.cpp",
206
+ "render/builder.cpp",
207
+
208
+ "microtex.cpp",
209
+ };
@@ -0,0 +1,6 @@
1
+ [wrap-git]
2
+ url = https://github.com/NanoMichael/cLaTeXMath.git
3
+ revision = head
4
+
5
+ [provide]
6
+ dependency_names = clatexmath
@@ -0,0 +1,38 @@
1
+ toml_conf = configuration_data()
2
+ toml_conf.set('version', meson.project_version())
3
+
4
+ gidocgen_common_args = [
5
+ '--quiet',
6
+ ]
7
+
8
+ docs_dir = get_option('prefix') / get_option('datadir') / 'doc'
9
+
10
+ if get_option('TARGET_DEVEL')
11
+ source_toml = configure_file(
12
+ input: 'microtex-doc.toml.in',
13
+ output: 'microtex-doc.toml',
14
+ configuration: toml_conf,
15
+ install: true,
16
+ install_dir: docs_dir / 'microtex',
17
+ )
18
+
19
+ gidocgen = find_program('gi-docgen', required: get_option('TARGET_DOCUMENTATION'))
20
+ custom_target('microtex-doc',
21
+ input: [source_toml, gtk_gir[0]],
22
+ output: 'microtex',
23
+ command: [
24
+ gidocgen,
25
+ 'generate',
26
+ gidocgen_common_args,
27
+ '--config=@INPUT0@',
28
+ '--output-dir=@OUTPUT@',
29
+ '--content-dir=@0@'.format(meson.current_source_dir()),
30
+ '@INPUT1@',
31
+ ],
32
+ build_by_default: true,
33
+ install: true,
34
+ install_dir: docs_dir
35
+ )
36
+ else
37
+ warning('TARGET_DOCUMENTATION was enabled, but TARGET_DEVEL was not. No documentation was generated')
38
+ endif
@@ -0,0 +1,47 @@
1
+ [library]
2
+ version = "@version@"
3
+ description = "A dynamic, cross-platform, and embeddable LaTeX rendering library"
4
+ authors = "NanoMichael <artiano@hotmail.com>, Florian \"sp1rit\" <sp1rit@disroot.org>"
5
+ logo_url = "microtex.svg"
6
+ license = "MIT"
7
+ browse_url = "https://github.com/NanoMichael/MicroTeX"
8
+ repository_url = "https://github.com/NanoMichael/MicroTeX.git"
9
+ website_url = "https://github.com/NanoMichael/MicroTeX"
10
+ devhelp = true
11
+ search_index = true
12
+
13
+ dependencies = [
14
+ "GLib-2.0",
15
+ "GObject-2.0",
16
+ "Gtk-4.0"
17
+ ]
18
+
19
+ [dependencies."GLib-2.0"]
20
+ name = "GLib"
21
+ description = "The base type system library"
22
+ docs_url = "https://docs.gtk.org/glib/"
23
+
24
+ [dependencies."GObject-2.0"]
25
+ name = "GObject"
26
+ description = "The base type system library"
27
+ docs_url = "https://docs.gtk.org/gobject/"
28
+
29
+ [dependencies."Gtk-4.0"]
30
+ name = "GTK"
31
+ description = "The GTK toolkit"
32
+ docs_url = "https://docs.gtk.org/gtk4/"
33
+
34
+ [theme]
35
+ name = "basic"
36
+ show_index_summary = true
37
+ show_class_hierarchy = true
38
+
39
+ [source-location]
40
+ base_url = "https://github.com/NanoMichael/MicroTeX/blob/openmath/"
41
+ file_format = "{filename}#L{line}"
42
+
43
+ [extra]
44
+ content_images = [
45
+ "microtex.svg",
46
+ ]
47
+ urlmap_file = "urlmap.js"
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="166pt" height="64pt" viewBox="0 0 166 64" version="1.1">
3
+ <defs>
4
+ <g>
5
+ <symbol overflow="visible" id="glyph0-0">
6
+ <path style="stroke:none;" d=""/>
7
+ </symbol>
8
+ <symbol overflow="visible" id="glyph0-1">
9
+ <path style="stroke:none;" d="M 41.1875 -10.296875 C 41.1875 -11.015625 40.53125 -11.015625 40.3125 -11.015625 C 39.59375 -11.015625 39.53125 -10.734375 39.3125 -9.71875 C 38.09375 -5.046875 36.796875 -0.796875 33.84375 -0.796875 C 31.890625 -0.796875 31.6875 -2.65625 31.6875 -4.109375 C 31.6875 -5.6875 32.546875 -9.078125 33.125 -11.59375 L 35.140625 -19.375 C 35.359375 -20.453125 36.078125 -23.1875 36.359375 -24.265625 C 36.71875 -25.921875 37.4375 -28.65625 37.4375 -29.09375 C 37.4375 -30.390625 36.4375 -31.03125 35.359375 -31.03125 C 34.984375 -31.03125 33.125 -30.953125 32.546875 -28.515625 L 29.15625 -15.046875 L 27.28125 -7.703125 C 27.21875 -7.34375 23.765625 -0.796875 17.921875 -0.796875 C 14.328125 -0.796875 12.59375 -3.171875 12.59375 -7.0625 C 12.59375 -9.140625 13.109375 -11.15625 13.609375 -13.171875 L 16.625 -25.265625 C 16.984375 -26.78125 17.71875 -29.515625 17.71875 -29.875 C 17.71875 -31.109375 16.84375 -31.828125 15.625 -31.828125 C 15.40625 -31.828125 13.390625 -31.75 12.75 -29.234375 L 2.375 12.453125 C 2.15625 13.3125 2.15625 13.609375 2.15625 13.609375 C 2.15625 14.6875 2.953125 15.546875 4.171875 15.546875 C 5.6875 15.546875 6.546875 14.25 6.703125 14.046875 C 6.984375 13.390625 7.921875 9.640625 10.65625 -1.4375 C 12.953125 0.5 16.203125 0.796875 17.640625 0.796875 C 22.6875 0.796875 25.484375 -2.453125 27.21875 -4.46875 C 27.859375 -1.21875 30.53125 0.796875 33.703125 0.796875 C 36.21875 0.796875 37.875 -0.859375 39.03125 -3.171875 C 40.25 -5.765625 41.1875 -10.296875 41.1875 -10.296875 Z M 41.1875 -10.296875 "/>
10
+ </symbol>
11
+ <symbol overflow="visible" id="glyph1-0">
12
+ <path style="stroke:none;" d=""/>
13
+ </symbol>
14
+ <symbol overflow="visible" id="glyph1-1">
15
+ <path style="stroke:none;" d="M 48.3125 -32.765625 L 47.015625 -48.8125 L 3.8125 -48.8125 L 2.515625 -32.765625 L 4.109375 -32.765625 C 5.109375 -44.140625 5.765625 -46.734375 17.140625 -46.734375 C 18.4375 -46.734375 20.453125 -46.734375 21.03125 -46.578125 C 22.46875 -46.375 22.53125 -45.5 22.53125 -43.84375 L 22.53125 -5.546875 C 22.53125 -3.09375 22.53125 -2.09375 15.484375 -2.09375 L 12.890625 -2.09375 L 12.890625 0 C 15.1875 -0.140625 22.609375 -0.140625 25.421875 -0.140625 C 28.21875 -0.140625 35.71875 -0.140625 38.015625 0 L 38.015625 -2.09375 L 35.421875 -2.09375 C 28.375 -2.09375 28.375 -3.09375 28.375 -5.546875 L 28.375 -43.84375 C 28.375 -45.640625 28.515625 -46.296875 29.65625 -46.578125 C 30.234375 -46.734375 32.328125 -46.734375 33.703125 -46.734375 C 45.078125 -46.734375 45.71875 -44.140625 46.734375 -32.765625 Z M 48.3125 -32.765625 "/>
16
+ </symbol>
17
+ <symbol overflow="visible" id="glyph1-2">
18
+ <path style="stroke:none;" d="M 45.9375 -18.4375 L 44.359375 -18.4375 C 42.625 -7.203125 40.890625 -2.09375 28.734375 -2.09375 L 18.9375 -2.09375 C 15.765625 -2.09375 15.625 -2.59375 15.625 -4.96875 L 15.625 -24.40625 L 22.171875 -24.40625 C 29.09375 -24.40625 29.875 -22.171875 29.875 -15.984375 L 31.46875 -15.984375 L 31.46875 -34.921875 L 29.875 -34.921875 C 29.875 -28.734375 29.09375 -26.5 22.171875 -26.5 L 15.625 -26.5 L 15.625 -44.0625 C 15.625 -46.4375 15.765625 -46.9375 18.9375 -46.9375 L 28.515625 -46.9375 C 39.09375 -46.9375 41.328125 -43.34375 42.40625 -32.96875 L 43.984375 -32.96875 L 42.125 -49.03125 L 2.953125 -49.03125 L 2.953125 -46.9375 L 4.390625 -46.9375 C 9.578125 -46.9375 9.796875 -46.21875 9.796875 -43.5625 L 9.796875 -5.46875 C 9.796875 -2.8125 9.578125 -2.09375 4.390625 -2.09375 L 2.953125 -2.09375 L 2.953125 0 L 43.0625 0 Z M 45.9375 -18.4375 "/>
19
+ </symbol>
20
+ <symbol overflow="visible" id="glyph1-3">
21
+ <path style="stroke:none;" d="M 51.1875 0 L 51.1875 -2.09375 C 46.9375 -2.09375 45.21875 -2.09375 43.5625 -4.609375 L 28.15625 -27.640625 L 38.09375 -42.125 C 39.3125 -43.84375 41.40625 -47.015625 48.234375 -47.09375 L 48.234375 -49.171875 C 45.140625 -49.03125 44.359375 -49.03125 40.6875 -49.03125 C 38.734375 -49.03125 34.125 -49.03125 32.46875 -49.171875 L 32.46875 -47.09375 C 35.421875 -46.875 36.359375 -45.140625 36.359375 -43.921875 C 36.359375 -43.125 36.078125 -42.703125 35.640625 -42.046875 L 27 -29.375 L 17.28125 -43.78125 C 17.0625 -44.0625 16.78125 -44.5625 16.78125 -44.921875 C 16.78125 -45.9375 18.28125 -47.09375 20.875 -47.09375 L 20.875 -49.171875 C 19.15625 -49.03125 13.46875 -49.03125 11.375 -49.03125 C 9.359375 -49.03125 4.3125 -49.03125 2.59375 -49.171875 L 2.59375 -47.09375 C 7.984375 -47.09375 8.71875 -46.734375 10.21875 -44.421875 L 23.6875 -24.484375 L 11.59375 -6.84375 C 10.375 -5.046875 8.0625 -2.15625 1.578125 -2.09375 L 1.578125 0 C 4.6875 -0.140625 5.46875 -0.140625 9.140625 -0.140625 C 11.09375 -0.140625 15.765625 -0.140625 17.421875 0 L 17.421875 -2.09375 C 14.40625 -2.234375 13.46875 -4.03125 13.46875 -5.25 C 13.46875 -6.046875 13.828125 -6.546875 14.25 -7.203125 L 24.84375 -22.6875 L 36.5 -5.25 C 36.9375 -4.609375 37.015625 -4.53125 37.015625 -4.25 C 37.015625 -3.390625 35.71875 -2.15625 32.90625 -2.09375 L 32.90625 0 C 34.625 -0.140625 40.25 -0.140625 42.34375 -0.140625 C 44.359375 -0.140625 49.46875 -0.140625 51.1875 0 Z M 51.1875 0 "/>
22
+ </symbol>
23
+ </g>
24
+ </defs>
25
+ <g id="surface523">
26
+ <g style="fill:rgb(100%,100%,100%);fill-opacity:1;">
27
+ <use xlink:href="#glyph0-1" x="0" y="49.175998"/>
28
+ </g>
29
+ <g style="fill:rgb(100%,100%,100%);fill-opacity:1;">
30
+ <use xlink:href="#glyph1-1" x="36.215998" y="49.175998"/>
31
+ </g>
32
+ <g style="fill:rgb(100%,100%,100%);fill-opacity:1;">
33
+ <use xlink:href="#glyph1-2" x="76.319997" y="61.588799"/>
34
+ </g>
35
+ <g style="fill:rgb(100%,100%,100%);fill-opacity:1;">
36
+ <use xlink:href="#glyph1-3" x="113.471995" y="49.175998"/>
37
+ </g>
38
+ </g>
39
+ </svg>
@@ -0,0 +1,6 @@
1
+ // A map between namespaces and base URLs for their online documentation
2
+ baseURLs = [
3
+ [ 'GLib', 'https://docs.gtk.org/glib/' ],
4
+ [ 'GObject', 'https://docs.gtk.org/gobject/' ],
5
+ [ 'Gtk', 'https://docs.gtk.org/gtk4/' ]
6
+ ]
@@ -0,0 +1,68 @@
1
+ find_program(GLIB_COMPILE_RESOURCES NAMES glib-compile-resources REQUIRED)
2
+ set(GRESOURCE_XML microtex-gtk.gresource.xml)
3
+ set(GRESOURCE_C mt_gtk_res.c)
4
+ set(GRESOURCE_H mt_gtk_res.h)
5
+ add_custom_command(
6
+ OUTPUT ${GRESOURCE_C}
7
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
8
+ COMMAND ${GLIB_COMPILE_RESOURCES}
9
+ ARGS
10
+ ${GRESOURCE_XML}
11
+ --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}
12
+ --c-name=mt_gtk_resource
13
+ --generate
14
+ --target=${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
15
+ VERBATIM
16
+ MAIN_DEPENDENCY ${GRESOURCE_XML}
17
+ DEPENDS
18
+ microtex-gtk.ui
19
+ )
20
+ add_custom_command(
21
+ OUTPUT ${GRESOURCE_H}
22
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
23
+ COMMAND ${GLIB_COMPILE_RESOURCES}
24
+ ARGS
25
+ ${GRESOURCE_XML}
26
+ --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}
27
+ --c-name=mt_gtk_resource
28
+ --generate
29
+ --target=${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_H}
30
+ VERBATIM
31
+ MAIN_DEPENDENCY ${GRESOURCE_XML}
32
+ DEPENDS
33
+ microtex-gtk.ui
34
+ )
35
+ add_custom_target(
36
+ microtex-gtk-resource
37
+ DEPENDS
38
+ ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
39
+ ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_H}
40
+ )
41
+
42
+ add_executable(
43
+ microtex-gtk-example
44
+ gtk_main.c
45
+ ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
46
+ isamples.cpp
47
+ ../samples/samples.cpp
48
+ )
49
+ set_source_files_properties(
50
+ ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}
51
+ PROPERTIES GENERATED TRUE
52
+ )
53
+
54
+ add_dependencies(microtex-gtk-example microtex-gtk-resource)
55
+ target_include_directories(microtex-gtk-example PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ../samples)
56
+
57
+ find_package(PkgConfig REQUIRED)
58
+ pkg_check_modules(Glib REQUIRED IMPORTED_TARGET glib-2.0)
59
+ pkg_check_modules(Gtk REQUIRED IMPORTED_TARGET gtk4)
60
+ pkg_check_modules(Gsv REQUIRED IMPORTED_TARGET gtksourceview-5)
61
+
62
+ target_link_libraries(
63
+ microtex-gtk-example PRIVATE
64
+ PkgConfig::Glib
65
+ PkgConfig::Gtk
66
+ PkgConfig::Gsv
67
+ microtex-gtk
68
+ )
@@ -0,0 +1,170 @@
1
+ #include <gtk/gtk.h>
2
+ #include <gtksourceview/gtksource.h>
3
+ #include <microtexequation.h>
4
+
5
+ #include "isamples.h"
6
+ #include "mt_gtk_res.h"
7
+
8
+ static gchar* samples_file = NULL;
9
+
10
+ struct _MicroTexGtkDemoWin {
11
+ GtkApplicationWindow parent_instance;
12
+
13
+ GtkPaned* pane;
14
+ GtkButton* sample_btn;
15
+ GtkColorButton* color_btn;
16
+ GtkSourceBuffer* buffer;
17
+ MicroTexEquation* equation;
18
+ GtkButton* save_btn;
19
+
20
+ gpointer samples;
21
+ };
22
+
23
+ #define MICROTEX_TYPE_GTKDEMOWIN (microtex_gtkdemowin_get_type())
24
+ G_DECLARE_FINAL_TYPE(MicroTexGtkDemoWin, microtex_gtkdemowin, MICROTEX, GTKDEMOWIN, GtkApplicationWindow)
25
+ G_DEFINE_TYPE(MicroTexGtkDemoWin, microtex_gtkdemowin, GTK_TYPE_APPLICATION_WINDOW)
26
+
27
+ static void microtex_gtkdemowin_object_dispose(GObject* object) {
28
+ MicroTexGtkDemoWin* self = MICROTEX_GTKDEMOWIN(object);
29
+
30
+ if (self->samples)
31
+ samples_free(g_steal_pointer(&self->samples));
32
+
33
+ G_OBJECT_CLASS(microtex_gtkdemowin_parent_class)->dispose(object);
34
+ }
35
+ static void microtex_gtkdemowin_class_init(MicroTexGtkDemoWinClass* class) {
36
+ GObjectClass* object_class = G_OBJECT_CLASS(class);
37
+ GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(class);
38
+
39
+ object_class->dispose = microtex_gtkdemowin_object_dispose;
40
+
41
+ gtk_widget_class_set_template_from_resource(widget_class, "/com/github/NanoMichael/MicroTeX/GTKDemo/microtex-gtk.ui");
42
+ gtk_widget_class_bind_template_child(widget_class, MicroTexGtkDemoWin, pane);
43
+ gtk_widget_class_bind_template_child(widget_class, MicroTexGtkDemoWin, sample_btn);
44
+ gtk_widget_class_bind_template_child(widget_class, MicroTexGtkDemoWin, color_btn);
45
+ gtk_widget_class_bind_template_child(widget_class, MicroTexGtkDemoWin, buffer);
46
+ gtk_widget_class_bind_template_child(widget_class, MicroTexGtkDemoWin, equation);
47
+ gtk_widget_class_bind_template_child(widget_class, MicroTexGtkDemoWin, save_btn);
48
+ }
49
+
50
+ static void update_nextbtn(MicroTexGtkDemoWin* self) {
51
+ if (self->samples) {
52
+ if (!samples_empty(self->samples)) {
53
+ gtk_widget_set_sensitive(GTK_WIDGET(self->sample_btn), TRUE);
54
+ return;
55
+ }
56
+ }
57
+ gtk_widget_set_sensitive(GTK_WIDGET(self->sample_btn), FALSE);
58
+ }
59
+ static void nextbtn_clicked(GtkButton* btn, MicroTexGtkDemoWin* self) {
60
+ if (!self->samples)
61
+ return;
62
+ if (samples_empty(self->samples))
63
+ return;
64
+
65
+ const gchar* sample = samples_next(self->samples);
66
+ gtk_text_buffer_set_text(GTK_TEXT_BUFFER(self->buffer), sample, -1);
67
+
68
+ update_nextbtn(self);
69
+ }
70
+ static void colorbtn_changed(GtkColorButton* btn, MicroTexGtkDemoWin* self) {
71
+ GdkRGBA gcolor;
72
+ gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(btn), &gcolor);
73
+ guint32 color = (guint8)(gcolor.alpha * 255) << 24 | (guint8)(gcolor.red * 255) << 16 | (guint8)(gcolor.green * 255) << 8 | (guint8)(gcolor.blue * 255);
74
+ microtex_equation_set_color(self->equation, color);
75
+ }
76
+ static void save_svg_cb(GtkNativeDialog* diag, gint resp_id, GBytes* svg) {
77
+ if (resp_id == GTK_RESPONSE_ACCEPT) {
78
+ GFile* file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(diag));
79
+ gssize svgdata_len;
80
+ const guint8* svgdata = g_bytes_get_data(svg, &svgdata_len);
81
+ GError* err = NULL;
82
+ if (!g_file_replace_contents(file, svgdata, svgdata_len, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, &err)) {
83
+ g_critical("Failure saving file: %s\n", err->message);
84
+ g_error_free(err);
85
+ }
86
+ g_object_unref(file);
87
+ }
88
+ g_bytes_unref(svg);
89
+ }
90
+ static void save_svg_btn_clicked(GtkButton* btn, MicroTexGtkDemoWin* self) {
91
+ gboolean success;
92
+ GBytes* svg = microtex_equation_to_svg(self->equation, &success);
93
+
94
+ if (!success) {
95
+ g_warning("Current equation is not valid, aborting save.\n");
96
+ g_bytes_unref(svg);
97
+ return;
98
+ }
99
+
100
+ GtkFileChooserNative* fc = gtk_file_chooser_native_new("Open File", GTK_WINDOW(self), GTK_FILE_CHOOSER_ACTION_SAVE, "Save", "Cancel");
101
+ g_signal_connect(fc, "response", G_CALLBACK(save_svg_cb), svg);
102
+ GtkFileFilter* filter = gtk_file_filter_new();
103
+ gtk_file_filter_set_name(filter, "Scalable Vector Graphics (SVG)");
104
+ gtk_file_filter_add_mime_type(filter, "image/svg+xml");
105
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fc), filter);
106
+ g_object_unref(filter);
107
+
108
+ gtk_native_dialog_show(GTK_NATIVE_DIALOG(fc));
109
+ }
110
+ static void update_latex_pane_size(MicroTexGtkDemoWin* self) {
111
+ GtkWidget* child = gtk_paned_get_end_child(self->pane);
112
+ gint width = gtk_widget_get_allocated_width(child);
113
+ microtex_equation_set_width(self->equation, width);
114
+ }
115
+ static void paned_position_changed(GtkPaned* pane, GParamSpec* pspec, MicroTexGtkDemoWin* self) {
116
+ update_latex_pane_size(self);
117
+ }
118
+
119
+ static void microtex_gtkdemowin_init(MicroTexGtkDemoWin* self) {
120
+ g_type_ensure(MICROTEX_TYPE_EQUATION);
121
+ gtk_widget_init_template(GTK_WIDGET(self));
122
+
123
+ self->samples = samples_new(samples_file);
124
+ update_nextbtn(self);
125
+ g_signal_connect(self->sample_btn, "clicked", G_CALLBACK(nextbtn_clicked), self);
126
+
127
+ GtkStyleContext* style_ctx = gtk_widget_get_style_context(GTK_WIDGET(self->equation));
128
+ GdkRGBA fgcolor;
129
+ if (!gtk_style_context_lookup_color(style_ctx, "theme_text_color", &fgcolor)) {
130
+ g_warning("current gtk theme does not provide `theme_text_color`.\n");
131
+ fgcolor.red = 0.f;
132
+ fgcolor.green = 0.f;
133
+ fgcolor.blue = 0.f;
134
+ fgcolor.alpha = 1.f;
135
+ }
136
+ gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(self->color_btn), &fgcolor);
137
+ g_signal_connect(self->color_btn, "color-set", G_CALLBACK(colorbtn_changed), self);
138
+ colorbtn_changed(self->color_btn, self);
139
+
140
+ g_signal_connect(self->save_btn, "clicked", G_CALLBACK(save_svg_btn_clicked), self);
141
+
142
+ g_signal_connect(self->pane, "notify::position", G_CALLBACK(paned_position_changed), self);
143
+ update_latex_pane_size(self);
144
+
145
+ GtkSourceLanguageManager* langmgr = gtk_source_language_manager_get_default();
146
+ GtkSourceLanguage* tex = gtk_source_language_manager_get_language(langmgr, "latex");
147
+ gtk_source_buffer_set_language(self->buffer, tex);
148
+ }
149
+
150
+ static void activate(GtkApplication* app, gpointer user_data) {
151
+ GtkWidget* win = g_object_new(MICROTEX_TYPE_GTKDEMOWIN, "application", app, NULL);
152
+ gtk_widget_show(win);
153
+ }
154
+
155
+ static const GOptionEntry options[] = {
156
+ {"samples", 's', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_FILENAME, &samples_file, "path to the SAMPLES.tex file", "\"res/SAMPLES.tex\""},
157
+ {NULL}};
158
+ int main(int argc, char** argv) {
159
+ GtkApplication* app;
160
+ int status;
161
+
162
+ g_resources_register(mt_gtk_resource_get_resource());
163
+ app = gtk_application_new("com.github.nanomichael.microtex.gtkdemo", G_APPLICATION_FLAGS_NONE);
164
+ g_application_add_main_option_entries(G_APPLICATION(app), options);
165
+ g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
166
+ status = g_application_run(G_APPLICATION(app), argc, argv);
167
+ g_object_unref(app);
168
+
169
+ return status;
170
+ }
@@ -0,0 +1,21 @@
1
+ #include <glib.h>
2
+
3
+ #include "samples.h"
4
+
5
+ extern "C" {
6
+ gpointer samples_new(const gchar* path) {
7
+ if (!(path && *path))
8
+ return NULL;
9
+ std::string cxxpath(path);
10
+ return (gpointer) new microtex::Samples(cxxpath);
11
+ }
12
+ void samples_free(gpointer samples) {
13
+ delete (microtex::Samples*)samples;
14
+ }
15
+ gboolean samples_empty(gpointer samples) {
16
+ return ((microtex::Samples*)samples)->isEmpty();
17
+ }
18
+ const gchar* samples_next(gpointer samples) {
19
+ return ((microtex::Samples*)samples)->next().c_str();
20
+ }
21
+ }
@@ -0,0 +1,15 @@
1
+ #ifndef __ISAMPLES_H__
2
+ #define __ISAMPLES_H__
3
+
4
+ #include <glib.h>
5
+
6
+ G_BEGIN_DECLS
7
+
8
+ gpointer samples_new(const gchar* path);
9
+ void samples_free(gpointer samples);
10
+ gboolean samples_empty(gpointer samples);
11
+ const gchar* samples_next(gpointer samples);
12
+
13
+ G_END_DECLS
14
+
15
+ #endif // __ISAMPLES_H__
@@ -0,0 +1,27 @@
1
+ gnome = import('gnome')
2
+
3
+ example_gtk_src = [
4
+ 'gtk_main.c',
5
+ 'isamples.cpp',
6
+ '../samples/samples.cpp'
7
+ ]
8
+ example_gtk_inc = '../samples'
9
+
10
+ example_gtk_deps = [
11
+ dependency('glib-2.0'),
12
+ dependency('gtk4'),
13
+ dependency('gtksourceview-5'),
14
+ microtex_gtk_dep
15
+ ]
16
+
17
+ example_gtk_res = gnome.compile_resources('mt_gtk_res', 'microtex-gtk.gresource.xml',
18
+ c_name: 'mt_gtk_resource'
19
+ )
20
+
21
+ executable(
22
+ 'microtex-gtk-example', example_gtk_src, example_gtk_res,
23
+ include_directories: example_gtk_inc,
24
+ link_with: [microtex_gtk_lib, microtex_lib],
25
+ dependencies: example_gtk_deps,
26
+ install: true
27
+ )
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <gresources>
3
+ <gresource prefix="/com/github/NanoMichael/MicroTeX/GTKDemo">
4
+ <file preprocess="xml-stripblanks">microtex-gtk.ui</file>
5
+ </gresource>
6
+ </gresources>