@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,48 @@
|
|
|
1
|
+
#ifndef MICROTEX_MACRO_TYPES_H
|
|
2
|
+
#define MICROTEX_MACRO_TYPES_H
|
|
3
|
+
|
|
4
|
+
#include "macro/macro_decl.h"
|
|
5
|
+
|
|
6
|
+
namespace microtex {
|
|
7
|
+
|
|
8
|
+
inline sptr<Atom> _math_type(Parser& tp, Args& args, AtomType type) {
|
|
9
|
+
return sptrOf<TypedAtom>(type, type, Formula(tp, args[1], false)._root);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
inline macro(mathop) {
|
|
13
|
+
auto a = _math_type(tp, args, AtomType::bigOperator);
|
|
14
|
+
a->_limitsType = LimitsType::noLimits;
|
|
15
|
+
return a;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
inline macro(mathpunct) {
|
|
19
|
+
return _math_type(tp, args, AtomType::punctuation);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
inline macro(mathord) {
|
|
23
|
+
return _math_type(tp, args, AtomType::ordinary);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
inline macro(mathrel) {
|
|
27
|
+
return _math_type(tp, args, AtomType::relation);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
inline macro(mathinner) {
|
|
31
|
+
return _math_type(tp, args, AtomType::inner);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
inline macro(mathbin) {
|
|
35
|
+
return _math_type(tp, args, AtomType::binaryOperator);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
inline macro(mathopen) {
|
|
39
|
+
return _math_type(tp, args, AtomType::opening);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
inline macro(mathclose) {
|
|
43
|
+
return _math_type(tp, args, AtomType::closing);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
} // namespace microtex
|
|
47
|
+
|
|
48
|
+
#endif // MICROTEX_MACRO_TYPES_H
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
macro_src = [
|
|
2
|
+
'macro/macro_accent.cpp',
|
|
3
|
+
'macro/macro_colors.cpp',
|
|
4
|
+
'macro/macro.cpp',
|
|
5
|
+
'macro/macro_def.cpp',
|
|
6
|
+
'macro/macro_delims.cpp',
|
|
7
|
+
'macro/macro_fonts.cpp',
|
|
8
|
+
'macro/macro_frac.cpp',
|
|
9
|
+
'macro/macro_misc.cpp',
|
|
10
|
+
'macro/macro_scripts.cpp',
|
|
11
|
+
'macro/macro_space.cpp',
|
|
12
|
+
'macro/macro_styles.cpp'
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
if install_headerfiles
|
|
16
|
+
install_headers([
|
|
17
|
+
'macro_accent.h',
|
|
18
|
+
'macro_boxes.h',
|
|
19
|
+
'macro_colors.h',
|
|
20
|
+
'macro_decl.h',
|
|
21
|
+
'macro_delims.h',
|
|
22
|
+
'macro_env.h',
|
|
23
|
+
'macro_fonts.h',
|
|
24
|
+
'macro_frac.h',
|
|
25
|
+
'macro.h',
|
|
26
|
+
'macro_misc.h',
|
|
27
|
+
'macro_scripts.h',
|
|
28
|
+
'macro_sizes.h',
|
|
29
|
+
'macro_space.h',
|
|
30
|
+
'macro_styles.h',
|
|
31
|
+
'macro_types.h'
|
|
32
|
+
], subdir: 'microtex/macro')
|
|
33
|
+
endif
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
src = []
|
|
2
|
+
inc = []
|
|
3
|
+
|
|
4
|
+
install_headerfiles = get_option('TARGET_DEVEL')
|
|
5
|
+
|
|
6
|
+
microtex_src = ['microtex.cpp']
|
|
7
|
+
src += microtex_src
|
|
8
|
+
|
|
9
|
+
microtex_inc = include_directories('.')
|
|
10
|
+
inc += microtex_inc
|
|
11
|
+
|
|
12
|
+
subdir('atom')
|
|
13
|
+
src += atom_src
|
|
14
|
+
|
|
15
|
+
subdir('box')
|
|
16
|
+
src += box_src
|
|
17
|
+
|
|
18
|
+
subdir('core')
|
|
19
|
+
src += core_src
|
|
20
|
+
|
|
21
|
+
subdir('env')
|
|
22
|
+
src += env_src
|
|
23
|
+
|
|
24
|
+
subdir('graphic')
|
|
25
|
+
src += graphic_src
|
|
26
|
+
|
|
27
|
+
subdir('macro')
|
|
28
|
+
src += macro_src
|
|
29
|
+
|
|
30
|
+
subdir('otf')
|
|
31
|
+
src += otf_src
|
|
32
|
+
|
|
33
|
+
subdir('unimath')
|
|
34
|
+
src += unimath_src
|
|
35
|
+
|
|
36
|
+
subdir('utils')
|
|
37
|
+
src += utils_src
|
|
38
|
+
|
|
39
|
+
subdir('render')
|
|
40
|
+
src += render_src
|
|
41
|
+
|
|
42
|
+
microtex_version = meson.project_version().split('.')
|
|
43
|
+
config_h = configure_file(
|
|
44
|
+
input: 'microtexconfig.h.in',
|
|
45
|
+
output: 'microtexconfig.h',
|
|
46
|
+
configuration: {
|
|
47
|
+
'PROJECT_VERSION_MAJOR': microtex_version[0],
|
|
48
|
+
'PROJECT_VERSION_MINOR': microtex_version[1],
|
|
49
|
+
'PROJECT_VERSION_PATCH': microtex_version[2],
|
|
50
|
+
'HAVE_AUTO_FONT_FIND': get_option('HAVE_AUTO_FONT_FIND'),
|
|
51
|
+
},
|
|
52
|
+
format: 'cmake@'
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
fs_lib = []
|
|
56
|
+
if cpp.has_link_argument('-lstdc++fs')
|
|
57
|
+
fs_lib += cpp.find_library('stdc++fs')
|
|
58
|
+
elif cpp.has_link_argument('-lc++fs')
|
|
59
|
+
fs_lib += cpp.find_library('c++fs')
|
|
60
|
+
elif cpp.has_link_argument('-lc++experimental')
|
|
61
|
+
fs_lib += cpp.find_library('c++experimental')
|
|
62
|
+
endif
|
|
63
|
+
|
|
64
|
+
if not cpp.has_header('filesystem')
|
|
65
|
+
if cpp.has_header('experimental/filesystem')
|
|
66
|
+
add_project_arguments('-DUSE_EXPERIMENTAL_FILESYSTEM', language: 'cpp')
|
|
67
|
+
else
|
|
68
|
+
error('outdated stdlib')
|
|
69
|
+
endif
|
|
70
|
+
endif
|
|
71
|
+
|
|
72
|
+
microtex_lib = library('microtex', src,
|
|
73
|
+
dependencies: fs_lib,
|
|
74
|
+
include_directories: inc,
|
|
75
|
+
version: meson.project_version(),
|
|
76
|
+
soversion: microtex_api_version,
|
|
77
|
+
install: true
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
microtex_dep = declare_dependency(
|
|
81
|
+
link_with: microtex_lib,
|
|
82
|
+
include_directories: inc,
|
|
83
|
+
version: meson.project_version()
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
if get_option('TARGET_DEVEL')
|
|
87
|
+
pkgconfig.generate(microtex_lib,
|
|
88
|
+
version: meson.project_version(),
|
|
89
|
+
name: 'microtex',
|
|
90
|
+
filebase: 'microtex',
|
|
91
|
+
subdirs: 'microtex',
|
|
92
|
+
description: 'A micro, fast, cross-platform, and embeddable LaTeX rendering library'
|
|
93
|
+
)
|
|
94
|
+
endif
|
|
95
|
+
|
|
96
|
+
if install_headerfiles
|
|
97
|
+
install_headers([
|
|
98
|
+
'microtexexport.h',
|
|
99
|
+
'microtex.h',
|
|
100
|
+
config_h
|
|
101
|
+
], subdir: 'microtex')
|
|
102
|
+
endif
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#include "microtex.h"
|
|
2
|
+
|
|
3
|
+
#include "core/formula.h"
|
|
4
|
+
#include "otf/fontsense.h"
|
|
5
|
+
#include "macro/macro.h"
|
|
6
|
+
#include "utils/exceptions.h"
|
|
7
|
+
#include "utils/string_utils.h"
|
|
8
|
+
#include "render/builder.h"
|
|
9
|
+
|
|
10
|
+
#include <clocale>
|
|
11
|
+
|
|
12
|
+
using namespace std;
|
|
13
|
+
using namespace microtex;
|
|
14
|
+
|
|
15
|
+
namespace microtex {
|
|
16
|
+
|
|
17
|
+
struct Config {
|
|
18
|
+
bool isInited;
|
|
19
|
+
bool isPrivilegedEnvironment;
|
|
20
|
+
std::string defaultMainFontFamily;
|
|
21
|
+
std::string defaultMathFontName;
|
|
22
|
+
bool renderGlyphUsePath;
|
|
23
|
+
bool enableOverrideTeXStyle;
|
|
24
|
+
TexStyle overrideTeXStyle;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
static Config MICROTEX_CONFIG{false, false, "", "", false, false, TexStyle::text};
|
|
28
|
+
|
|
29
|
+
} // namespace microtex
|
|
30
|
+
|
|
31
|
+
Config* MicroTeX::_config = µtex::MICROTEX_CONFIG;
|
|
32
|
+
|
|
33
|
+
std::string MicroTeX::version() {
|
|
34
|
+
static const auto ver = std::to_string(MICROTEX_VERSION_MAJOR) + "."
|
|
35
|
+
+ std::to_string(MICROTEX_VERSION_MINOR) + "."
|
|
36
|
+
+ std::to_string(MICROTEX_VERSION_PATCH);
|
|
37
|
+
return ver;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#ifdef HAVE_AUTO_FONT_FIND
|
|
41
|
+
|
|
42
|
+
struct InitVisitor {
|
|
43
|
+
|
|
44
|
+
FontMeta operator()(const FontSrc* src) {
|
|
45
|
+
auto meta = FontContext::addFont(*src);
|
|
46
|
+
if (!meta.isMathFont) {
|
|
47
|
+
throw ex_invalid_param("'" + meta.name + "' is not a math font!");
|
|
48
|
+
}
|
|
49
|
+
return meta;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
FontMeta operator()(const string& name) {
|
|
53
|
+
fontsenseLookup();
|
|
54
|
+
if (!FontContext::isMathFontExists(name)) {
|
|
55
|
+
throw ex_invalid_param("Math font '" + name + "' does not exists!");
|
|
56
|
+
}
|
|
57
|
+
return FontContext::mathFontMetaOf(name);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
FontMeta operator()(const InitFontSenseAuto& sense) {
|
|
61
|
+
auto mathFont = fontsenseLookup();
|
|
62
|
+
if (!mathFont.has_value()) {
|
|
63
|
+
throw ex_invalid_param("No math font found by font-sense.");
|
|
64
|
+
}
|
|
65
|
+
return mathFont.value();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
FontMeta MicroTeX::init(const Init& init) {
|
|
70
|
+
if (_config->isInited) return {};
|
|
71
|
+
std::setlocale(LC_NUMERIC, "C"); // workaround for decimal parsing on German (decimal comma) systems
|
|
72
|
+
auto meta = std::visit(InitVisitor(), init);
|
|
73
|
+
_config->defaultMathFontName = meta.name;
|
|
74
|
+
_config->isInited = true;
|
|
75
|
+
_config->isPrivilegedEnvironment = false;
|
|
76
|
+
NewCommandMacro::_init_();
|
|
77
|
+
return meta;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#endif // HAVE_AUTO_FONT_FIND
|
|
81
|
+
|
|
82
|
+
FontMeta MicroTeX::init(const FontSrc& mathFontSrc) {
|
|
83
|
+
if (_config->isInited) return {};
|
|
84
|
+
std::setlocale(LC_NUMERIC, "C"); // workaround for decimal parsing on German (decimal comma) systems
|
|
85
|
+
auto meta = FontContext::addFont(mathFontSrc);
|
|
86
|
+
if (!meta.isMathFont) {
|
|
87
|
+
throw ex_invalid_param("'" + meta.name + "' is not a math font!");
|
|
88
|
+
}
|
|
89
|
+
_config->defaultMathFontName = meta.name;
|
|
90
|
+
_config->isInited = true;
|
|
91
|
+
_config->isPrivilegedEnvironment = false;
|
|
92
|
+
NewCommandMacro::_init_();
|
|
93
|
+
return meta;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
bool MicroTeX::isInited() {
|
|
97
|
+
return _config->isInited;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
void MicroTeX::release() {
|
|
101
|
+
MacroInfo::_free_();
|
|
102
|
+
NewCommandMacro::_free_();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
bool MicroTeX::isPrivilegedEnvironment() {
|
|
106
|
+
return _config->isPrivilegedEnvironment;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
void MicroTeX::setPrivilegedEnvironment(bool privileged) {
|
|
110
|
+
_config->isPrivilegedEnvironment = privileged;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
FontMeta MicroTeX::addFont(const FontSrc& src) {
|
|
114
|
+
auto meta = FontContext::addFont(src);
|
|
115
|
+
if (meta.isMathFont && _config->defaultMathFontName.empty()) {
|
|
116
|
+
_config->defaultMathFontName = meta.name;
|
|
117
|
+
}
|
|
118
|
+
if (!meta.isMathFont && _config->defaultMainFontFamily.empty()) {
|
|
119
|
+
_config->defaultMainFontFamily = meta.family;
|
|
120
|
+
}
|
|
121
|
+
return meta;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
bool MicroTeX::setDefaultMathFont(const std::string& name) {
|
|
125
|
+
if (!FontContext::isMathFontExists(name)) return false;
|
|
126
|
+
_config->defaultMathFontName = name;
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
bool MicroTeX::setDefaultMainFont(const std::string& family) {
|
|
131
|
+
if (family.empty() || FontContext::isMainFontExists(family)) {
|
|
132
|
+
_config->defaultMainFontFamily = family;
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
std::vector<std::string> MicroTeX::mathFontNames() {
|
|
139
|
+
return FontContext::mathFontNames();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
std::vector<std::string> MicroTeX::mainFontFamilies() {
|
|
143
|
+
return FontContext::mainFontFamilies();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
void MicroTeX::overrideTexStyle(bool enable, TexStyle style) {
|
|
147
|
+
_config->enableOverrideTeXStyle = enable;
|
|
148
|
+
_config->overrideTeXStyle = style;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
bool MicroTeX::hasGlyphPathRender() {
|
|
152
|
+
#ifdef HAVE_GLYPH_RENDER_PATH
|
|
153
|
+
return true;
|
|
154
|
+
#else
|
|
155
|
+
return false;
|
|
156
|
+
#endif
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
void MicroTeX::setRenderGlyphUsePath(bool use) {
|
|
160
|
+
#if GLYPH_RENDER_TYPE == GLYPH_RENDER_TYPE_BOTH
|
|
161
|
+
_config->renderGlyphUsePath = use;
|
|
162
|
+
#endif
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
bool MicroTeX::isRenderGlyphUsePath() {
|
|
166
|
+
#if GLYPH_RENDER_TYPE == GLYPH_RENDER_TYPE_BOTH
|
|
167
|
+
return _config->renderGlyphUsePath;
|
|
168
|
+
#elif GLYPH_RENDER_TYPE == GLYPH_RENDER_TYPE_PATH
|
|
169
|
+
return true;
|
|
170
|
+
#else
|
|
171
|
+
return false;
|
|
172
|
+
#endif
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
Render* MicroTeX::parse(
|
|
176
|
+
const string& latex, float width, float textSize, float lineSpace, color fg,
|
|
177
|
+
bool fillWidth, const OverrideTeXStyle& overrideTeXStyle,
|
|
178
|
+
const string& mathFontName, const string& mainFontFamily
|
|
179
|
+
) {
|
|
180
|
+
Formula formula(latex);
|
|
181
|
+
const auto isInline = !startsWith(latex, "$$") && !startsWith(latex, "\\[");
|
|
182
|
+
const auto align = isInline ? Alignment::left : Alignment::center;
|
|
183
|
+
TexStyle style = isInline ? TexStyle::text : TexStyle::display;
|
|
184
|
+
if (overrideTeXStyle.enable) {
|
|
185
|
+
style = overrideTeXStyle.style;
|
|
186
|
+
} else if (_config->enableOverrideTeXStyle) {
|
|
187
|
+
style = _config->overrideTeXStyle;
|
|
188
|
+
}
|
|
189
|
+
Render* render = RenderBuilder()
|
|
190
|
+
.setStyle(style)
|
|
191
|
+
.setTextSize(textSize)
|
|
192
|
+
.setMathFontName(
|
|
193
|
+
mathFontName.empty()
|
|
194
|
+
? _config->defaultMathFontName
|
|
195
|
+
: mathFontName
|
|
196
|
+
)
|
|
197
|
+
.setMainFontName(
|
|
198
|
+
mainFontFamily.empty()
|
|
199
|
+
? _config->defaultMainFontFamily
|
|
200
|
+
: mainFontFamily
|
|
201
|
+
)
|
|
202
|
+
.setWidth({width, UnitType::pixel}, align)
|
|
203
|
+
.setFillWidth(!isInline && fillWidth)
|
|
204
|
+
.setLineSpace({lineSpace, UnitType::pixel})
|
|
205
|
+
.setForeground(fg)
|
|
206
|
+
.build(formula);
|
|
207
|
+
return render;
|
|
208
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#ifndef MICROTEX_MICROTEX_H
|
|
2
|
+
#define MICROTEX_MICROTEX_H
|
|
3
|
+
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <vector>
|
|
6
|
+
|
|
7
|
+
#include "microtexconfig.h"
|
|
8
|
+
#include "microtexexport.h"
|
|
9
|
+
#include "render/render.h"
|
|
10
|
+
#include "unimath/font_meta.h"
|
|
11
|
+
#include "unimath/font_src.h"
|
|
12
|
+
|
|
13
|
+
#ifdef HAVE_AUTO_FONT_FIND
|
|
14
|
+
|
|
15
|
+
#include <variant>
|
|
16
|
+
|
|
17
|
+
namespace microtex {
|
|
18
|
+
|
|
19
|
+
struct MICROTEX_EXPORT InitFontSenseAuto {};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* MicroTeX context initialization.
|
|
23
|
+
* <ol>
|
|
24
|
+
* <li> If a FontSrc presents, the context will load math font from the given font source.
|
|
25
|
+
* <li> If a InitFontSenseAuto presents, fill the search dirs by following rules:
|
|
26
|
+
* <ul>
|
|
27
|
+
* <li> If environment variable `MICROTEX_FONTDIR` is set, add it into search dirs.
|
|
28
|
+
* <li> If environment variable `XDG_DATA_HOME` is set, add `${XDG_DATA_HOME}/microtex` into
|
|
29
|
+
* search dirs.
|
|
30
|
+
* <li> If environment variable `XDG_DATA_DIRS` is set, iterate over the list and add the sub
|
|
31
|
+
* dir `microtex` of each item into search dirs.
|
|
32
|
+
* <li> If the current platform is WIN32, add the dir `share/microtex` where its parent is the
|
|
33
|
+
* executable running dir into search dirs.
|
|
34
|
+
* <li> Otherwise, try the following ways:
|
|
35
|
+
* <ul>
|
|
36
|
+
* <li> If environment variable `HOME` is set, add dir `${HOME}/.local/share/microtex` into
|
|
37
|
+
* search dirs.
|
|
38
|
+
* <li> Add `/usr/local/share/microtex` into search dirs.
|
|
39
|
+
* <li> Add `/usr/share/microtex` into search dirs.
|
|
40
|
+
* </ul>
|
|
41
|
+
* </ul>
|
|
42
|
+
* And then iterate over the search dirs, add all found fonts to context, and select the first
|
|
43
|
+
* found math font as the default.
|
|
44
|
+
* <li> If a string presents, follow the above way to init the context but select the math font
|
|
45
|
+
* which its name was given by this string as the default.
|
|
46
|
+
* </ol>
|
|
47
|
+
*/
|
|
48
|
+
using Init = std::variant<const FontSrc*, const std::string, InitFontSenseAuto>;
|
|
49
|
+
|
|
50
|
+
} // namespace microtex
|
|
51
|
+
|
|
52
|
+
#endif // HAVE_AUTO_FONT_FIND
|
|
53
|
+
|
|
54
|
+
namespace microtex {
|
|
55
|
+
|
|
56
|
+
struct Config;
|
|
57
|
+
|
|
58
|
+
struct MICROTEX_EXPORT OverrideTeXStyle {
|
|
59
|
+
bool enable;
|
|
60
|
+
TexStyle style;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
class MICROTEX_EXPORT MicroTeX {
|
|
64
|
+
private:
|
|
65
|
+
static Config* _config;
|
|
66
|
+
|
|
67
|
+
public:
|
|
68
|
+
/** The version of the library */
|
|
69
|
+
static std::string version();
|
|
70
|
+
|
|
71
|
+
#ifdef HAVE_AUTO_FONT_FIND
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Initialize MicroTeX context by given Init, at least we need a math font
|
|
75
|
+
* to layout formulas.
|
|
76
|
+
*
|
|
77
|
+
* @returns the math font meta info
|
|
78
|
+
*/
|
|
79
|
+
static FontMeta init(const Init& init);
|
|
80
|
+
|
|
81
|
+
#endif // HAVE_AUTO_FONT_FIND
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Initialize the context with given math font source, at least we need a
|
|
85
|
+
* math font to layout formulas.
|
|
86
|
+
*
|
|
87
|
+
* @param mathFontSrc the font source to load
|
|
88
|
+
* @returns the math font meta info
|
|
89
|
+
*/
|
|
90
|
+
static FontMeta init(const FontSrc& mathFontSrc);
|
|
91
|
+
|
|
92
|
+
/** Check if context is initialized */
|
|
93
|
+
static bool isInited();
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if the current setup has privileged execution access.
|
|
97
|
+
* By default, this is set to false, but can be enabled by calling
|
|
98
|
+
* ::setPrivilegedEnvironment"("true")".
|
|
99
|
+
*
|
|
100
|
+
* @returns true if it has, false otherwise
|
|
101
|
+
*/
|
|
102
|
+
static bool isPrivilegedEnvironment();
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Set privileged execution access for the current setup.
|
|
106
|
+
* If privileged access in enabled, TeX macros are allowed
|
|
107
|
+
* to access the filesystem, invoke external binaries, etc.
|
|
108
|
+
*
|
|
109
|
+
* Macros affected by this:
|
|
110
|
+
* <ul>
|
|
111
|
+
* <li>`addfont`</li>
|
|
112
|
+
* </ul>
|
|
113
|
+
*
|
|
114
|
+
* @param privileged whether to allow privileged access or not
|
|
115
|
+
*/
|
|
116
|
+
static void setPrivilegedEnvironment(bool privileged);
|
|
117
|
+
|
|
118
|
+
/** Add a font to context, returns its meta info. */
|
|
119
|
+
static FontMeta addFont(const FontSrc& src);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Set the default math font to show formulas, if no math font was given
|
|
123
|
+
* when parsing, the context will use the given default math font. If it
|
|
124
|
+
* is not exists, this function takes no effect.
|
|
125
|
+
*
|
|
126
|
+
* @param name the math font name
|
|
127
|
+
* @returns true if given math font exists, false otherwise
|
|
128
|
+
*/
|
|
129
|
+
static bool setDefaultMathFont(const std::string& name);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Set the default main font to show formulas, if no main font was given
|
|
133
|
+
* when parsing, the context will use the given default main font. However,
|
|
134
|
+
* if no main font was loaded, the context will use the math font to render
|
|
135
|
+
* the glyphs wrapped by command `text*`.
|
|
136
|
+
*
|
|
137
|
+
* @param family the main font family, if it is empty, that means fallback to
|
|
138
|
+
* the math font
|
|
139
|
+
* @returns true if given font exists (special case: always returns true if
|
|
140
|
+
* given family is empty), false otherwise.
|
|
141
|
+
*/
|
|
142
|
+
static bool setDefaultMainFont(const std::string& family);
|
|
143
|
+
|
|
144
|
+
/** Get all the loaded math font names. */
|
|
145
|
+
static std::vector<std::string> mathFontNames();
|
|
146
|
+
|
|
147
|
+
/** Get all the loaded main font family names. */
|
|
148
|
+
static std::vector<std::string> mainFontFamilies();
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Override the style to display formulas. If #enable is true, the '$', '$$',
|
|
152
|
+
* '\(' and '\[' will be ignored, and force to use the given overridden style.
|
|
153
|
+
*
|
|
154
|
+
* @param enable whether enable the overridden style, false to cancel
|
|
155
|
+
* @param style the target style
|
|
156
|
+
*/
|
|
157
|
+
static void overrideTexStyle(bool enable, TexStyle style = TexStyle::text);
|
|
158
|
+
|
|
159
|
+
/** Test if has the ability to use path to render glyphs. */
|
|
160
|
+
static bool hasGlyphPathRender();
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Set if use path to render glyphs, only works when compile option
|
|
164
|
+
* GLYPH_RENDER_TYPE is GLYPH_RENDER_TYPE_BOTH (equals to 0, that means render
|
|
165
|
+
* glyphs use font and path both), otherwise this function takes no effect.
|
|
166
|
+
*/
|
|
167
|
+
static void setRenderGlyphUsePath(bool use);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Test if currently use path to render glyphs.
|
|
171
|
+
*
|
|
172
|
+
* If compile option GLYPH_RENDER_TYPE is GLYPH_RENDER_TYPE_BOTH, it depends
|
|
173
|
+
* on your setting (via function [setRenderGlyphUsePath]). If your setting
|
|
174
|
+
* is true and current `clm data` does not support path rendering, this function
|
|
175
|
+
* also returns true, but will gives you a warn message if you have compile
|
|
176
|
+
* option HAVE_LOG is ON.
|
|
177
|
+
*
|
|
178
|
+
* If compile option GLYPH_RENDER_TYPE is GLYPH_RENDER_TYPE_PATH (equals to 1),
|
|
179
|
+
* always returns true.
|
|
180
|
+
*
|
|
181
|
+
* Otherwise (GLYPH_RENDER_TYPE is GLYPH_RENDER_TYPE_TYPEFACE, equals to 2),
|
|
182
|
+
* always returns false.
|
|
183
|
+
*/
|
|
184
|
+
static bool isRenderGlyphUsePath();
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Parse (La)TeX string to Render.
|
|
188
|
+
*
|
|
189
|
+
* @param tex the (La)TeX string to parse (in UTF-8 encoding)
|
|
190
|
+
* @param width the width of the 2D graphics context (in pixel) to limit the
|
|
191
|
+
* formula layout, the engine will trying to wrap the layout if it overflows
|
|
192
|
+
* the width, but will fails if formula cannot be split. Pass 0 if it is
|
|
193
|
+
* unlimited.
|
|
194
|
+
* @param textSize the text size in pixel
|
|
195
|
+
* @param lineSpace the line space in pixel
|
|
196
|
+
* @param fg the foreground color
|
|
197
|
+
* @param fillWidth whether fill the graphics context if is in inter-line mode,
|
|
198
|
+
* defaults to true. If the given width is unlimited, the engine will not trying
|
|
199
|
+
* to split the formula, and the parsed Render will has its own intrinsic width.
|
|
200
|
+
* @param overrideTeXStyle whether override the preset TeX style
|
|
201
|
+
* @param mathFontName the math font name, empty to use the preset (the font
|
|
202
|
+
* passed in method [init] and [setDefaultMathFont]) math font.
|
|
203
|
+
* @param mainFontFamily the main font family name, empty to use the preset (the
|
|
204
|
+
* font passed in method [setDefaultMainFont] or math font if not given) main
|
|
205
|
+
* font family.
|
|
206
|
+
*/
|
|
207
|
+
static Render* parse(
|
|
208
|
+
const std::string& tex,
|
|
209
|
+
float width,
|
|
210
|
+
float textSize,
|
|
211
|
+
float lineSpace,
|
|
212
|
+
color fg,
|
|
213
|
+
bool fillWidth = true,
|
|
214
|
+
const OverrideTeXStyle& overrideTeXStyle = {false, TexStyle::text},
|
|
215
|
+
const std::string& mathFontName = "",
|
|
216
|
+
const std::string& mainFontFamily = ""
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
/** Release the MicroTeX context */
|
|
220
|
+
static void release();
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
} // namespace microtex
|
|
224
|
+
|
|
225
|
+
#endif // MICROTEX_MICROTEX_H
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#ifndef MICROTEX_API_H
|
|
2
|
+
#define MICROTEX_API_H
|
|
3
|
+
|
|
4
|
+
/** All-in-one header */
|
|
5
|
+
|
|
6
|
+
#include "graphic/font_style.h"
|
|
7
|
+
#include "graphic/graphic.h"
|
|
8
|
+
#include "graphic/graphic_basic.h"
|
|
9
|
+
#include "microtex.h"
|
|
10
|
+
#include "microtexconfig.h"
|
|
11
|
+
#include "microtexexport.h"
|
|
12
|
+
#include "render/render.h"
|
|
13
|
+
#include "unimath/font_src.h"
|
|
14
|
+
#include "utils/types.h"
|
|
15
|
+
|
|
16
|
+
#ifdef HAVE_CWRAPPER
|
|
17
|
+
|
|
18
|
+
#include "wrapper/cwrapper.h"
|
|
19
|
+
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#endif // MICROTEX_API_H
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#ifndef MICROTEX_MICROTEXEXPORT_H
|
|
2
|
+
#define MICROTEX_MICROTEXEXPORT_H
|
|
3
|
+
|
|
4
|
+
#ifdef _MSC_VER
|
|
5
|
+
#include "vcruntime.h"
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
// msvc
|
|
9
|
+
#ifdef _MSC_VER
|
|
10
|
+
# if defined(MICROTEX_LIBRARY)
|
|
11
|
+
# define MICROTEX_EXPORT __declspec(dllexport)
|
|
12
|
+
# else
|
|
13
|
+
# define MICROTEX_EXPORT __declspec(dllimport)
|
|
14
|
+
# endif
|
|
15
|
+
// gnuc and clang
|
|
16
|
+
#elif defined(__GNUC__) || defined(__GNUG__) || defined(__clang__)
|
|
17
|
+
# define MICROTEX_EXPORT __attribute((visibility("default")))
|
|
18
|
+
// otherwise...
|
|
19
|
+
#else
|
|
20
|
+
# define MICROTEX_EXPORT
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
// emscripten
|
|
24
|
+
#if defined(__EMSCRIPTEN__)
|
|
25
|
+
# include <emscripten.h>
|
|
26
|
+
# define MICROTEX_CAPI EMSCRIPTEN_KEEPALIVE
|
|
27
|
+
#else
|
|
28
|
+
# define MICROTEX_CAPI MICROTEX_EXPORT
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#endif //MICROTEX_MICROTEXEXPORT_H
|