@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/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.h
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#ifndef RUNNER_WIN32_WINDOW_H_
|
|
2
|
+
#define RUNNER_WIN32_WINDOW_H_
|
|
3
|
+
|
|
4
|
+
#include <windows.h>
|
|
5
|
+
|
|
6
|
+
#include <functional>
|
|
7
|
+
#include <memory>
|
|
8
|
+
#include <string>
|
|
9
|
+
|
|
10
|
+
// A class abstraction for a high DPI-aware Win32 Window. Intended to be
|
|
11
|
+
// inherited from by classes that wish to specialize with custom
|
|
12
|
+
// rendering and input handling
|
|
13
|
+
class Win32Window {
|
|
14
|
+
public:
|
|
15
|
+
struct Point {
|
|
16
|
+
unsigned int x;
|
|
17
|
+
unsigned int y;
|
|
18
|
+
Point(unsigned int x, unsigned int y) : x(x), y(y) {}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
struct Size {
|
|
22
|
+
unsigned int width;
|
|
23
|
+
unsigned int height;
|
|
24
|
+
Size(unsigned int width, unsigned int height)
|
|
25
|
+
: width(width), height(height) {}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
Win32Window();
|
|
29
|
+
virtual ~Win32Window();
|
|
30
|
+
|
|
31
|
+
// Creates and shows a win32 window with |title| and position and size using
|
|
32
|
+
// |origin| and |size|. New windows are created on the default monitor. Window
|
|
33
|
+
// sizes are specified to the OS in physical pixels, hence to ensure a
|
|
34
|
+
// consistent size to will treat the width height passed in to this function
|
|
35
|
+
// as logical pixels and scale to appropriate for the default monitor. Returns
|
|
36
|
+
// true if the window was created successfully.
|
|
37
|
+
bool CreateAndShow(const std::wstring& title,
|
|
38
|
+
const Point& origin,
|
|
39
|
+
const Size& size);
|
|
40
|
+
|
|
41
|
+
// Release OS resources associated with window.
|
|
42
|
+
void Destroy();
|
|
43
|
+
|
|
44
|
+
// Inserts |content| into the window tree.
|
|
45
|
+
void SetChildContent(HWND content);
|
|
46
|
+
|
|
47
|
+
// Returns the backing Window handle to enable clients to set icon and other
|
|
48
|
+
// window properties. Returns nullptr if the window has been destroyed.
|
|
49
|
+
HWND GetHandle();
|
|
50
|
+
|
|
51
|
+
// If true, closing this window will quit the application.
|
|
52
|
+
void SetQuitOnClose(bool quit_on_close);
|
|
53
|
+
|
|
54
|
+
// Return a RECT representing the bounds of the current client area.
|
|
55
|
+
RECT GetClientArea();
|
|
56
|
+
|
|
57
|
+
protected:
|
|
58
|
+
// Processes and route salient window messages for mouse handling,
|
|
59
|
+
// size change and DPI. Delegates handling of these to member overloads that
|
|
60
|
+
// inheriting classes can handle.
|
|
61
|
+
virtual LRESULT MessageHandler(HWND window,
|
|
62
|
+
UINT const message,
|
|
63
|
+
WPARAM const wparam,
|
|
64
|
+
LPARAM const lparam) noexcept;
|
|
65
|
+
|
|
66
|
+
// Called when CreateAndShow is called, allowing subclass window-related
|
|
67
|
+
// setup. Subclasses should return false if setup fails.
|
|
68
|
+
virtual bool OnCreate();
|
|
69
|
+
|
|
70
|
+
// Called when Destroy is called.
|
|
71
|
+
virtual void OnDestroy();
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
friend class WindowClassRegistrar;
|
|
75
|
+
|
|
76
|
+
// OS callback called by message pump. Handles the WM_NCCREATE message which
|
|
77
|
+
// is passed when the non-client area is being created and enables automatic
|
|
78
|
+
// non-client DPI scaling so that the non-client area automatically
|
|
79
|
+
// responsponds to changes in DPI. All other messages are handled by
|
|
80
|
+
// MessageHandler.
|
|
81
|
+
static LRESULT CALLBACK WndProc(HWND const window,
|
|
82
|
+
UINT const message,
|
|
83
|
+
WPARAM const wparam,
|
|
84
|
+
LPARAM const lparam) noexcept;
|
|
85
|
+
|
|
86
|
+
// Retrieves a class instance pointer for |window|
|
|
87
|
+
static Win32Window* GetThisFromHandle(HWND const window) noexcept;
|
|
88
|
+
|
|
89
|
+
bool quit_on_close_ = false;
|
|
90
|
+
|
|
91
|
+
// window handle for top level window.
|
|
92
|
+
HWND window_handle_ = nullptr;
|
|
93
|
+
|
|
94
|
+
// window handle for hosted content.
|
|
95
|
+
HWND child_content_ = nullptr;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
#endif // RUNNER_WIN32_WINDOW_H_
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#import "MicrotexPlugin.h"
|
|
2
|
+
#if __has_include(<microtex/microtex-Swift.h>)
|
|
3
|
+
#import <microtex/microtex-Swift.h>
|
|
4
|
+
#else
|
|
5
|
+
// Support project import fallback if the generated compatibility header
|
|
6
|
+
// is not copied when this plugin is created as a library.
|
|
7
|
+
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
|
|
8
|
+
#import "microtex-Swift.h"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
#import "dummy.h"
|
|
12
|
+
|
|
13
|
+
@implementation MicrotexPlugin
|
|
14
|
+
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
|
15
|
+
[SwiftMicrotexPlugin registerWithRegistrar:registrar];
|
|
16
|
+
// dummy function call to keep microtex lib
|
|
17
|
+
microtex_isLittleEndian();
|
|
18
|
+
}
|
|
19
|
+
@end
|
package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/SwiftMicrotexPlugin.swift
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Flutter
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
public class SwiftMicrotexPlugin: NSObject, FlutterPlugin {
|
|
5
|
+
public static func register(with registrar: FlutterPluginRegistrar) {
|
|
6
|
+
let channel = FlutterMethodChannel(name: "microtex", binaryMessenger: registrar.messenger())
|
|
7
|
+
let instance = SwiftMicrotexPlugin()
|
|
8
|
+
registrar.addMethodCallDelegate(instance, channel: channel)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
12
|
+
result("iOS " + UIDevice.current.systemVersion)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#
|
|
2
|
+
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
|
|
3
|
+
# Run `pod lib lint microtex.podspec` to validate before publishing.
|
|
4
|
+
#
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'microtex'
|
|
7
|
+
s.version = '0.0.1'
|
|
8
|
+
s.summary = 'A micro, fast, cross-platform, and embeddable LaTeX rendering library.'
|
|
9
|
+
s.description = <<-DESC
|
|
10
|
+
A micro, fast, cross-platform, and embeddable LaTeX rendering library.
|
|
11
|
+
DESC
|
|
12
|
+
s.homepage = 'http://example.com'
|
|
13
|
+
s.license = { :file => '../LICENSE' }
|
|
14
|
+
s.author = { 'Your Company' => 'email@example.com' }
|
|
15
|
+
s.source = { :path => '.' }
|
|
16
|
+
s.source_files = 'Classes/**/*'
|
|
17
|
+
s.dependency 'Flutter'
|
|
18
|
+
s.platform = :ios, '9.0'
|
|
19
|
+
|
|
20
|
+
s.libraries = 'c++'
|
|
21
|
+
s.vendored_libraries = 'libs/libmicrotex.a'
|
|
22
|
+
|
|
23
|
+
# Flutter.framework does not contain a i386 slice.
|
|
24
|
+
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' }
|
|
25
|
+
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
|
|
26
|
+
s.swift_version = '5.0'
|
|
27
|
+
end
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import 'dart:ffi';
|
|
2
|
+
import 'dart:io';
|
|
3
|
+
import 'package:ffi/ffi.dart';
|
|
4
|
+
import 'package:microtex/src/context.dart';
|
|
5
|
+
import 'package:microtex/src/fontdesc.dart';
|
|
6
|
+
|
|
7
|
+
import 'bounds.dart';
|
|
8
|
+
|
|
9
|
+
typedef NCreateTextLayout = Uint32 Function(Pointer<Utf8>, Pointer<FontDesc>);
|
|
10
|
+
typedef NGetTextLayoutBounds = Void Function(Uint32, Pointer<Bounds>);
|
|
11
|
+
typedef NReleaseTextLayout = Void Function(Uint32);
|
|
12
|
+
typedef NIsPathExists = Bool Function(Uint32);
|
|
13
|
+
typedef NRegisterCallbacks = Void Function(
|
|
14
|
+
Pointer<NativeFunction<NCreateTextLayout>>,
|
|
15
|
+
Pointer<NativeFunction<NGetTextLayoutBounds>>,
|
|
16
|
+
Pointer<NativeFunction<NReleaseTextLayout>>,
|
|
17
|
+
Pointer<NativeFunction<NIsPathExists>>,
|
|
18
|
+
);
|
|
19
|
+
typedef RegisterCallbacks = void Function(
|
|
20
|
+
Pointer<NativeFunction<NCreateTextLayout>>,
|
|
21
|
+
Pointer<NativeFunction<NGetTextLayoutBounds>>,
|
|
22
|
+
Pointer<NativeFunction<NReleaseTextLayout>>,
|
|
23
|
+
Pointer<NativeFunction<NIsPathExists>>,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
typedef NativeParse = Pointer Function(Pointer<Utf8>, Int32, Float, Float, Uint32, Bool, Bool, Uint32);
|
|
27
|
+
typedef Parse = Pointer Function(Pointer<Utf8>, int, double, double, int, bool, bool, int);
|
|
28
|
+
|
|
29
|
+
class NativeBindings {
|
|
30
|
+
late final DynamicLibrary _nativeLib;
|
|
31
|
+
|
|
32
|
+
// context
|
|
33
|
+
late final RegisterCallbacks registerCallbacks;
|
|
34
|
+
late final Pointer Function(int, Pointer) init;
|
|
35
|
+
late final bool Function() isInited;
|
|
36
|
+
late final void Function() release;
|
|
37
|
+
late final bool Function() isLittleEndian;
|
|
38
|
+
|
|
39
|
+
// font operations
|
|
40
|
+
late final Pointer<Utf8> Function(Pointer) getFontFamily;
|
|
41
|
+
late final Pointer<Utf8> Function(Pointer) getFontName;
|
|
42
|
+
late final bool Function(Pointer) isMathFont;
|
|
43
|
+
late final void Function(Pointer) releaseFontMeta;
|
|
44
|
+
late final Pointer Function(int len, Pointer) addFont;
|
|
45
|
+
|
|
46
|
+
// setters
|
|
47
|
+
late final void Function(Pointer<Utf8>) setDefaultMathFont;
|
|
48
|
+
late final void Function(Pointer<Utf8>) setDefaultMainFont;
|
|
49
|
+
|
|
50
|
+
// parse
|
|
51
|
+
late final Parse parse;
|
|
52
|
+
|
|
53
|
+
// render
|
|
54
|
+
late final void Function(Pointer) deleteRender;
|
|
55
|
+
late final Pointer<Uint8> Function(Pointer, int, int) getDrawingData;
|
|
56
|
+
late final void Function(Pointer) deleteDrawingData;
|
|
57
|
+
late final int Function(Pointer) getRenderWidth;
|
|
58
|
+
late final int Function(Pointer) getRenderHeight;
|
|
59
|
+
late final int Function(Pointer) getRenderDepth;
|
|
60
|
+
late final bool Function(Pointer) isRenderSplit;
|
|
61
|
+
late final void Function(Pointer, double) setRenderTextSize;
|
|
62
|
+
late final void Function(Pointer, int) setRenderForground;
|
|
63
|
+
|
|
64
|
+
// glyph settings
|
|
65
|
+
late final bool Function() hasGlyphPathRender;
|
|
66
|
+
late final void Function(bool) setRenderGlyphUsePath;
|
|
67
|
+
late final bool Function() isRenderGlyphUsePath;
|
|
68
|
+
|
|
69
|
+
NativeBindings._() {
|
|
70
|
+
_init();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
factory NativeBindings() => NativeBindings._();
|
|
74
|
+
|
|
75
|
+
void _init() {
|
|
76
|
+
if (Platform.isLinux || Platform.isAndroid) {
|
|
77
|
+
_nativeLib = DynamicLibrary.open('libmicrotex.so');
|
|
78
|
+
} else if (Platform.isIOS || Platform.isMacOS) {
|
|
79
|
+
_nativeLib = DynamicLibrary.process();
|
|
80
|
+
} else if (Platform.isWindows) {
|
|
81
|
+
_nativeLib = DynamicLibrary.open('microtex.dll');
|
|
82
|
+
} else {
|
|
83
|
+
// should never happen
|
|
84
|
+
}
|
|
85
|
+
if (debugMicroTeX) print(_nativeLib);
|
|
86
|
+
// context
|
|
87
|
+
registerCallbacks = _nativeLib
|
|
88
|
+
.lookup<NativeFunction<NRegisterCallbacks>>(
|
|
89
|
+
'microtex_registerCallbacks',
|
|
90
|
+
)
|
|
91
|
+
.asFunction<RegisterCallbacks>();
|
|
92
|
+
init = _nativeLib
|
|
93
|
+
.lookup<NativeFunction<Pointer Function(Uint32, Pointer)>>(
|
|
94
|
+
"microtex_init",
|
|
95
|
+
)
|
|
96
|
+
.asFunction<Pointer Function(int, Pointer)>();
|
|
97
|
+
isInited = _nativeLib
|
|
98
|
+
.lookup<NativeFunction<Bool Function()>>(
|
|
99
|
+
"microtex_isInited",
|
|
100
|
+
)
|
|
101
|
+
.asFunction();
|
|
102
|
+
release = _nativeLib
|
|
103
|
+
.lookup<NativeFunction<Void Function()>>(
|
|
104
|
+
"microtex_release",
|
|
105
|
+
)
|
|
106
|
+
.asFunction();
|
|
107
|
+
isLittleEndian = _nativeLib
|
|
108
|
+
.lookup<NativeFunction<Bool Function()>>(
|
|
109
|
+
"microtex_isLittleEndian",
|
|
110
|
+
)
|
|
111
|
+
.asFunction();
|
|
112
|
+
// FontMeta
|
|
113
|
+
getFontFamily = _nativeLib
|
|
114
|
+
.lookup<NativeFunction<Pointer<Utf8> Function(Pointer)>>(
|
|
115
|
+
"microtex_getFontFamily",
|
|
116
|
+
)
|
|
117
|
+
.asFunction();
|
|
118
|
+
getFontName = _nativeLib
|
|
119
|
+
.lookup<NativeFunction<Pointer<Utf8> Function(Pointer)>>(
|
|
120
|
+
"microtex_getFontName",
|
|
121
|
+
)
|
|
122
|
+
.asFunction();
|
|
123
|
+
isMathFont = _nativeLib
|
|
124
|
+
.lookup<NativeFunction<Bool Function(Pointer)>>(
|
|
125
|
+
"microtex_isMathFont",
|
|
126
|
+
)
|
|
127
|
+
.asFunction();
|
|
128
|
+
releaseFontMeta = _nativeLib
|
|
129
|
+
.lookup<NativeFunction<Void Function(Pointer)>>(
|
|
130
|
+
"microtex_releaseFontMeta",
|
|
131
|
+
)
|
|
132
|
+
.asFunction();
|
|
133
|
+
addFont = _nativeLib
|
|
134
|
+
.lookup<NativeFunction<Pointer Function(Uint32, Pointer)>>(
|
|
135
|
+
"microtex_addFont",
|
|
136
|
+
)
|
|
137
|
+
.asFunction();
|
|
138
|
+
// setters
|
|
139
|
+
setDefaultMathFont = _nativeLib
|
|
140
|
+
.lookup<NativeFunction<Void Function(Pointer<Utf8>)>>(
|
|
141
|
+
"microtex_setDefaultMathFont",
|
|
142
|
+
)
|
|
143
|
+
.asFunction();
|
|
144
|
+
setDefaultMainFont = _nativeLib
|
|
145
|
+
.lookup<NativeFunction<Void Function(Pointer<Utf8>)>>(
|
|
146
|
+
"microtex_setDefaultMainFont",
|
|
147
|
+
)
|
|
148
|
+
.asFunction();
|
|
149
|
+
// parse
|
|
150
|
+
parse = _nativeLib
|
|
151
|
+
.lookup<NativeFunction<NativeParse>>(
|
|
152
|
+
"microtex_parseRender",
|
|
153
|
+
)
|
|
154
|
+
.asFunction();
|
|
155
|
+
// render
|
|
156
|
+
deleteRender = _nativeLib
|
|
157
|
+
.lookup<NativeFunction<Void Function(Pointer)>>(
|
|
158
|
+
"microtex_deleteRender",
|
|
159
|
+
)
|
|
160
|
+
.asFunction();
|
|
161
|
+
getDrawingData = _nativeLib
|
|
162
|
+
.lookup<NativeFunction<Pointer<Uint8> Function(Pointer, Int32, Int32)>>(
|
|
163
|
+
"microtex_getDrawingData",
|
|
164
|
+
)
|
|
165
|
+
.asFunction();
|
|
166
|
+
deleteDrawingData = _nativeLib
|
|
167
|
+
.lookup<NativeFunction<Void Function(Pointer)>>(
|
|
168
|
+
"microtex_freeDrawingData",
|
|
169
|
+
)
|
|
170
|
+
.asFunction();
|
|
171
|
+
getRenderWidth = _nativeLib
|
|
172
|
+
.lookup<NativeFunction<Int32 Function(Pointer)>>(
|
|
173
|
+
"microtex_getRenderWidth",
|
|
174
|
+
)
|
|
175
|
+
.asFunction();
|
|
176
|
+
getRenderHeight = _nativeLib
|
|
177
|
+
.lookup<NativeFunction<Int32 Function(Pointer)>>(
|
|
178
|
+
"microtex_getRenderHeight",
|
|
179
|
+
)
|
|
180
|
+
.asFunction();
|
|
181
|
+
getRenderDepth = _nativeLib
|
|
182
|
+
.lookup<NativeFunction<Int32 Function(Pointer)>>(
|
|
183
|
+
"microtex_getRenderDepth",
|
|
184
|
+
)
|
|
185
|
+
.asFunction();
|
|
186
|
+
isRenderSplit = _nativeLib
|
|
187
|
+
.lookup<NativeFunction<Bool Function(Pointer)>>(
|
|
188
|
+
"microtex_isRenderSplit",
|
|
189
|
+
)
|
|
190
|
+
.asFunction();
|
|
191
|
+
setRenderTextSize = _nativeLib
|
|
192
|
+
.lookup<NativeFunction<Void Function(Pointer, Float)>>(
|
|
193
|
+
"microtex_setRenderTextSize",
|
|
194
|
+
)
|
|
195
|
+
.asFunction();
|
|
196
|
+
setRenderForground = _nativeLib
|
|
197
|
+
.lookup<NativeFunction<Void Function(Pointer, Uint32)>>(
|
|
198
|
+
"microtex_setRenderForeground",
|
|
199
|
+
)
|
|
200
|
+
.asFunction();
|
|
201
|
+
// glyph settings
|
|
202
|
+
hasGlyphPathRender = _nativeLib
|
|
203
|
+
.lookup<NativeFunction<Bool Function()>>(
|
|
204
|
+
"microtex_hasGlyphPathRender",
|
|
205
|
+
)
|
|
206
|
+
.asFunction();
|
|
207
|
+
setRenderGlyphUsePath = _nativeLib
|
|
208
|
+
.lookup<NativeFunction<Void Function(Bool)>>(
|
|
209
|
+
"microtex_setRenderGlyphUsePath",
|
|
210
|
+
)
|
|
211
|
+
.asFunction();
|
|
212
|
+
isRenderGlyphUsePath = _nativeLib
|
|
213
|
+
.lookup<NativeFunction<Bool Function()>>(
|
|
214
|
+
"microtex_isRenderGlyphUsePath",
|
|
215
|
+
)
|
|
216
|
+
.asFunction();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import 'dart:ffi';
|
|
2
|
+
|
|
3
|
+
import 'package:flutter/cupertino.dart';
|
|
4
|
+
import 'package:flutter/foundation.dart';
|
|
5
|
+
import 'package:ffi/ffi.dart';
|
|
6
|
+
import 'package:flutter/services.dart';
|
|
7
|
+
import 'package:microtex/microtex.dart';
|
|
8
|
+
import 'package:microtex/src/bindings.dart';
|
|
9
|
+
import 'package:microtex/src/bounds.dart';
|
|
10
|
+
import 'package:microtex/src/fontdesc.dart';
|
|
11
|
+
import 'package:microtex/src/pathcache.dart';
|
|
12
|
+
import 'package:microtex/src/textlayout.dart';
|
|
13
|
+
|
|
14
|
+
bool _debugMicroTeX = false;
|
|
15
|
+
|
|
16
|
+
set debugMicroTeX(bool value) => _debugMicroTeX = value;
|
|
17
|
+
|
|
18
|
+
bool get debugMicroTeX => _debugMicroTeX && kDebugMode;
|
|
19
|
+
|
|
20
|
+
/// The MicroTeX context wrapper for Flutter from native. You must call [initialize]
|
|
21
|
+
/// to initialize the context before using.
|
|
22
|
+
class MicroTeX {
|
|
23
|
+
MicroTeX._();
|
|
24
|
+
|
|
25
|
+
static final _instance = MicroTeX._();
|
|
26
|
+
|
|
27
|
+
factory MicroTeX() => _instance;
|
|
28
|
+
|
|
29
|
+
late final bool _isLittleEndian;
|
|
30
|
+
final _bindings = NativeBindings();
|
|
31
|
+
final _fonts = <FontMeta>[];
|
|
32
|
+
|
|
33
|
+
String _currentMathFontName = "";
|
|
34
|
+
|
|
35
|
+
/// The name of the math font currently in use, empty if the context was
|
|
36
|
+
/// not intialized.
|
|
37
|
+
String get currentMathFontName => _currentMathFontName;
|
|
38
|
+
|
|
39
|
+
set currentMathFontName(value) {
|
|
40
|
+
if (_currentMathFontName == value) return;
|
|
41
|
+
_currentMathFontName = value;
|
|
42
|
+
_setMathFont(value);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
String _currentMainFontFamilyName = "";
|
|
46
|
+
|
|
47
|
+
/// The family name of the main font currently in use, if it is empty, that means
|
|
48
|
+
/// no main font was given, thus the context fallbacks to the math font.
|
|
49
|
+
String get currentMainFontFamilyName => _currentMainFontFamilyName;
|
|
50
|
+
|
|
51
|
+
set currentMainFontFamilyName(value) {
|
|
52
|
+
if (_currentMainFontFamilyName == value) return;
|
|
53
|
+
_currentMainFontFamilyName = value;
|
|
54
|
+
_setMainFont(value);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
List<FontMeta> get mathFonts {
|
|
58
|
+
return _fonts.where((element) => element.isMathFont).toList();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
List<FontMeta> get mainFonts {
|
|
62
|
+
return _fonts.where((element) => !element.isMathFont).toList();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// Initialize the MicroTeX context.
|
|
66
|
+
Future<void> initialize({
|
|
67
|
+
required String clmAsset,
|
|
68
|
+
String textLayoutSerif = "",
|
|
69
|
+
String textLayoutSansSerif = "",
|
|
70
|
+
String textLayoutMonospace = "",
|
|
71
|
+
}) async {
|
|
72
|
+
TextLayout.setFontFamily(
|
|
73
|
+
textLayoutSerif,
|
|
74
|
+
textLayoutSansSerif,
|
|
75
|
+
textLayoutMonospace,
|
|
76
|
+
);
|
|
77
|
+
_isLittleEndian = _bindings.isLittleEndian();
|
|
78
|
+
_registerCallbacks();
|
|
79
|
+
await _initWithCLM(clmAsset);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
void _registerCallbacks() {
|
|
83
|
+
final register = _bindings.registerCallbacks;
|
|
84
|
+
final a = Pointer.fromFunction<Uint32 Function(Pointer, Pointer)>(
|
|
85
|
+
_createTextLayout,
|
|
86
|
+
0,
|
|
87
|
+
);
|
|
88
|
+
final b = Pointer.fromFunction<Void Function(Uint32, Pointer)>(
|
|
89
|
+
_getTextLayoutBounds,
|
|
90
|
+
);
|
|
91
|
+
final c = Pointer.fromFunction<Void Function(Uint32)>(
|
|
92
|
+
TextLayout.release,
|
|
93
|
+
);
|
|
94
|
+
final d = Pointer.fromFunction<Bool Function(Uint32)>(
|
|
95
|
+
_isPathExists,
|
|
96
|
+
false,
|
|
97
|
+
);
|
|
98
|
+
register(a, b, c, d);
|
|
99
|
+
if (debugMicroTeX) print(register);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static int _createTextLayout(Pointer<Utf8> txt, Pointer<FontDesc> font) {
|
|
103
|
+
return TextLayout.create(txt.toDartString(), font.ref);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static void _getTextLayoutBounds(int id, Pointer<Bounds> bounds) {
|
|
107
|
+
final b = TextLayout.getBounds(id);
|
|
108
|
+
bounds.ref
|
|
109
|
+
..width = b[0]
|
|
110
|
+
..height = b[1]
|
|
111
|
+
..ascent = b[2];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static bool _isPathExists(int id) => PathCache()[id] != null;
|
|
115
|
+
|
|
116
|
+
Future<FontMeta> _loadCLM(
|
|
117
|
+
String clmAsset,
|
|
118
|
+
Pointer Function(int len, Pointer<Uint8> buf) f,
|
|
119
|
+
) async {
|
|
120
|
+
final clm = await rootBundle.load(clmAsset);
|
|
121
|
+
final len = clm.lengthInBytes;
|
|
122
|
+
// copy data to C
|
|
123
|
+
final cbuf = calloc.allocate<Uint8>(len);
|
|
124
|
+
final list = cbuf.asTypedList(len);
|
|
125
|
+
list.setAll(0, clm.buffer.asUint8List());
|
|
126
|
+
// callback
|
|
127
|
+
final m = f(len, cbuf);
|
|
128
|
+
// release buffer in C
|
|
129
|
+
calloc.free(cbuf);
|
|
130
|
+
// get font meta info from C
|
|
131
|
+
final fontFamily = _bindings.getFontFamily(m).toDartString();
|
|
132
|
+
final fontName = _bindings.getFontName(m).toDartString();
|
|
133
|
+
final isMathFont = _bindings.isMathFont(m);
|
|
134
|
+
// push to font meta list
|
|
135
|
+
final meta = FontMeta(fontFamily, fontName, isMathFont);
|
|
136
|
+
if (debugMicroTeX) print(meta);
|
|
137
|
+
if (meta.isValid) _fonts.add(meta);
|
|
138
|
+
// release meta pointer in C
|
|
139
|
+
_bindings.releaseFontMeta(m);
|
|
140
|
+
return meta;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
Future<void> _initWithCLM(String clmAsset) async {
|
|
144
|
+
final meta = await _loadCLM(clmAsset, (len, buf) => _bindings.init(len, buf));
|
|
145
|
+
currentMathFontName = meta.fontName;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/// Add a clm font from assets.
|
|
149
|
+
Future<FontMeta> addFont(String clmAsset) async {
|
|
150
|
+
return _loadCLM(clmAsset, (len, buf) => _bindings.addFont(len, buf));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
void _setMathFont(String name) {
|
|
154
|
+
final str = name.toNativeUtf8();
|
|
155
|
+
_bindings.setDefaultMathFont(str);
|
|
156
|
+
calloc.free(str);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
void _setMainFont(String familyName) {
|
|
160
|
+
final str = familyName.toNativeUtf8();
|
|
161
|
+
_bindings.setDefaultMainFont(str);
|
|
162
|
+
calloc.free(str);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/// Test if MicroTeX has the ability to use path to render glyphs.
|
|
166
|
+
bool hasGlyphPathRender() {
|
|
167
|
+
return _bindings.hasGlyphPathRender();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/// Set if use path to render glyphs, only works if [hasGlyphPathRender] returns true,
|
|
171
|
+
/// otherwise this function takes no effects.
|
|
172
|
+
void setRenderGlyphUsePath(bool use) {
|
|
173
|
+
_bindings.setRenderGlyphUsePath(use);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/// Test if currently use path to render glyphs.
|
|
177
|
+
bool isRenderGlyphUsePath() {
|
|
178
|
+
return _bindings.isRenderGlyphUsePath();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
Render parse({
|
|
182
|
+
required String tex,
|
|
183
|
+
required int width,
|
|
184
|
+
required double textSize,
|
|
185
|
+
required double lineSpace,
|
|
186
|
+
required Color color,
|
|
187
|
+
required bool fillWidth,
|
|
188
|
+
required bool overrideTeXStyle,
|
|
189
|
+
required TeXStyle style,
|
|
190
|
+
}) {
|
|
191
|
+
final str = tex.toNativeUtf8();
|
|
192
|
+
final ptr = _bindings.parse(
|
|
193
|
+
str,
|
|
194
|
+
width,
|
|
195
|
+
textSize,
|
|
196
|
+
lineSpace,
|
|
197
|
+
color.value,
|
|
198
|
+
fillWidth,
|
|
199
|
+
overrideTeXStyle,
|
|
200
|
+
style.index,
|
|
201
|
+
);
|
|
202
|
+
calloc.free(str);
|
|
203
|
+
return Render(_bindings, ptr, _isLittleEndian);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class FontMeta {
|
|
2
|
+
final String fontFamily;
|
|
3
|
+
final String fontName;
|
|
4
|
+
final bool isMathFont;
|
|
5
|
+
|
|
6
|
+
FontMeta(this.fontFamily, this.fontName, this.isMathFont);
|
|
7
|
+
|
|
8
|
+
bool get isValid => fontFamily.isNotEmpty && fontName.isNotEmpty;
|
|
9
|
+
|
|
10
|
+
@override
|
|
11
|
+
String toString() {
|
|
12
|
+
return "FontMeta{$fontFamily, $fontName, $isMathFont}";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import 'dart:ui';
|
|
2
|
+
|
|
3
|
+
class PathCache {
|
|
4
|
+
static final _instance = PathCache._();
|
|
5
|
+
|
|
6
|
+
PathCache._();
|
|
7
|
+
|
|
8
|
+
factory PathCache() {
|
|
9
|
+
return _instance;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
final _map = <int, Path>{};
|
|
13
|
+
|
|
14
|
+
Path? operator [](int id) => _map[id];
|
|
15
|
+
|
|
16
|
+
void operator []=(int id, Path path) => _map.putIfAbsent(id, () => path);
|
|
17
|
+
}
|