@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.
- package/LICENSE +674 -0
- package/LICENSE-PROJECT +21 -0
- package/README.md +7 -0
- package/build.zig +112 -0
- package/build.zig.zon +12 -0
- package/native/lib.zig +280 -0
- package/native/nanosvg.c +4 -0
- package/native/vendor/.bootstrap-v5 +1 -0
- package/native/vendor/LICENSE-NANOSVG +18 -0
- package/native/vendor/microtex/.clang-format +26 -0
- package/native/vendor/microtex/.github/workflows/ubuntu.yml +92 -0
- package/native/vendor/microtex/.github/workflows/windows-gdi.yml +34 -0
- package/native/vendor/microtex/.github/workflows/windows-qt.yml +52 -0
- package/native/vendor/microtex/CMakeLists.txt +110 -0
- package/native/vendor/microtex/LICENSE +21 -0
- package/native/vendor/microtex/MicroTeXInstall.cmake +42 -0
- package/native/vendor/microtex/README.md +600 -0
- package/native/vendor/microtex/build.zig +209 -0
- package/native/vendor/microtex/clatexmath.wrap +6 -0
- package/native/vendor/microtex/doc/meson.build +38 -0
- package/native/vendor/microtex/doc/microtex-doc.toml.in +47 -0
- package/native/vendor/microtex/doc/microtex.svg +39 -0
- package/native/vendor/microtex/doc/urlmap.js +6 -0
- package/native/vendor/microtex/example/gtk/CMakeLists.txt +68 -0
- package/native/vendor/microtex/example/gtk/gtk_main.c +170 -0
- package/native/vendor/microtex/example/gtk/isamples.cpp +21 -0
- package/native/vendor/microtex/example/gtk/isamples.h +15 -0
- package/native/vendor/microtex/example/gtk/meson.build +27 -0
- package/native/vendor/microtex/example/gtk/microtex-gtk.gresource.xml +6 -0
- package/native/vendor/microtex/example/gtk/microtex-gtk.ui +117 -0
- package/native/vendor/microtex/example/gtkmm/CMakeLists.txt +19 -0
- package/native/vendor/microtex/example/gtkmm/gtkmm_main.cpp +531 -0
- package/native/vendor/microtex/example/gtkmm/meson.build +19 -0
- package/native/vendor/microtex/example/memcheck/CMakeLists.txt +12 -0
- package/native/vendor/microtex/example/memcheck/mem_check_main.cpp +154 -0
- package/native/vendor/microtex/example/qt/CMakeLists.txt +37 -0
- package/native/vendor/microtex/example/qt/meson.build +25 -0
- package/native/vendor/microtex/example/qt/qt_main.cpp +70 -0
- package/native/vendor/microtex/example/qt/qt_mainwindow.cpp +107 -0
- package/native/vendor/microtex/example/qt/qt_mainwindow.h +40 -0
- package/native/vendor/microtex/example/qt/qt_skiatexwidget.cpp +149 -0
- package/native/vendor/microtex/example/qt/qt_skiatexwidget.h +48 -0
- package/native/vendor/microtex/example/qt/qt_tex_render.h +15 -0
- package/native/vendor/microtex/example/qt/qt_texqmlitem.cpp +56 -0
- package/native/vendor/microtex/example/qt/qt_texqmlitem.h +31 -0
- package/native/vendor/microtex/example/qt/qt_texwidget.cpp +62 -0
- package/native/vendor/microtex/example/qt/qt_texwidget.h +31 -0
- package/native/vendor/microtex/example/qtpng/CMakeLists.txt +11 -0
- package/native/vendor/microtex/example/qtpng/latex2png.cpp +115 -0
- package/native/vendor/microtex/example/samples/samples.cpp +52 -0
- package/native/vendor/microtex/example/samples/samples.h +32 -0
- package/native/vendor/microtex/example/win32/CMakeLists.txt +15 -0
- package/native/vendor/microtex/example/win32/meson.build +18 -0
- package/native/vendor/microtex/example/win32/win32_main.cpp +375 -0
- package/native/vendor/microtex/githooks/pre-commit +19 -0
- package/native/vendor/microtex/githooks/pre-push +103 -0
- package/native/vendor/microtex/lib/CMakeLists.txt +234 -0
- package/native/vendor/microtex/lib/atom/atom.cpp +14 -0
- package/native/vendor/microtex/lib/atom/atom.h +96 -0
- package/native/vendor/microtex/lib/atom/atom_accent.cpp +115 -0
- package/native/vendor/microtex/lib/atom/atom_accent.h +53 -0
- package/native/vendor/microtex/lib/atom/atom_basic.cpp +146 -0
- package/native/vendor/microtex/lib/atom/atom_basic.h +273 -0
- package/native/vendor/microtex/lib/atom/atom_box.cpp +41 -0
- package/native/vendor/microtex/lib/atom/atom_box.h +70 -0
- package/native/vendor/microtex/lib/atom/atom_char.cpp +99 -0
- package/native/vendor/microtex/lib/atom/atom_char.h +147 -0
- package/native/vendor/microtex/lib/atom/atom_delim.cpp +65 -0
- package/native/vendor/microtex/lib/atom/atom_delim.h +58 -0
- package/native/vendor/microtex/lib/atom/atom_fence.cpp +65 -0
- package/native/vendor/microtex/lib/atom/atom_fence.h +56 -0
- package/native/vendor/microtex/lib/atom/atom_font.cpp +20 -0
- package/native/vendor/microtex/lib/atom/atom_font.h +49 -0
- package/native/vendor/microtex/lib/atom/atom_frac.cpp +101 -0
- package/native/vendor/microtex/lib/atom/atom_frac.h +42 -0
- package/native/vendor/microtex/lib/atom/atom_matrix.cpp +756 -0
- package/native/vendor/microtex/lib/atom/atom_matrix.h +268 -0
- package/native/vendor/microtex/lib/atom/atom_misc.cpp +230 -0
- package/native/vendor/microtex/lib/atom/atom_misc.h +200 -0
- package/native/vendor/microtex/lib/atom/atom_operator.cpp +51 -0
- package/native/vendor/microtex/lib/atom/atom_operator.h +41 -0
- package/native/vendor/microtex/lib/atom/atom_root.cpp +61 -0
- package/native/vendor/microtex/lib/atom/atom_root.h +27 -0
- package/native/vendor/microtex/lib/atom/atom_row.cpp +334 -0
- package/native/vendor/microtex/lib/atom/atom_row.h +176 -0
- package/native/vendor/microtex/lib/atom/atom_scripts.cpp +182 -0
- package/native/vendor/microtex/lib/atom/atom_scripts.h +52 -0
- package/native/vendor/microtex/lib/atom/atom_sideset.cpp +92 -0
- package/native/vendor/microtex/lib/atom/atom_sideset.h +24 -0
- package/native/vendor/microtex/lib/atom/atom_space.cpp +22 -0
- package/native/vendor/microtex/lib/atom/atom_space.h +38 -0
- package/native/vendor/microtex/lib/atom/atom_stack.cpp +117 -0
- package/native/vendor/microtex/lib/atom/atom_stack.h +103 -0
- package/native/vendor/microtex/lib/atom/atom_text.cpp +17 -0
- package/native/vendor/microtex/lib/atom/atom_text.h +33 -0
- package/native/vendor/microtex/lib/atom/atom_vrow.cpp +96 -0
- package/native/vendor/microtex/lib/atom/atom_vrow.h +47 -0
- package/native/vendor/microtex/lib/atom/atom_zstack.cpp +66 -0
- package/native/vendor/microtex/lib/atom/atom_zstack.h +37 -0
- package/native/vendor/microtex/lib/atom/colors_def.cpp +157 -0
- package/native/vendor/microtex/lib/atom/meson.build +50 -0
- package/native/vendor/microtex/lib/box/box.cpp +49 -0
- package/native/vendor/microtex/lib/box/box.h +184 -0
- package/native/vendor/microtex/lib/box/box_factory.cpp +162 -0
- package/native/vendor/microtex/lib/box/box_factory.h +24 -0
- package/native/vendor/microtex/lib/box/box_group.cpp +503 -0
- package/native/vendor/microtex/lib/box/box_group.h +285 -0
- package/native/vendor/microtex/lib/box/box_single.cpp +179 -0
- package/native/vendor/microtex/lib/box/box_single.h +157 -0
- package/native/vendor/microtex/lib/box/meson.build +15 -0
- package/native/vendor/microtex/lib/core/debug_config.cpp +3 -0
- package/native/vendor/microtex/lib/core/debug_config.h +24 -0
- package/native/vendor/microtex/lib/core/formula.cpp +180 -0
- package/native/vendor/microtex/lib/core/formula.h +137 -0
- package/native/vendor/microtex/lib/core/formula_def.cpp +167 -0
- package/native/vendor/microtex/lib/core/glue.cpp +108 -0
- package/native/vendor/microtex/lib/core/glue.h +55 -0
- package/native/vendor/microtex/lib/core/localized_num.cpp +51 -0
- package/native/vendor/microtex/lib/core/meson.build +19 -0
- package/native/vendor/microtex/lib/core/parser.cpp +874 -0
- package/native/vendor/microtex/lib/core/parser.h +306 -0
- package/native/vendor/microtex/lib/core/split.cpp +185 -0
- package/native/vendor/microtex/lib/core/split.h +40 -0
- package/native/vendor/microtex/lib/env/env.cpp +141 -0
- package/native/vendor/microtex/lib/env/env.h +221 -0
- package/native/vendor/microtex/lib/env/meson.build +11 -0
- package/native/vendor/microtex/lib/env/units.cpp +109 -0
- package/native/vendor/microtex/lib/env/units.h +61 -0
- package/native/vendor/microtex/lib/graphic/font_style.cpp +63 -0
- package/native/vendor/microtex/lib/graphic/font_style.h +61 -0
- package/native/vendor/microtex/lib/graphic/graphic.cpp +38 -0
- package/native/vendor/microtex/lib/graphic/graphic.h +314 -0
- package/native/vendor/microtex/lib/graphic/graphic_basic.cpp +44 -0
- package/native/vendor/microtex/lib/graphic/graphic_basic.h +131 -0
- package/native/vendor/microtex/lib/graphic/meson.build +13 -0
- package/native/vendor/microtex/lib/macro/macro.cpp +143 -0
- package/native/vendor/microtex/lib/macro/macro.h +155 -0
- package/native/vendor/microtex/lib/macro/macro_accent.cpp +50 -0
- package/native/vendor/microtex/lib/macro/macro_accent.h +61 -0
- package/native/vendor/microtex/lib/macro/macro_boxes.h +68 -0
- package/native/vendor/microtex/lib/macro/macro_colors.cpp +42 -0
- package/native/vendor/microtex/lib/macro/macro_colors.h +42 -0
- package/native/vendor/microtex/lib/macro/macro_decl.h +16 -0
- package/native/vendor/microtex/lib/macro/macro_def.cpp +418 -0
- package/native/vendor/microtex/lib/macro/macro_delims.cpp +56 -0
- package/native/vendor/microtex/lib/macro/macro_delims.h +73 -0
- package/native/vendor/microtex/lib/macro/macro_env.h +212 -0
- package/native/vendor/microtex/lib/macro/macro_fonts.cpp +53 -0
- package/native/vendor/microtex/lib/macro/macro_fonts.h +78 -0
- package/native/vendor/microtex/lib/macro/macro_frac.cpp +138 -0
- package/native/vendor/microtex/lib/macro/macro_frac.h +50 -0
- package/native/vendor/microtex/lib/macro/macro_misc.cpp +211 -0
- package/native/vendor/microtex/lib/macro/macro_misc.h +217 -0
- package/native/vendor/microtex/lib/macro/macro_scripts.cpp +32 -0
- package/native/vendor/microtex/lib/macro/macro_scripts.h +17 -0
- package/native/vendor/microtex/lib/macro/macro_sizes.h +110 -0
- package/native/vendor/microtex/lib/macro/macro_space.cpp +31 -0
- package/native/vendor/microtex/lib/macro/macro_space.h +17 -0
- package/native/vendor/microtex/lib/macro/macro_styles.cpp +45 -0
- package/native/vendor/microtex/lib/macro/macro_styles.h +22 -0
- package/native/vendor/microtex/lib/macro/macro_types.h +48 -0
- package/native/vendor/microtex/lib/macro/meson.build +33 -0
- package/native/vendor/microtex/lib/meson.build +102 -0
- package/native/vendor/microtex/lib/microtex.cpp +208 -0
- package/native/vendor/microtex/lib/microtex.h +225 -0
- package/native/vendor/microtex/lib/microtexConfig.cmake.in +2 -0
- package/native/vendor/microtex/lib/microtexapi.h +22 -0
- package/native/vendor/microtex/lib/microtexconfig.h.in +7 -0
- package/native/vendor/microtex/lib/microtexexport.h +31 -0
- package/native/vendor/microtex/lib/otf/clm.cpp +405 -0
- package/native/vendor/microtex/lib/otf/clm.h +61 -0
- package/native/vendor/microtex/lib/otf/fontsense.cpp +191 -0
- package/native/vendor/microtex/lib/otf/fontsense.h +20 -0
- package/native/vendor/microtex/lib/otf/glyph.cpp +53 -0
- package/native/vendor/microtex/lib/otf/glyph.h +384 -0
- package/native/vendor/microtex/lib/otf/math_consts.h +154 -0
- package/native/vendor/microtex/lib/otf/meson.build +18 -0
- package/native/vendor/microtex/lib/otf/otf.cpp +84 -0
- package/native/vendor/microtex/lib/otf/otf.h +177 -0
- package/native/vendor/microtex/lib/otf/otfconfig.h +32 -0
- package/native/vendor/microtex/lib/otf/path.cpp +187 -0
- package/native/vendor/microtex/lib/otf/path.h +120 -0
- package/native/vendor/microtex/lib/render/builder.cpp +68 -0
- package/native/vendor/microtex/lib/render/builder.h +73 -0
- package/native/vendor/microtex/lib/render/meson.build +11 -0
- package/native/vendor/microtex/lib/render/render.cpp +136 -0
- package/native/vendor/microtex/lib/render/render.h +59 -0
- package/native/vendor/microtex/lib/unimath/font_meta.h +22 -0
- package/native/vendor/microtex/lib/unimath/font_src.cpp +21 -0
- package/native/vendor/microtex/lib/unimath/font_src.h +61 -0
- package/native/vendor/microtex/lib/unimath/math_type.cpp +318 -0
- package/native/vendor/microtex/lib/unimath/math_type.h +105 -0
- package/native/vendor/microtex/lib/unimath/meson.build +18 -0
- package/native/vendor/microtex/lib/unimath/uni_char.cpp +121 -0
- package/native/vendor/microtex/lib/unimath/uni_char.h +109 -0
- package/native/vendor/microtex/lib/unimath/uni_font.cpp +248 -0
- package/native/vendor/microtex/lib/unimath/uni_font.h +139 -0
- package/native/vendor/microtex/lib/unimath/uni_symbol.cpp +2929 -0
- package/native/vendor/microtex/lib/unimath/uni_symbol.h +31 -0
- package/native/vendor/microtex/lib/utils/dict_tree.h +68 -0
- package/native/vendor/microtex/lib/utils/exceptions.h +61 -0
- package/native/vendor/microtex/lib/utils/log.h +34 -0
- package/native/vendor/microtex/lib/utils/meson.build +18 -0
- package/native/vendor/microtex/lib/utils/nums.h +24 -0
- package/native/vendor/microtex/lib/utils/string_utils.cpp +85 -0
- package/native/vendor/microtex/lib/utils/string_utils.h +130 -0
- package/native/vendor/microtex/lib/utils/types.h +152 -0
- package/native/vendor/microtex/lib/utils/utf.cpp +115 -0
- package/native/vendor/microtex/lib/utils/utf.h +58 -0
- package/native/vendor/microtex/lib/utils/utils.cpp +40 -0
- package/native/vendor/microtex/lib/utils/utils.h +88 -0
- package/native/vendor/microtex/lib/wrapper/byte_seq.cpp +46 -0
- package/native/vendor/microtex/lib/wrapper/byte_seq.h +70 -0
- package/native/vendor/microtex/lib/wrapper/callback.cpp +10 -0
- package/native/vendor/microtex/lib/wrapper/callback.h +72 -0
- package/native/vendor/microtex/lib/wrapper/cwrapper.cpp +206 -0
- package/native/vendor/microtex/lib/wrapper/cwrapper.h +305 -0
- package/native/vendor/microtex/lib/wrapper/graphic_wrapper.cpp +211 -0
- package/native/vendor/microtex/lib/wrapper/graphic_wrapper.h +159 -0
- package/native/vendor/microtex/lib/wrapper/meson.build +22 -0
- package/native/vendor/microtex/meson.build +75 -0
- package/native/vendor/microtex/meson_options.txt +29 -0
- package/native/vendor/microtex/platform/cairo/CMakeLists.txt +36 -0
- package/native/vendor/microtex/platform/cairo/graphic_cairo.cpp +384 -0
- package/native/vendor/microtex/platform/cairo/graphic_cairo.h +119 -0
- package/native/vendor/microtex/platform/cairo/meson.build +47 -0
- package/native/vendor/microtex/platform/cairo/microtex-cairoConfig.cmake.in +11 -0
- package/native/vendor/microtex/platform/flutter/microtex/.metadata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/CHANGELOG.md +3 -0
- package/native/vendor/microtex/platform/flutter/microtex/LICENSE +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/README.md +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/analysis_options.yaml +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/build.gradle +56 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/settings.gradle +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/src/main/AndroidManifest.xml +3 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/src/main/kotlin/io/nano/microtex/microtex/MicrotexPlugin.kt +35 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/.metadata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/README.md +16 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/analysis_options.yaml +31 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/build.gradle +68 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/debug/AndroidManifest.xml +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/AndroidManifest.xml +34 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/kotlin/io/nano/microtex/microtex_example/MainActivity.kt +6 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values/styles.xml +18 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values-night/styles.xml +18 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/profile/AndroidManifest.xml +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/build.gradle +31 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle.properties +3 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/settings.gradle +11 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Debug.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Release.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile +41 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile.lock +22 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/AppDelegate.swift +13 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/Main.storyboard +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Info.plist +49 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Runner-Bridging-Header.h +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.pbxproj +549 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/main.dart +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_in_one.dart +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_screen.dart +208 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/convert_spans.dart +63 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/string_ext.dart +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/cmp.dart +118 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/draggable.dart +75 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/rich.dart +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/split.dart +72 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_highlight_controller.dart +66 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_input_controller.dart +19 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/CMakeLists.txt +116 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/CMakeLists.txt +87 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.cc +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.h +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugins.cmake +24 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/main.cc +6 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.cc +104 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.h +18 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/GeneratedPluginRegistrant.swift +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile +40 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile.lock +22 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/AppDelegate.swift +9 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Debug.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Release.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/DebugProfile.entitlements +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Info.plist +32 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/MainFlutterWindow.swift +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Release.entitlements +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.pbxproj +633 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.lock +191 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.yaml +56 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/test/widget_test.dart +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/CMakeLists.txt +95 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/CMakeLists.txt +103 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.cc +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.h +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugins.cmake +24 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/CMakeLists.txt +17 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/Runner.rc +121 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.cpp +61 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.h +33 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/main.cpp +43 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resource.h +16 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resources/app_icon.ico +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/runner.exe.manifest +20 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.cpp +64 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.h +19 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.cpp +245 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.h +98 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Assets/.gitkeep +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.h +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.m +19 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/SwiftMicrotexPlugin.swift +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/dummy.h +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/microtex.podspec +27 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/microtex.dart +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/bindings.dart +218 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/bounds.dart +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/context.dart +205 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontdesc.dart +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontmeta.dart +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/pathcache.dart +17 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/render.dart +291 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/texstyle.dart +11 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/textlayout.dart +93 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/widget.dart +163 -0
- package/native/vendor/microtex/platform/flutter/microtex/linux/CMakeLists.txt +33 -0
- package/native/vendor/microtex/platform/flutter/microtex/linux/include/microtex/microtex_plugin.h +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/linux/microtex_plugin.cc +70 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/MicrotexPlugin.swift +20 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/dummy.h +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/microtex-Bridging-Header.h +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/microtex.podspec +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/nativelib/CMakeLists.txt +44 -0
- package/native/vendor/microtex/platform/flutter/microtex/nativelib/builddarwin.sh +108 -0
- package/native/vendor/microtex/platform/flutter/microtex/pubspec.yaml +37 -0
- package/native/vendor/microtex/platform/flutter/microtex/test/microtex_test.dart +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/windows/CMakeLists.txt +32 -0
- package/native/vendor/microtex/platform/flutter/microtex/windows/include/microtex/microtex_plugin.h +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/windows/microtex_plugin.cpp +82 -0
- package/native/vendor/microtex/platform/gdi_win/CMakeLists.txt +20 -0
- package/native/vendor/microtex/platform/gdi_win/graphic_win32.cpp +352 -0
- package/native/vendor/microtex/platform/gdi_win/graphic_win32.h +137 -0
- package/native/vendor/microtex/platform/gdi_win/meson.build +39 -0
- package/native/vendor/microtex/platform/gtk/CMakeLists.txt +36 -0
- package/native/vendor/microtex/platform/gtk/meson.build +65 -0
- package/native/vendor/microtex/platform/gtk/microtex-gtkConfig.cmake.in +11 -0
- package/native/vendor/microtex/platform/gtk/microtexequation.cpp +708 -0
- package/native/vendor/microtex/platform/gtk/microtexequation.h +72 -0
- package/native/vendor/microtex/platform/qt/CMakeLists.txt +37 -0
- package/native/vendor/microtex/platform/qt/graphic_qt.cpp +355 -0
- package/native/vendor/microtex/platform/qt/graphic_qt.h +116 -0
- package/native/vendor/microtex/platform/qt/meson.build +38 -0
- package/native/vendor/microtex/platform/qt/microtex-qtConfig.cmake.in +7 -0
- package/native/vendor/microtex/platform/skia/CMakeLists.txt +46 -0
- package/native/vendor/microtex/platform/skia/graphic_skia.cpp +306 -0
- package/native/vendor/microtex/platform/skia/graphic_skia.h +125 -0
- package/native/vendor/microtex/platform/skia/microtex-skiaConfig.cmake.in +6 -0
- package/native/vendor/microtex/platform/wasm/CMakeLists.txt +38 -0
- package/native/vendor/microtex/platform/wasm/emscripten.cross +31 -0
- package/native/vendor/microtex/platform/wasm/main.cpp +15 -0
- package/native/vendor/microtex/platform/wasm/meson.build +8 -0
- package/native/vendor/microtex/platform/wasm/prebuild-example-meson.sh +21 -0
- package/native/vendor/microtex/platform/wasm/prebuild-example.sh +21 -0
- package/native/vendor/microtex/platform/wasm/prebuild-lib-meson.sh +28 -0
- package/native/vendor/microtex/platform/wasm/prebuild-lib.sh +31 -0
- package/native/vendor/microtex/platform/wasm/web/.babelrc +10 -0
- package/native/vendor/microtex/platform/wasm/web/example/examples.js +43 -0
- package/native/vendor/microtex/platform/wasm/web/example/hello.js +31 -0
- package/native/vendor/microtex/platform/wasm/web/example/index.html +55 -0
- package/native/vendor/microtex/platform/wasm/web/example/index.js +243 -0
- package/native/vendor/microtex/platform/wasm/web/example/styles.css +86 -0
- package/native/vendor/microtex/platform/wasm/web/example/utils.js +47 -0
- package/native/vendor/microtex/platform/wasm/web/lib/context.js +271 -0
- package/native/vendor/microtex/platform/wasm/web/lib/index.js +10 -0
- package/native/vendor/microtex/platform/wasm/web/lib/render.js +293 -0
- package/native/vendor/microtex/platform/wasm/web/lib/runtime.js +14 -0
- package/native/vendor/microtex/platform/wasm/web/lib/svg.js +237 -0
- package/native/vendor/microtex/platform/wasm/web/lib/textlayout.js +88 -0
- package/native/vendor/microtex/platform/wasm/web/package-lock.json +5931 -0
- package/native/vendor/microtex/platform/wasm/web/package.json +45 -0
- package/native/vendor/microtex/platform/wasm/web/publish-example.sh +17 -0
- package/native/vendor/microtex/platform/wasm/web/rollup.config.example.js +24 -0
- package/native/vendor/microtex/platform/wasm/web/rollup.config.lib.js +16 -0
- package/native/vendor/microtex/prebuilt/otf2clm.py +807 -0
- package/native/vendor/microtex/prebuilt/otf2clm.sh +9 -0
- package/native/vendor/microtex/prebuilt/preclms.sh +17 -0
- package/native/vendor/microtex/readme/example_bw_false.svg +680 -0
- package/native/vendor/microtex/readme/example_bw_true.svg +680 -0
- package/native/vendor/microtex/readme/example_cjk_trying.svg +54 -0
- package/native/vendor/microtex/readme/example_custom_symbols.svg +92 -0
- package/native/vendor/microtex/readme/example_debug.svg +764 -0
- package/native/vendor/microtex/readme/example_emoji.svg +199 -0
- package/native/vendor/microtex/readme/example_have_log.svg +79 -0
- package/native/vendor/microtex/readme/example_keep_trying.svg +101 -0
- package/native/vendor/microtex/readme/example_logos.svg +50 -0
- package/native/vendor/microtex/readme/example_ubuntu.png +0 -0
- package/native/vendor/microtex/readme/example_windows.png +0 -0
- package/native/vendor/microtex/readme/samples/sample_0.svg +665 -0
- package/native/vendor/microtex/readme/samples/sample_1.svg +1259 -0
- package/native/vendor/microtex/readme/samples/sample_10.svg +333 -0
- package/native/vendor/microtex/readme/samples/sample_11.svg +306 -0
- package/native/vendor/microtex/readme/samples/sample_2.svg +2461 -0
- package/native/vendor/microtex/readme/samples/sample_3.svg +2653 -0
- package/native/vendor/microtex/readme/samples/sample_4.svg +554 -0
- package/native/vendor/microtex/readme/samples/sample_5.svg +247 -0
- package/native/vendor/microtex/readme/samples/sample_6.svg +1082 -0
- package/native/vendor/microtex/readme/samples/sample_7.svg +518 -0
- package/native/vendor/microtex/readme/samples/sample_8.svg +529 -0
- package/native/vendor/microtex/readme/samples/sample_9.svg +1702 -0
- package/native/vendor/microtex/readme/samples.md +301 -0
- package/native/vendor/microtex/readme/tex_logo.svg +19 -0
- package/native/vendor/microtex/res/EXAMPLE.txt +25 -0
- package/native/vendor/microtex/res/SAMPLES.tex +946 -0
- package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm1 +0 -0
- package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm2 +0 -0
- package/native/vendor/microtex/res/firamath/FiraMath-Regular.otf +0 -0
- package/native/vendor/microtex/res/firamath/README.md +42 -0
- package/native/vendor/microtex/res/lm-math/README +92 -0
- package/native/vendor/microtex/res/lm-math/latinmodern-math.clm1 +0 -0
- package/native/vendor/microtex/res/lm-math/latinmodern-math.clm2 +0 -0
- package/native/vendor/microtex/res/lm-math/latinmodern-math.otf +0 -0
- package/native/vendor/microtex/res/tex-gyre/README-TeX-Gyre-DejaVu-Math.txt +82 -0
- package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm1 +0 -0
- package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm2 +0 -0
- package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.otf +0 -0
- package/native/vendor/microtex/res/xits/FONTLOG.txt +246 -0
- package/native/vendor/microtex/res/xits/OFL.txt +98 -0
- package/native/vendor/microtex/res/xits/README.txt +15 -0
- package/native/vendor/microtex/res/xits/XITS-Bold.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Bold.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Bold.otf +0 -0
- package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-BoldItalic.otf +0 -0
- package/native/vendor/microtex/res/xits/XITS-Italic.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Italic.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Italic.otf +0 -0
- package/native/vendor/microtex/res/xits/XITS-Regular.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Regular.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Regular.otf +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Bold.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Bold.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Bold.otf +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Regular.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Regular.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Regular.otf +0 -0
- package/native/vendor/microtex/test/clm/meson.build +10 -0
- package/native/vendor/microtex/test/clm/test_clm.cpp +140 -0
- package/native/vendor/microtex/test/env/meson.build +10 -0
- package/native/vendor/microtex/test/env/test_env.cpp +100 -0
- package/native/vendor/microtex/test/fuzzer/afl.native +20 -0
- package/native/vendor/microtex/test/fuzzer/fuzz.sh +135 -0
- package/native/vendor/microtex/test/fuzzer/fuzzer.cpp +61 -0
- package/native/vendor/microtex/test/fuzzer/generateSeed.java +33 -0
- package/native/vendor/microtex/test/fuzzer/meson.build +9 -0
- package/native/vendor/microtex/test/fuzzer/microtex.dict +3708 -0
- package/native/vendor/microtex/test/fuzzer/platform_none.cpp +100 -0
- package/native/vendor/microtex/test/has_filesystem.cpp +8 -0
- package/native/vendor/microtex/test/meson.build +6 -0
- package/native/vendor/nanosvg.h +3278 -0
- package/native/vendor/nanosvgrast.h +1472 -0
- package/native/vendor/zigtex/.github/assets/example.svg +27 -0
- package/native/vendor/zigtex/LICENSE +674 -0
- package/native/vendor/zigtex/README.md +52 -0
- package/native/vendor/zigtex/build.zig +52 -0
- package/native/vendor/zigtex/build.zig.zon +16 -0
- package/native/vendor/zigtex/fonts/latinmodern-math.clm2 +0 -0
- package/native/vendor/zigtex/src/main.zig +22 -0
- package/native/vendor/zigtex/src/root.zig +124 -0
- package/native/vendor/zigtex/src/svg.zig +273 -0
- package/native/vendor/zigtex/src/tex.zig +383 -0
- package/native/zigtex-0.16.patch +35 -0
- package/package.json +27 -0
- package/scripts/bootstrap-native +89 -0
package/LICENSE-PROJECT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenTUI Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/build.zig
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const std = @import("std");
|
|
2
|
+
const builtin = @import("builtin");
|
|
3
|
+
|
|
4
|
+
const SupportedTarget = struct {
|
|
5
|
+
zig_target: []const u8,
|
|
6
|
+
output_name: []const u8,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// Keep this matrix aligned with OpenTUI's published native packages.
|
|
10
|
+
const supported_targets = [_]SupportedTarget{
|
|
11
|
+
.{ .zig_target = "x86_64-linux-gnu.2.17", .output_name = "x86_64-linux" },
|
|
12
|
+
.{ .zig_target = "aarch64-linux-gnu.2.17", .output_name = "aarch64-linux" },
|
|
13
|
+
.{ .zig_target = "x86_64-linux-musl", .output_name = "x86_64-linux-musl" },
|
|
14
|
+
.{ .zig_target = "aarch64-linux-musl", .output_name = "aarch64-linux-musl" },
|
|
15
|
+
.{ .zig_target = "x86_64-macos.13.0", .output_name = "x86_64-macos" },
|
|
16
|
+
.{ .zig_target = "aarch64-macos.13.0", .output_name = "aarch64-macos" },
|
|
17
|
+
.{ .zig_target = "x86_64-windows-gnu", .output_name = "x86_64-windows" },
|
|
18
|
+
.{ .zig_target = "aarch64-windows-gnu", .output_name = "aarch64-windows" },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
pub fn build(b: *std.Build) void {
|
|
22
|
+
const optimize = b.standardOptimizeOption(.{});
|
|
23
|
+
const target_option = b.option([]const u8, "target", "Build one supported Zig target");
|
|
24
|
+
const build_all = b.option(bool, "all", "Build all published native targets") orelse false;
|
|
25
|
+
addTests(b, optimize) catch @panic("failed to configure native tests");
|
|
26
|
+
|
|
27
|
+
if (target_option != null and build_all) {
|
|
28
|
+
std.debug.print("-Dtarget and -Dall cannot be used together\n", .{});
|
|
29
|
+
std.process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (target_option) |target_name| {
|
|
33
|
+
for (supported_targets) |target| {
|
|
34
|
+
if (std.mem.eql(u8, target.zig_target, target_name)) {
|
|
35
|
+
addLibrary(b, target, optimize) catch @panic("failed to configure native target");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
std.debug.print("unsupported native target: {s}\n", .{target_name});
|
|
40
|
+
std.process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (build_all) {
|
|
44
|
+
for (supported_targets) |target| {
|
|
45
|
+
addLibrary(b, target, optimize) catch @panic("failed to configure native target");
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const host_arch = @tagName(builtin.cpu.arch);
|
|
51
|
+
const host_os = @tagName(builtin.os.tag);
|
|
52
|
+
for (supported_targets) |target| {
|
|
53
|
+
if (std.mem.find(u8, target.zig_target, host_arch) != null and
|
|
54
|
+
std.mem.find(u8, target.zig_target, host_os) != null and
|
|
55
|
+
std.mem.find(u8, target.zig_target, "musl") == null)
|
|
56
|
+
{
|
|
57
|
+
addLibrary(b, target, optimize) catch @panic("failed to configure host target");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
std.debug.print("unsupported host: {s}-{s}\n", .{ host_arch, host_os });
|
|
63
|
+
std.process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
fn addTests(b: *std.Build, optimize: std.builtin.OptimizeMode) !void {
|
|
67
|
+
const test_target = if (builtin.os.tag == .linux)
|
|
68
|
+
try std.Target.Query.parse(.{ .arch_os_abi = try std.fmt.allocPrint(b.allocator, "{s}-linux-musl", .{@tagName(builtin.cpu.arch)}) })
|
|
69
|
+
else
|
|
70
|
+
std.Target.Query{};
|
|
71
|
+
const target = b.resolveTargetQuery(test_target);
|
|
72
|
+
const module = nativeModule(b, target, optimize);
|
|
73
|
+
const tests = b.addTest(.{ .root_module = module });
|
|
74
|
+
const run_tests = b.addRunArtifact(tests);
|
|
75
|
+
b.step("test", "Run native renderer tests").dependOn(&run_tests.step);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
fn addLibrary(
|
|
79
|
+
b: *std.Build,
|
|
80
|
+
supported_target: SupportedTarget,
|
|
81
|
+
optimize: std.builtin.OptimizeMode,
|
|
82
|
+
) !void {
|
|
83
|
+
const query = try std.Target.Query.parse(.{ .arch_os_abi = supported_target.zig_target });
|
|
84
|
+
const target = b.resolveTargetQuery(query);
|
|
85
|
+
const module = nativeModule(b, target, optimize);
|
|
86
|
+
|
|
87
|
+
const library = b.addLibrary(.{
|
|
88
|
+
.name = "tex_renderer",
|
|
89
|
+
.linkage = .dynamic,
|
|
90
|
+
.root_module = module,
|
|
91
|
+
});
|
|
92
|
+
const install = b.addInstallArtifact(library, .{
|
|
93
|
+
.dest_dir = .{ .override = .{
|
|
94
|
+
.custom = try std.fmt.allocPrint(b.allocator, "lib/{s}", .{supported_target.output_name}),
|
|
95
|
+
} },
|
|
96
|
+
});
|
|
97
|
+
b.getInstallStep().dependOn(&install.step);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
fn nativeModule(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Module {
|
|
101
|
+
const zigtex = b.dependency("zigtex", .{ .target = target, .optimize = optimize });
|
|
102
|
+
const module = b.createModule(.{
|
|
103
|
+
.root_source_file = b.path("native/lib.zig"),
|
|
104
|
+
.target = target,
|
|
105
|
+
.optimize = optimize,
|
|
106
|
+
});
|
|
107
|
+
module.addImport("zigtex", zigtex.module("zigtex"));
|
|
108
|
+
module.addIncludePath(b.path("native/vendor"));
|
|
109
|
+
module.addCSourceFile(.{ .file = b.path("native/nanosvg.c"), .flags = &.{"-std=c99"} });
|
|
110
|
+
module.link_libc = true;
|
|
111
|
+
return module;
|
|
112
|
+
}
|
package/build.zig.zon
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.{
|
|
2
|
+
.name = .latex_renderer,
|
|
3
|
+
.fingerprint = 0x7ef7d1d7f7d59666,
|
|
4
|
+
.version = "0.1.0",
|
|
5
|
+
.minimum_zig_version = "0.16.0",
|
|
6
|
+
.dependencies = .{
|
|
7
|
+
.zigtex = .{
|
|
8
|
+
.path = "native/vendor/zigtex",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
.paths = .{ "build.zig", "build.zig.zon", "native" },
|
|
12
|
+
}
|
package/native/lib.zig
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
const std = @import("std");
|
|
2
|
+
const builtin = @import("builtin");
|
|
3
|
+
const zigtex = @import("zigtex");
|
|
4
|
+
|
|
5
|
+
const c = @cImport({
|
|
6
|
+
@cInclude("nanosvg.h");
|
|
7
|
+
@cInclude("nanosvgrast.h");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const source_size_max = 4096;
|
|
11
|
+
const dimension_max = 4096;
|
|
12
|
+
const supersample = 4;
|
|
13
|
+
const channels = 4;
|
|
14
|
+
|
|
15
|
+
const Status = enum(u32) {
|
|
16
|
+
ok = 0,
|
|
17
|
+
invalid_argument = 1,
|
|
18
|
+
invalid_tex = 2,
|
|
19
|
+
invalid_svg = 3,
|
|
20
|
+
invalid_dimensions = 4,
|
|
21
|
+
out_of_memory = 5,
|
|
22
|
+
internal_error = 6,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const RenderResult = struct {
|
|
26
|
+
pixels: []u8 = &.{},
|
|
27
|
+
width: u32 = 0,
|
|
28
|
+
height: u32 = 0,
|
|
29
|
+
status: Status = .ok,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var renderer_instance: ?zigtex.TexSvgRender = null;
|
|
33
|
+
var test_fail_after_pixel_allocation = false;
|
|
34
|
+
var test_pixel_allocations: usize = 0;
|
|
35
|
+
|
|
36
|
+
export fn texInit() u32 {
|
|
37
|
+
if (renderer_instance != null) return @intFromEnum(Status.ok);
|
|
38
|
+
renderer_instance = zigtex.TexSvgRender.init(std.heap.c_allocator, .{}) catch |err| {
|
|
39
|
+
return @intFromEnum(statusFromError(err));
|
|
40
|
+
};
|
|
41
|
+
return @intFromEnum(Status.ok);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export fn texRender(
|
|
45
|
+
source_ptr: ?[*]const u8,
|
|
46
|
+
source_length: u32,
|
|
47
|
+
display_value: u8,
|
|
48
|
+
foreground_ptr: ?[*]const u8,
|
|
49
|
+
background_ptr: ?[*]const u8,
|
|
50
|
+
) ?*RenderResult {
|
|
51
|
+
const result = std.heap.c_allocator.create(RenderResult) catch return null;
|
|
52
|
+
result.* = .{};
|
|
53
|
+
|
|
54
|
+
if (source_ptr == null or source_length == 0 or source_length > source_size_max) {
|
|
55
|
+
result.status = .invalid_argument;
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
if (foreground_ptr == null or background_ptr == null) {
|
|
59
|
+
result.status = .invalid_argument;
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const source = source_ptr.?[0..source_length];
|
|
64
|
+
const foreground = foreground_ptr.?[0..3].*;
|
|
65
|
+
const background = background_ptr.?[0..3].*;
|
|
66
|
+
|
|
67
|
+
if (renderer_instance == null) {
|
|
68
|
+
result.status = .internal_error;
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
if (display_value > 1) {
|
|
72
|
+
result.status = .invalid_argument;
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
render(result, source, display_value == 1, foreground, background) catch |err| {
|
|
76
|
+
result.status = statusFromError(err);
|
|
77
|
+
};
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export fn texResultStatus(result: ?*const RenderResult) u32 {
|
|
82
|
+
return if (result) |value| @intFromEnum(value.status) else @intFromEnum(Status.invalid_argument);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export fn texResultPixels(result: ?*const RenderResult) ?[*]const u8 {
|
|
86
|
+
const value = result orelse return null;
|
|
87
|
+
return if (value.pixels.len == 0) null else value.pixels.ptr;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export fn texResultPixelsLength(result: ?*const RenderResult) u32 {
|
|
91
|
+
const value = result orelse return 0;
|
|
92
|
+
const pixel_count = std.math.mul(u32, value.width, value.height) catch return 0;
|
|
93
|
+
return std.math.mul(u32, pixel_count, channels) catch 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export fn texResultWidth(result: ?*const RenderResult) u32 {
|
|
97
|
+
return if (result) |value| value.width else 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export fn texResultHeight(result: ?*const RenderResult) u32 {
|
|
101
|
+
return if (result) |value| value.height else 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export fn texResultDestroy(result: ?*RenderResult) void {
|
|
105
|
+
const value = result orelse return;
|
|
106
|
+
freeResultPixels(value.pixels);
|
|
107
|
+
std.heap.c_allocator.destroy(value);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
fn render(
|
|
111
|
+
result: *RenderResult,
|
|
112
|
+
source: []const u8,
|
|
113
|
+
display: bool,
|
|
114
|
+
foreground: [3]u8,
|
|
115
|
+
background: [3]u8,
|
|
116
|
+
) !void {
|
|
117
|
+
var arena = std.heap.ArenaAllocator.init(std.heap.c_allocator);
|
|
118
|
+
defer arena.deinit();
|
|
119
|
+
const allocator = arena.allocator();
|
|
120
|
+
|
|
121
|
+
var foreground_buffer: [7]u8 = undefined;
|
|
122
|
+
const foreground_css = try std.fmt.bufPrint(
|
|
123
|
+
&foreground_buffer,
|
|
124
|
+
"#{x:0>2}{x:0>2}{x:0>2}",
|
|
125
|
+
.{ foreground[0], foreground[1], foreground[2] },
|
|
126
|
+
);
|
|
127
|
+
const renderer = &(renderer_instance orelse return error.InternalError);
|
|
128
|
+
const svg = renderer.parseRender(allocator, source, .{
|
|
129
|
+
.size = 28,
|
|
130
|
+
.spacing = 8,
|
|
131
|
+
.style = if (display) .display else .in_line,
|
|
132
|
+
.x_pad = 3,
|
|
133
|
+
.y_pad = 3,
|
|
134
|
+
.default_color = foreground_css,
|
|
135
|
+
}) catch return error.InvalidTex;
|
|
136
|
+
|
|
137
|
+
const mutable_svg = try svgWithoutDescription(allocator, svg);
|
|
138
|
+
const image = c.nsvgParse(mutable_svg.ptr, "px", 96) orelse return error.InvalidSvg;
|
|
139
|
+
defer c.nsvgDelete(image);
|
|
140
|
+
const width: usize = @intFromFloat(@ceil(image.*.width * supersample));
|
|
141
|
+
const height: usize = @intFromFloat(@ceil(image.*.height * supersample));
|
|
142
|
+
if (width == 0 or height == 0 or width > dimension_max or height > dimension_max) {
|
|
143
|
+
return error.InvalidDimensions;
|
|
144
|
+
}
|
|
145
|
+
const pixel_length = std.math.mul(usize, width, height) catch return error.InvalidDimensions;
|
|
146
|
+
const pixels_length = std.math.mul(usize, pixel_length, channels) catch return error.InvalidDimensions;
|
|
147
|
+
if (pixels_length > std.math.maxInt(u32)) return error.InvalidDimensions;
|
|
148
|
+
const pixels = try allocResultPixels(pixels_length);
|
|
149
|
+
errdefer freeResultPixels(pixels);
|
|
150
|
+
if (builtin.is_test and test_fail_after_pixel_allocation) return error.OutOfMemory;
|
|
151
|
+
const rasterizer = c.nsvgCreateRasterizer() orelse return error.OutOfMemory;
|
|
152
|
+
defer c.nsvgDeleteRasterizer(rasterizer);
|
|
153
|
+
c.nsvgRasterize(
|
|
154
|
+
rasterizer,
|
|
155
|
+
image,
|
|
156
|
+
0,
|
|
157
|
+
0,
|
|
158
|
+
supersample,
|
|
159
|
+
pixels.ptr,
|
|
160
|
+
@intCast(width),
|
|
161
|
+
@intCast(height),
|
|
162
|
+
@intCast(width * channels),
|
|
163
|
+
);
|
|
164
|
+
compositeBackground(pixels, background);
|
|
165
|
+
|
|
166
|
+
result.pixels = pixels;
|
|
167
|
+
result.width = @intCast(width);
|
|
168
|
+
result.height = @intCast(height);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
fn allocResultPixels(length: usize) ![]u8 {
|
|
172
|
+
const pixels = try std.heap.c_allocator.alloc(u8, length);
|
|
173
|
+
if (builtin.is_test) test_pixel_allocations += 1;
|
|
174
|
+
return pixels;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
fn freeResultPixels(pixels: []u8) void {
|
|
178
|
+
if (pixels.len == 0) return;
|
|
179
|
+
std.heap.c_allocator.free(pixels);
|
|
180
|
+
if (builtin.is_test) {
|
|
181
|
+
std.debug.assert(test_pixel_allocations > 0);
|
|
182
|
+
test_pixel_allocations -= 1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
fn statusFromError(err: anyerror) Status {
|
|
187
|
+
return switch (err) {
|
|
188
|
+
error.InvalidTex => .invalid_tex,
|
|
189
|
+
error.InvalidSvg => .invalid_svg,
|
|
190
|
+
error.InvalidDimensions => .invalid_dimensions,
|
|
191
|
+
error.OutOfMemory => .out_of_memory,
|
|
192
|
+
else => .internal_error,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
fn compositeBackground(pixels: []u8, background: [3]u8) void {
|
|
197
|
+
var offset: usize = 0;
|
|
198
|
+
while (offset < pixels.len) : (offset += channels) {
|
|
199
|
+
const alpha: u16 = pixels[offset + 3];
|
|
200
|
+
const inverse = 255 - alpha;
|
|
201
|
+
inline for (0..3) |channel| {
|
|
202
|
+
pixels[offset + channel] = @intCast(
|
|
203
|
+
(@as(u16, pixels[offset + channel]) * alpha +
|
|
204
|
+
@as(u16, background[channel]) * inverse + 127) / 255,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
pixels[offset + 3] = 255;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
fn svgWithoutDescription(allocator: std.mem.Allocator, svg: []const u8) ![:0]u8 {
|
|
212
|
+
const start = std.mem.indexOf(u8, svg, "<desc>") orelse return allocator.dupeZ(u8, svg);
|
|
213
|
+
const close = std.mem.lastIndexOf(u8, svg, "</desc>") orelse return error.InvalidSvg;
|
|
214
|
+
if (close < start) return error.InvalidSvg;
|
|
215
|
+
var cleaned = try std.ArrayList(u8).initCapacity(allocator, svg.len - (close + 7 - start));
|
|
216
|
+
defer cleaned.deinit(allocator);
|
|
217
|
+
try cleaned.appendSlice(allocator, svg[0..start]);
|
|
218
|
+
try cleaned.appendSlice(allocator, svg[close + 7 ..]);
|
|
219
|
+
return allocator.dupeZ(u8, cleaned.items);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
fn renderForTest(source: []const u8, foreground: *const [3]u8, background: *const [3]u8) !*RenderResult {
|
|
223
|
+
if (texInit() != @intFromEnum(Status.ok)) return error.InitializationFailed;
|
|
224
|
+
return texRender(source.ptr, @intCast(source.len), 0, foreground, background) orelse error.OutOfMemory;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
test "render result contains bounded opaque RGBA pixels" {
|
|
228
|
+
const foreground = [3]u8{ 255, 255, 255 };
|
|
229
|
+
const background = [3]u8{ 1, 2, 3 };
|
|
230
|
+
const result = try renderForTest("x", &foreground, &background);
|
|
231
|
+
defer texResultDestroy(result);
|
|
232
|
+
|
|
233
|
+
try std.testing.expectEqual(@as(u32, @intFromEnum(Status.ok)), texResultStatus(result));
|
|
234
|
+
try std.testing.expect(result.width > 0 and result.width <= dimension_max);
|
|
235
|
+
try std.testing.expect(result.height > 0 and result.height <= dimension_max);
|
|
236
|
+
const expected_length = result.width * result.height * channels;
|
|
237
|
+
try std.testing.expectEqual(expected_length, texResultPixelsLength(result));
|
|
238
|
+
try std.testing.expectEqual(@as(usize, expected_length), result.pixels.len);
|
|
239
|
+
try std.testing.expect(texResultPixels(result) != null);
|
|
240
|
+
|
|
241
|
+
var contains_foreground = false;
|
|
242
|
+
var offset: usize = 0;
|
|
243
|
+
while (offset < result.pixels.len) : (offset += channels) {
|
|
244
|
+
try std.testing.expectEqual(@as(u8, 255), result.pixels[offset + 3]);
|
|
245
|
+
contains_foreground = contains_foreground or !std.mem.eql(u8, result.pixels[offset .. offset + 3], &background);
|
|
246
|
+
}
|
|
247
|
+
try std.testing.expect(contains_foreground);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
test "texResultDestroy frees successful result pixels" {
|
|
251
|
+
const foreground = [3]u8{ 255, 255, 255 };
|
|
252
|
+
const background = [3]u8{ 0, 0, 0 };
|
|
253
|
+
const allocations_before = test_pixel_allocations;
|
|
254
|
+
const result = try renderForTest("y", &foreground, &background);
|
|
255
|
+
try std.testing.expectEqual(allocations_before + 1, test_pixel_allocations);
|
|
256
|
+
texResultDestroy(result);
|
|
257
|
+
try std.testing.expectEqual(allocations_before, test_pixel_allocations);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
test "render frees result pixels after a partial failure" {
|
|
261
|
+
const foreground = [3]u8{ 255, 255, 255 };
|
|
262
|
+
const background = [3]u8{ 0, 0, 0 };
|
|
263
|
+
const allocations_before = test_pixel_allocations;
|
|
264
|
+
test_fail_after_pixel_allocation = true;
|
|
265
|
+
defer test_fail_after_pixel_allocation = false;
|
|
266
|
+
const result = try renderForTest("z", &foreground, &background);
|
|
267
|
+
defer texResultDestroy(result);
|
|
268
|
+
|
|
269
|
+
try std.testing.expectEqual(@as(u32, @intFromEnum(Status.out_of_memory)), texResultStatus(result));
|
|
270
|
+
try std.testing.expectEqual(allocations_before, test_pixel_allocations);
|
|
271
|
+
try std.testing.expectEqual(@as(u32, 0), texResultPixelsLength(result));
|
|
272
|
+
try std.testing.expect(texResultPixels(result) == null);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
test "maximum result dimensions and ABI pixel length are bounded" {
|
|
276
|
+
try std.testing.expect(dimension_max <= std.math.maxInt(u32));
|
|
277
|
+
const pixel_count_max = try std.math.mul(u32, dimension_max, dimension_max);
|
|
278
|
+
const pixel_length_max = try std.math.mul(u32, pixel_count_max, channels);
|
|
279
|
+
try std.testing.expect(pixel_length_max <= std.math.maxInt(u32));
|
|
280
|
+
}
|
package/native/nanosvg.c
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
zigtex=fda2819e45f57ca2071810c47249a46bfc782cdf microtex=74e8fee9e47edc3a777e64fb2eff9a85a01defac nanosvg=239e102ec2c691f2902e20ace2ed36ee4a35cfe6 zig=0.16-v5
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Copyright (c) 2013-14 Mikko Mononen memon@inside.org
|
|
2
|
+
|
|
3
|
+
This software is provided 'as-is', without any express or implied
|
|
4
|
+
warranty. In no event will the authors be held liable for any damages
|
|
5
|
+
arising from the use of this software.
|
|
6
|
+
|
|
7
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
8
|
+
including commercial applications, and to alter it and redistribute it
|
|
9
|
+
freely, subject to the following restrictions:
|
|
10
|
+
|
|
11
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
12
|
+
claim that you wrote the original software. If you use this software
|
|
13
|
+
in a product, an acknowledgment in the product documentation would be
|
|
14
|
+
appreciated but is not required.
|
|
15
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
16
|
+
misrepresented as being the original software.
|
|
17
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
18
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
BasedOnStyle: Google
|
|
2
|
+
ColumnLimit: 100
|
|
3
|
+
IndentWidth: 2
|
|
4
|
+
ContinuationIndentWidth: 2
|
|
5
|
+
AccessModifierOffset: -2
|
|
6
|
+
|
|
7
|
+
AllowShortBlocksOnASingleLine: Empty
|
|
8
|
+
AllowShortIfStatementsOnASingleLine: true
|
|
9
|
+
AllowShortCaseLabelsOnASingleLine: true
|
|
10
|
+
AllowShortLoopsOnASingleLine: true
|
|
11
|
+
AllowShortFunctionsOnASingleLine: Inline
|
|
12
|
+
|
|
13
|
+
AlignAfterOpenBracket: BlockIndent
|
|
14
|
+
BinPackArguments: false
|
|
15
|
+
BinPackParameters: false
|
|
16
|
+
AllowAllParametersOfDeclarationOnNextLine: false
|
|
17
|
+
AllowAllArgumentsOnNextLine: false
|
|
18
|
+
ReflowComments: true
|
|
19
|
+
|
|
20
|
+
AlignTrailingComments: true
|
|
21
|
+
BreakBeforeBinaryOperators: NonAssignment
|
|
22
|
+
|
|
23
|
+
AlignArrayOfStructures: Left
|
|
24
|
+
|
|
25
|
+
PenaltyBreakAssignment: 20
|
|
26
|
+
PenaltyBreakBeforeFirstCallParameter: 0
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
name: Ubuntu
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- pull_request
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build_by_meson:
|
|
8
|
+
runs-on: ${{ matrix.os }}
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
os:
|
|
12
|
+
- ubuntu-22.04
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v2
|
|
15
|
+
- name: Downloading dependencies 📥
|
|
16
|
+
run: |
|
|
17
|
+
sudo apt-get install build-essential meson libgtksourceviewmm-3.0-dev libgtkmm-3.0-dev libgtk-4-dev libgtksourceview-5-dev gi-docgen
|
|
18
|
+
sudo apt-get install qtbase5-dev qttools5-dev-tools
|
|
19
|
+
- name: Configure 🔧
|
|
20
|
+
run: meson _build -DTARGET_DOCUMENTATION=true
|
|
21
|
+
- name: Compile 🎲
|
|
22
|
+
run: ninja -C _build
|
|
23
|
+
- name: Compress build artifacts 📦
|
|
24
|
+
run: |
|
|
25
|
+
pushd _build
|
|
26
|
+
tar -c * | zstd -o $GITHUB_WORKSPACE/artifacts.tar.zst
|
|
27
|
+
popd
|
|
28
|
+
- name: Upload build artifacts 📤
|
|
29
|
+
uses: actions/upload-artifact@v1
|
|
30
|
+
with:
|
|
31
|
+
name: Build artifacts
|
|
32
|
+
path: artifacts.tar.zst
|
|
33
|
+
|
|
34
|
+
build_by_cmake:
|
|
35
|
+
runs-on: ${{ matrix.os }}
|
|
36
|
+
strategy:
|
|
37
|
+
matrix:
|
|
38
|
+
os:
|
|
39
|
+
- ubuntu-22.04
|
|
40
|
+
steps:
|
|
41
|
+
- name: Downloading Source Code 📥
|
|
42
|
+
uses: actions/checkout@v2
|
|
43
|
+
- name: Downloading dependencies 📥
|
|
44
|
+
run: |
|
|
45
|
+
sudo apt-get install build-essential meson libgtksourceviewmm-3.0-dev libgtkmm-3.0-dev libgtk-4-dev libgtksourceview-5-dev
|
|
46
|
+
sudo apt-get install qtbase5-dev qttools5-dev-tools
|
|
47
|
+
- name: Configure 🔧
|
|
48
|
+
run: |
|
|
49
|
+
cd ${{ github.workspace }}
|
|
50
|
+
mkdir build
|
|
51
|
+
cd build
|
|
52
|
+
cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_AUTO_FONT_FIND=ON -DCAIRO=ON -DBUILD_EXAMPLE_GTKMM=ON -DGTK=ON -DBUILD_EXAMPLE_GTK=ON -DQT=ON -DBUILD_EXAMPLE_QT=ON -DBUILD_EXAMPLE_QTPNG=ON -DBUILD_EXAMPLE_MEMCHECK=ON -DWASM=OFF -DHAVE_LOG=ON -G Ninja
|
|
53
|
+
- name: Compile 🎲
|
|
54
|
+
run: |
|
|
55
|
+
cd ${{ github.workspace }}
|
|
56
|
+
cd build
|
|
57
|
+
ninja
|
|
58
|
+
|
|
59
|
+
build_wasm:
|
|
60
|
+
runs-on: ${{ matrix.os }}
|
|
61
|
+
strategy:
|
|
62
|
+
matrix:
|
|
63
|
+
os:
|
|
64
|
+
- ubuntu-20.04
|
|
65
|
+
steps:
|
|
66
|
+
- name: Downloading Source Code 📥
|
|
67
|
+
uses: actions/checkout@v2
|
|
68
|
+
- name: Downloading dependencies 📥
|
|
69
|
+
run: |
|
|
70
|
+
sudo apt-get install ninja-build
|
|
71
|
+
sudo pip3 install meson # meson provided by ubuntu is too old. can be removed when ubunut-latest swiches to 24.04
|
|
72
|
+
- name: Setup Emscripten Environment 🍺
|
|
73
|
+
uses: mymindstorm/setup-emsdk@v11
|
|
74
|
+
- name: Verify Emscripten 🚀
|
|
75
|
+
run: emcc -v
|
|
76
|
+
- name: Compile using CMake 🎲
|
|
77
|
+
run: |
|
|
78
|
+
cd ${{ github.workspace }}
|
|
79
|
+
cd platform/wasm/web
|
|
80
|
+
npm install
|
|
81
|
+
npm run build:lib && npm run build:example
|
|
82
|
+
- name: Compile using Meson 🎲
|
|
83
|
+
run: |
|
|
84
|
+
cd ${{ github.workspace }}
|
|
85
|
+
cd platform/wasm/web
|
|
86
|
+
npm install
|
|
87
|
+
npm run build:lib:meson && npm run build:example:meson
|
|
88
|
+
- name: Upload build artifacts 📤
|
|
89
|
+
uses: actions/upload-artifact@v1
|
|
90
|
+
with:
|
|
91
|
+
name: MicroTeX wasm example
|
|
92
|
+
path: platform/wasm/web/example-dist
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Windows GDI+
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- pull_request
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ${{ matrix.os }}
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
os:
|
|
12
|
+
- windows-2019
|
|
13
|
+
steps:
|
|
14
|
+
- name: Downloading Source Code 📥
|
|
15
|
+
uses: actions/checkout@v2
|
|
16
|
+
- name: Downloading CMake 📥
|
|
17
|
+
# Install latest CMake.
|
|
18
|
+
uses: lukka/get-cmake@latest
|
|
19
|
+
- name: Setup Environment (x64)
|
|
20
|
+
uses: ilammy/msvc-dev-cmd@v1
|
|
21
|
+
if: runner.os == 'Windows'
|
|
22
|
+
with:
|
|
23
|
+
arch: x64
|
|
24
|
+
- name: Configure 🔧
|
|
25
|
+
run: |
|
|
26
|
+
cd ${{ github.workspace }}
|
|
27
|
+
mkdir build -force
|
|
28
|
+
cd build
|
|
29
|
+
cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_AUTO_FONT_FIND=OFF -DGDI=ON -DBUILD_EXAMPLE_WIN32=ON -G Ninja
|
|
30
|
+
- name: Compile 🎲
|
|
31
|
+
run: |
|
|
32
|
+
cd ${{ github.workspace }}
|
|
33
|
+
cd build
|
|
34
|
+
ninja
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Windows Qt
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
- pull_request
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ${{ matrix.os }}
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
os:
|
|
12
|
+
- windows-2019
|
|
13
|
+
include:
|
|
14
|
+
- qt_ver: 5.15.2
|
|
15
|
+
qt_arch: win64_msvc2019_64
|
|
16
|
+
msvc_arch: x64
|
|
17
|
+
qt_arch_install: msvc2019_64
|
|
18
|
+
- qt_ver: 6.0.0
|
|
19
|
+
qt_arch: win64_msvc2019_64
|
|
20
|
+
msvc_arch: x64
|
|
21
|
+
qt_arch_install: msvc2019_64
|
|
22
|
+
steps:
|
|
23
|
+
- name: Downloading Source Code 📥
|
|
24
|
+
uses: actions/checkout@v2
|
|
25
|
+
- name: Downloading CMake 📥
|
|
26
|
+
# Install latest CMake.
|
|
27
|
+
uses: lukka/get-cmake@latest
|
|
28
|
+
- name: Setup Environment (x64)
|
|
29
|
+
uses: ilammy/msvc-dev-cmd@v1
|
|
30
|
+
if: runner.os == 'Windows'
|
|
31
|
+
with:
|
|
32
|
+
arch: x64
|
|
33
|
+
- name: Downloading Qt 📥
|
|
34
|
+
uses: jurplel/install-qt-action@v2.13.0
|
|
35
|
+
with:
|
|
36
|
+
# Version of Qt to install
|
|
37
|
+
version: ${{ matrix.qt_ver }}
|
|
38
|
+
# Target platform for build
|
|
39
|
+
# target: ${{ matrix.qt_target }}
|
|
40
|
+
arch: ${{ matrix.qt_arch }}
|
|
41
|
+
cached: 'false'
|
|
42
|
+
- name: Configure 🔧
|
|
43
|
+
run: |
|
|
44
|
+
cd ${{ github.workspace }}
|
|
45
|
+
mkdir build -force
|
|
46
|
+
cd build
|
|
47
|
+
cmake .. -DHAVE_AUTO_FONT_FIND=OFF -DQT=ON -DBUILD_EXAMPLE_QT=ON -DCMAKE_BUILD_TYPE=Release -G Ninja
|
|
48
|
+
- name: Compile 🎲
|
|
49
|
+
run: |
|
|
50
|
+
cd ${{ github.workspace }}
|
|
51
|
+
cd build
|
|
52
|
+
ninja
|