@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
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
const std = @import("std");
|
|
2
|
+
pub const c = @cImport({
|
|
3
|
+
@cDefine("HAVE_CWRAPPER", "");
|
|
4
|
+
@cInclude("stdbool.h");
|
|
5
|
+
@cInclude("wrapper/cwrapper.h");
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
pub const FontDescription = struct {
|
|
9
|
+
f: *c.FontDesc,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
pub const TextLayoutBounds = struct {
|
|
13
|
+
b: *c.TextLayoutBounds,
|
|
14
|
+
|
|
15
|
+
pub fn setBounds(
|
|
16
|
+
self: TextLayoutBounds,
|
|
17
|
+
width: f32,
|
|
18
|
+
height: f32,
|
|
19
|
+
ascent: f32,
|
|
20
|
+
) void {
|
|
21
|
+
c.microtex_setTextLayoutBounds(
|
|
22
|
+
self.b,
|
|
23
|
+
width,
|
|
24
|
+
height,
|
|
25
|
+
ascent,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
pub const MicroTeX = struct {
|
|
31
|
+
const Self = @This();
|
|
32
|
+
allocator: std.mem.Allocator,
|
|
33
|
+
clm_data: []const u8,
|
|
34
|
+
font_meta: c.FontMetaPtr,
|
|
35
|
+
|
|
36
|
+
var ctx: *anyopaque = undefined;
|
|
37
|
+
|
|
38
|
+
pub fn initPath(
|
|
39
|
+
allocator: std.mem.Allocator,
|
|
40
|
+
clm_path: []const u8,
|
|
41
|
+
context: anytype,
|
|
42
|
+
) !Self {
|
|
43
|
+
const stat = try std.fs.cwd().statFile(clm_path);
|
|
44
|
+
const content = try std.fs.cwd().readFileAlloc(
|
|
45
|
+
allocator,
|
|
46
|
+
clm_path,
|
|
47
|
+
stat.size,
|
|
48
|
+
);
|
|
49
|
+
defer allocator.free(content);
|
|
50
|
+
return try init(allocator, content, context);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pub fn init(allocator: std.mem.Allocator, clm_data: []const u8, context: anytype) !Self {
|
|
54
|
+
if (c.microtex_isInited()) {
|
|
55
|
+
return error.MicroTeXAlreadyInitialized;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const Ctx = @typeInfo(@TypeOf(context)).pointer.child;
|
|
59
|
+
ctx = context;
|
|
60
|
+
|
|
61
|
+
const CallbackWrapper = struct {
|
|
62
|
+
fn createTextLayout(
|
|
63
|
+
text: [*c]const u8,
|
|
64
|
+
f: [*c]c.FontDesc,
|
|
65
|
+
) callconv(.c) c_uint {
|
|
66
|
+
const slice = std.mem.span(text);
|
|
67
|
+
const id: usize =
|
|
68
|
+
Ctx.createTextLayout(
|
|
69
|
+
@ptrCast(@alignCast(ctx)),
|
|
70
|
+
slice,
|
|
71
|
+
FontDescription{ .f = f },
|
|
72
|
+
) catch |err| {
|
|
73
|
+
std.log.default.err("createTextLayout: {t}", .{err});
|
|
74
|
+
return 0;
|
|
75
|
+
};
|
|
76
|
+
return @intCast(id);
|
|
77
|
+
}
|
|
78
|
+
fn getTextLayoutBounds(
|
|
79
|
+
id: c_uint,
|
|
80
|
+
b: [*c]c.TextLayoutBounds,
|
|
81
|
+
) callconv(.c) void {
|
|
82
|
+
Ctx.getTextLayoutBounds(
|
|
83
|
+
@ptrCast(@alignCast(ctx)),
|
|
84
|
+
@as(usize, @intCast(id)),
|
|
85
|
+
TextLayoutBounds{ .b = b },
|
|
86
|
+
) catch |err| {
|
|
87
|
+
std.log.default.err("getTextlayoutBounds: {t}", .{err});
|
|
88
|
+
return 0;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
fn releaseTextLayout(id: c_uint) callconv(.c) void {
|
|
92
|
+
Ctx.releaseTextLayout(
|
|
93
|
+
@ptrCast(@alignCast(ctx)),
|
|
94
|
+
@as(usize, @intCast(id)),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
fn isPathExists(id: c_uint) callconv(.c) bool {
|
|
98
|
+
return Ctx.isPathExists(
|
|
99
|
+
@ptrCast(@alignCast(ctx)),
|
|
100
|
+
@as(usize, @intCast(id)),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// register the callback functions
|
|
106
|
+
c.microtex_registerCallbacks(
|
|
107
|
+
CallbackWrapper.createTextLayout,
|
|
108
|
+
CallbackWrapper.getTextLayoutBounds,
|
|
109
|
+
CallbackWrapper.releaseTextLayout,
|
|
110
|
+
CallbackWrapper.isPathExists,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const content = try allocator.dupe(u8, clm_data);
|
|
114
|
+
const font_meta = c.microtex_init(@intCast(content.len), content.ptr);
|
|
115
|
+
|
|
116
|
+
const name = c.microtex_getFontName(font_meta);
|
|
117
|
+
c.microtex_setDefaultMainFont(name);
|
|
118
|
+
c.microtex_setDefaultMathFont(name);
|
|
119
|
+
|
|
120
|
+
return .{
|
|
121
|
+
.allocator = allocator,
|
|
122
|
+
.clm_data = content,
|
|
123
|
+
.font_meta = font_meta,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
pub fn deinit(self: *Self) void {
|
|
128
|
+
c.microtex_release();
|
|
129
|
+
self.allocator.free(self.clm_data);
|
|
130
|
+
self.* = undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
pub const ParseOptions = struct {
|
|
134
|
+
width: u32 = 0,
|
|
135
|
+
text_size: f32 = 20,
|
|
136
|
+
line_space: f32 = 20 / 3,
|
|
137
|
+
/// 0xAARRGGBB
|
|
138
|
+
color: u32,
|
|
139
|
+
fill_width: bool = false,
|
|
140
|
+
override_syle: bool = true,
|
|
141
|
+
style: u32 = 0,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
pub fn parseRender(
|
|
145
|
+
self: *const Self,
|
|
146
|
+
tex: [:0]const u8,
|
|
147
|
+
opts: ParseOptions,
|
|
148
|
+
) !Render {
|
|
149
|
+
_ = self;
|
|
150
|
+
const ptr = c.microtex_parseRender(
|
|
151
|
+
tex.ptr,
|
|
152
|
+
@intCast(opts.width),
|
|
153
|
+
opts.text_size,
|
|
154
|
+
opts.line_space,
|
|
155
|
+
@intCast(opts.color),
|
|
156
|
+
opts.fill_width,
|
|
157
|
+
opts.override_syle,
|
|
158
|
+
@intCast(opts.style),
|
|
159
|
+
);
|
|
160
|
+
if (ptr == null) return error.FailedToRender;
|
|
161
|
+
return .{ .ptr = ptr };
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
fn getRawDrawingData(
|
|
166
|
+
data: c.DrawingData,
|
|
167
|
+
offset: usize,
|
|
168
|
+
size: usize,
|
|
169
|
+
) []const u8 {
|
|
170
|
+
const ptr: [*]const u8 = @ptrCast(@alignCast(data.?));
|
|
171
|
+
return ptr[offset .. offset + size];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
fn getRawDrawingDataT(
|
|
175
|
+
data: c.DrawingData,
|
|
176
|
+
offset: usize,
|
|
177
|
+
comptime T: type,
|
|
178
|
+
) T {
|
|
179
|
+
const slice = getRawDrawingData(data, offset, @sizeOf(T));
|
|
180
|
+
return std.mem.bytesToValue(T, slice);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
pub const Render = struct {
|
|
184
|
+
pub const Command = union(enum(u8)) {
|
|
185
|
+
set_color: u32,
|
|
186
|
+
set_stroke: struct { width: f32, miter_limit: f32, cap: u32, join: u32 },
|
|
187
|
+
set_dash: bool,
|
|
188
|
+
set_font: []const u8,
|
|
189
|
+
set_font_size: struct { size: f32 },
|
|
190
|
+
translate: struct { x: f32, y: f32 },
|
|
191
|
+
scale: struct { x: f32, y: f32 },
|
|
192
|
+
rotate: struct { x: f32, y: f32, angle: f32 },
|
|
193
|
+
reset: void,
|
|
194
|
+
draw_glyph: struct { a1: u16, x: f32, y: f32 },
|
|
195
|
+
// returns the id
|
|
196
|
+
begin_path: i32,
|
|
197
|
+
move_to: struct { x: f32, y: f32 },
|
|
198
|
+
line_to: struct { x: f32, y: f32 },
|
|
199
|
+
cubic_to: struct { x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32 },
|
|
200
|
+
quad_to: struct { x1: f32, y1: f32, x2: f32, y2: f32 },
|
|
201
|
+
close_path: void,
|
|
202
|
+
// returns the id
|
|
203
|
+
fill_path: i32,
|
|
204
|
+
draw_line: struct { x1: f32, y1: f32, x2: f32, y2: f32 },
|
|
205
|
+
draw_rect: struct { x: f32, y: f32, width: f32, height: f32 },
|
|
206
|
+
fill_rect: struct { x: f32, y: f32, width: f32, height: f32 },
|
|
207
|
+
draw_round_rect: struct {
|
|
208
|
+
x: f32,
|
|
209
|
+
y: f32,
|
|
210
|
+
width: f32,
|
|
211
|
+
height: f32,
|
|
212
|
+
a1: f32,
|
|
213
|
+
a2: f32,
|
|
214
|
+
},
|
|
215
|
+
fill_round_rect: struct {
|
|
216
|
+
x: f32,
|
|
217
|
+
y: f32,
|
|
218
|
+
width: f32,
|
|
219
|
+
height: f32,
|
|
220
|
+
a1: f32,
|
|
221
|
+
a2: f32,
|
|
222
|
+
},
|
|
223
|
+
drawTextLayout: struct { id: u32, x: f32, y: f32 },
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
pub const DrawingData = struct {
|
|
227
|
+
// offset is already advanced because we read in the length
|
|
228
|
+
offset: usize = @sizeOf(u32),
|
|
229
|
+
data: []const u8,
|
|
230
|
+
ptr: c.DrawingData,
|
|
231
|
+
|
|
232
|
+
fn init(ptr: c.DrawingData) DrawingData {
|
|
233
|
+
const len = getRawDrawingDataT(ptr, 0, u32);
|
|
234
|
+
return .{
|
|
235
|
+
.ptr = ptr,
|
|
236
|
+
.data = getRawDrawingData(ptr, 0, len),
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
fn getSlice(self: *DrawingData, size: usize) ?[]const u8 {
|
|
241
|
+
if (self.offset + size > self.data.len) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
const s = self.data[self.offset .. self.offset + size];
|
|
245
|
+
self.offset += size;
|
|
246
|
+
return s;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
fn getT(self: *DrawingData, comptime T: type) ?T {
|
|
250
|
+
const data = self.getSlice(@sizeOf(T)) orelse
|
|
251
|
+
return null;
|
|
252
|
+
return std.mem.bytesToValue(T, data);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
fn readOp(
|
|
256
|
+
self: *DrawingData,
|
|
257
|
+
comptime op: std.meta.Tag(Command),
|
|
258
|
+
) Command {
|
|
259
|
+
const name = @tagName(op);
|
|
260
|
+
const info = @typeInfo(Command).@"union";
|
|
261
|
+
const T = comptime b: {
|
|
262
|
+
for (info.fields) |field| {
|
|
263
|
+
if (std.mem.eql(u8, field.name, name)) {
|
|
264
|
+
break :b field.type;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
@compileError("This should be unreachable");
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
var cmd: T = undefined;
|
|
271
|
+
switch (@typeInfo(T)) {
|
|
272
|
+
.@"struct" => {
|
|
273
|
+
inline for (@typeInfo(T).@"struct".fields) |field| {
|
|
274
|
+
@field(cmd, field.name) = self.getT(field.type).?;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
.int, .float => {
|
|
278
|
+
cmd = self.getT(T).?;
|
|
279
|
+
},
|
|
280
|
+
else => {},
|
|
281
|
+
}
|
|
282
|
+
return @unionInit(Command, name, cmd);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
pub fn next(self: *DrawingData) ?Command {
|
|
286
|
+
const opcode = self.getT(u8) orelse
|
|
287
|
+
return null;
|
|
288
|
+
switch (opcode) {
|
|
289
|
+
inline 0...22 => |i| {
|
|
290
|
+
const op: std.meta.Tag(Command) = @enumFromInt(i);
|
|
291
|
+
return self.readOp(op);
|
|
292
|
+
},
|
|
293
|
+
else => {
|
|
294
|
+
std.log.default.warn("Unhandled opcode: {d}\n", .{opcode});
|
|
295
|
+
},
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
ptr: c.RenderPtr,
|
|
302
|
+
drawing_data: ?DrawingData = null,
|
|
303
|
+
|
|
304
|
+
pub fn deinit(self: *Render) void {
|
|
305
|
+
if (self.drawing_data) |d| {
|
|
306
|
+
c.microtex_freeDrawingData(d.ptr);
|
|
307
|
+
}
|
|
308
|
+
c.microtex_deleteRender(self.ptr);
|
|
309
|
+
self.* = undefined;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
pub fn getDrawingData(self: *Render, x: u32, y: u32) DrawingData {
|
|
313
|
+
return self.drawing_data orelse {
|
|
314
|
+
const ptr = c.microtex_getDrawingData(
|
|
315
|
+
self.ptr,
|
|
316
|
+
@intCast(x),
|
|
317
|
+
@intCast(y),
|
|
318
|
+
);
|
|
319
|
+
self.drawing_data = DrawingData.init(ptr);
|
|
320
|
+
return self.drawing_data.?;
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
pub const FontContext = struct {
|
|
326
|
+
const FontText = struct {
|
|
327
|
+
font: FontDescription,
|
|
328
|
+
text: []const u8,
|
|
329
|
+
};
|
|
330
|
+
const FontMap = std.AutoHashMap(usize, FontText);
|
|
331
|
+
|
|
332
|
+
id: usize = 0,
|
|
333
|
+
fontmap: FontMap,
|
|
334
|
+
|
|
335
|
+
fn createTextLayout(
|
|
336
|
+
self: *FontContext,
|
|
337
|
+
text: []const u8,
|
|
338
|
+
font: FontDescription,
|
|
339
|
+
) !usize {
|
|
340
|
+
const id = self.id;
|
|
341
|
+
self.id += 1;
|
|
342
|
+
|
|
343
|
+
try self.fontmap.put(id, .{ .text = text, .font = font });
|
|
344
|
+
return id;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
fn getTextLayoutBounds(
|
|
348
|
+
self: *FontContext,
|
|
349
|
+
id: usize,
|
|
350
|
+
bounds: TextLayoutBounds,
|
|
351
|
+
) !void {
|
|
352
|
+
const value = self.fontmap.get(id).?;
|
|
353
|
+
_ = value;
|
|
354
|
+
// TODO: would need a way of measuring how big this is going to be
|
|
355
|
+
bounds.setBounds(200, 100, 10);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
fn releaseTextLayout(self: *FontContext, id: usize) void {
|
|
359
|
+
if (!self.fontmap.remove(id)) {
|
|
360
|
+
std.log.default.debug("Failed to remove text layout: {d}", .{id});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
fn isPathExists(self: *FontContext, id: usize) bool {
|
|
365
|
+
_ = self;
|
|
366
|
+
_ = id;
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
pub fn init(allocator: std.mem.Allocator) FontContext {
|
|
371
|
+
const map = FontMap.init(allocator);
|
|
372
|
+
return .{ .fontmap = map };
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
pub fn deinit(self: *FontContext) void {
|
|
376
|
+
self.fontmap.deinit();
|
|
377
|
+
self.* = undefined;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
pub fn setRenderGlyphUsePath(use: bool) void {
|
|
382
|
+
c.microtex_setRenderGlyphUsePath(use);
|
|
383
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
diff --git a/src/svg.zig b/src/svg.zig
|
|
2
|
+
--- a/src/svg.zig
|
|
3
|
+
+++ b/src/svg.zig
|
|
4
|
+
@@ -45,6 +45,7 @@ pub const Svg = struct {
|
|
5
|
+
try self.path.append(allocator, ' ');
|
|
6
|
+
}
|
|
7
|
+
- var path_writer = self.path.writer(allocator).adaptToNewApi(&.{});
|
|
8
|
+
- try path_writer.new_interface.print(fmt, args);
|
|
9
|
+
+ var path_writer = std.Io.Writer.Allocating.fromArrayList(allocator, &self.path);
|
|
10
|
+
+ defer self.path = path_writer.toArrayList();
|
|
11
|
+
+ try path_writer.writer.print(fmt, args);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
diff --git a/src/root.zig b/src/root.zig
|
|
15
|
+
--- a/src/root.zig
|
|
16
|
+
+++ b/src/root.zig
|
|
17
|
+
@@ -112,14 +112,13 @@ pub const TexSvgRender = struct {
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
- var buf = std.ArrayList(u8).empty;
|
|
22
|
+
- defer buf.deinit(allocator);
|
|
23
|
+
- var buf_writer = buf.writer(allocator).adaptToNewApi(&.{});
|
|
24
|
+
- try s.write(&buf_writer.new_interface, .{
|
|
25
|
+
+ var buf_writer: std.Io.Writer.Allocating = .init(allocator);
|
|
26
|
+
+ defer buf_writer.deinit();
|
|
27
|
+
+ try s.write(&buf_writer.writer, .{
|
|
28
|
+
.full_header = opts.full_header,
|
|
29
|
+
.svg_content = tex,
|
|
30
|
+
.class = opts.class,
|
|
31
|
+
});
|
|
32
|
+
- return buf.toOwnedSlice(allocator);
|
|
33
|
+
+ return buf_writer.toOwnedSlice();
|
|
34
|
+
}
|
|
35
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@simonklee/opentui-tex-native-source",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/simonklee/opentui-tex.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/simonklee/opentui-tex#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/simonklee/opentui-tex/issues"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"description": "Complete corresponding source for @simonklee/opentui-tex native binaries",
|
|
17
|
+
"license": "GPL-3.0-only",
|
|
18
|
+
"files": [
|
|
19
|
+
"build.zig",
|
|
20
|
+
"build.zig.zon",
|
|
21
|
+
"native",
|
|
22
|
+
"scripts",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"LICENSE-PROJECT",
|
|
25
|
+
"README.md"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
cd "$(dirname "$0")/.."
|
|
5
|
+
|
|
6
|
+
readonly vendor=native/vendor
|
|
7
|
+
readonly stamp="$vendor/.bootstrap-v5"
|
|
8
|
+
readonly stamp_value='zigtex=fda2819e45f57ca2071810c47249a46bfc782cdf microtex=74e8fee9e47edc3a777e64fb2eff9a85a01defac nanosvg=239e102ec2c691f2902e20ace2ed36ee4a35cfe6 zig=0.16-v5'
|
|
9
|
+
mkdir -p "$vendor"
|
|
10
|
+
|
|
11
|
+
download() {
|
|
12
|
+
local url=$1 output=$2
|
|
13
|
+
curl --fail --location --silent --show-error --retry 3 --retry-all-errors \
|
|
14
|
+
--connect-timeout 20 --max-time 180 "$url" --output "$output"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fetch_file() {
|
|
18
|
+
local name=$1 url=$2 expected=$3 path="$vendor/$1" temporary
|
|
19
|
+
if [[ -f "$path" ]] && echo "$expected $path" | sha256sum --check --status; then
|
|
20
|
+
return
|
|
21
|
+
fi
|
|
22
|
+
temporary=$(mktemp "$vendor/.download.XXXXXX")
|
|
23
|
+
trap 'rm -f "$temporary"' RETURN
|
|
24
|
+
download "$url" "$temporary"
|
|
25
|
+
echo "$expected $temporary" | sha256sum --check --status
|
|
26
|
+
mv "$temporary" "$path"
|
|
27
|
+
trap - RETURN
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fetch_archive() {
|
|
31
|
+
local name=$1 url=$2 expected=$3 archive temporary
|
|
32
|
+
archive=$(mktemp "$vendor/.archive.XXXXXX")
|
|
33
|
+
temporary=$(mktemp -d "$vendor/.extract.XXXXXX")
|
|
34
|
+
trap 'rm -rf "$archive" "$temporary"' RETURN
|
|
35
|
+
download "$url" "$archive"
|
|
36
|
+
echo "$expected $archive" | sha256sum --check --status
|
|
37
|
+
tar --extract --gzip --file "$archive" --directory "$temporary" --strip-components=1
|
|
38
|
+
rm -rf "$vendor/$name"
|
|
39
|
+
mv "$temporary" "$vendor/$name"
|
|
40
|
+
rm -f "$archive"
|
|
41
|
+
trap - RETURN
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
fetch_file nanosvg.h \
|
|
45
|
+
https://raw.githubusercontent.com/memononen/nanosvg/239e102ec2c691f2902e20ace2ed36ee4a35cfe6/src/nanosvg.h \
|
|
46
|
+
e34fd5d084be106cea972d19ce5d27fd96d17ba89f8d06bdceee058420c8b2b0
|
|
47
|
+
fetch_file nanosvgrast.h \
|
|
48
|
+
https://raw.githubusercontent.com/memononen/nanosvg/239e102ec2c691f2902e20ace2ed36ee4a35cfe6/src/nanosvgrast.h \
|
|
49
|
+
79a9c5f4db19debf9f3a648a1589e96d92854f245a5cb4f3d823f263785234d8
|
|
50
|
+
fetch_file LICENSE-NANOSVG \
|
|
51
|
+
https://raw.githubusercontent.com/memononen/nanosvg/239e102ec2c691f2902e20ace2ed36ee4a35cfe6/LICENSE.txt \
|
|
52
|
+
e82bc3dd03400aecabe12201219ba14750dbc4b36faab58663a7a6068548d372
|
|
53
|
+
|
|
54
|
+
if [[ ! -f "$stamp" ]] || [[ "$(<"$stamp")" != "$stamp_value" ]]; then
|
|
55
|
+
fetch_archive zigtex \
|
|
56
|
+
https://github.com/fjebaker/zigtex/archive/fda2819e45f57ca2071810c47249a46bfc782cdf.tar.gz \
|
|
57
|
+
ea2923b8a731e80820b2f0ded97a3c57a5933da46fde7ab1350fe79aff3e00cc
|
|
58
|
+
fetch_archive microtex \
|
|
59
|
+
https://github.com/fjebaker/MicroTeX/archive/74e8fee9e47edc3a777e64fb2eff9a85a01defac.tar.gz \
|
|
60
|
+
8da1600f75a674d465715b1d3e0c2bfd84adab128b45e91253ecfa46f856a963
|
|
61
|
+
|
|
62
|
+
sed -i \
|
|
63
|
+
-e 's# .url = .*# .path = "../microtex",#' \
|
|
64
|
+
-e '/ .hash = /d' \
|
|
65
|
+
"$vendor/zigtex/build.zig.zon"
|
|
66
|
+
sed -i \
|
|
67
|
+
-e 's/conf_header.getOutput()/conf_header.getOutputFile()/' \
|
|
68
|
+
-e 's/lib.linkLibCpp();/lib.root_module.link_libcpp = true;/' \
|
|
69
|
+
-e 's/lib.addConfigHeader/lib.root_module.addConfigHeader/g' \
|
|
70
|
+
-e 's/lib.addIncludePath/lib.root_module.addIncludePath/g' \
|
|
71
|
+
-e 's/lib.addCSourceFiles/lib.root_module.addCSourceFiles/g' \
|
|
72
|
+
-e 's/exe.addIncludePath/exe.root_module.addIncludePath/g' \
|
|
73
|
+
-e 's/exe.addCSourceFiles/exe.root_module.addCSourceFiles/g' \
|
|
74
|
+
-e 's/exe.linkLibrary/exe.root_module.linkLibrary/g' \
|
|
75
|
+
-e '/ .optimize = optimize,/a\ .pic = true,' \
|
|
76
|
+
"$vendor/microtex/build.zig"
|
|
77
|
+
patch --directory "$vendor/zigtex" --strip 1 < native/zigtex-0.16.patch
|
|
78
|
+
sed -i \
|
|
79
|
+
's/c.microtex_init(content.len, content.ptr)/c.microtex_init(@intCast(content.len), content.ptr)/' \
|
|
80
|
+
"$vendor/zigtex/src/tex.zig"
|
|
81
|
+
printf '%s\n' "$stamp_value" > "$stamp"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
for required in \
|
|
85
|
+
"$vendor/zigtex/LICENSE" \
|
|
86
|
+
"$vendor/microtex/LICENSE" \
|
|
87
|
+
"$vendor/microtex/res/lm-math/README"; do
|
|
88
|
+
[[ -s "$required" ]] || { echo "required vendor file is missing: $required" >&2; exit 1; }
|
|
89
|
+
done
|