@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,211 @@
|
|
|
1
|
+
#include "macro/macro_misc.h"
|
|
2
|
+
|
|
3
|
+
#include "atom/atom_font.h"
|
|
4
|
+
#include "atom/atom_zstack.h"
|
|
5
|
+
#include "core/debug_config.h"
|
|
6
|
+
#include "env/env.h"
|
|
7
|
+
#include "env/units.h"
|
|
8
|
+
#include "graphic/graphic.h"
|
|
9
|
+
|
|
10
|
+
using namespace microtex;
|
|
11
|
+
using namespace std;
|
|
12
|
+
|
|
13
|
+
namespace microtex {
|
|
14
|
+
|
|
15
|
+
macro(longdiv) {
|
|
16
|
+
long dividend = 0;
|
|
17
|
+
valueOf(args[1], dividend);
|
|
18
|
+
long divisor = 0;
|
|
19
|
+
valueOf(args[2], divisor);
|
|
20
|
+
if (divisor == 0) throw ex_parse("Divisor must not be 0.");
|
|
21
|
+
return sptrOf<LongDivAtom>(divisor, dividend);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
macro(char) {
|
|
25
|
+
// clang-format off
|
|
26
|
+
const auto& str = tp.forward([](char ch) {
|
|
27
|
+
return ch == '\'' || ch == '"'
|
|
28
|
+
|| (ch >= '0' && ch <= '9')
|
|
29
|
+
|| (ch >= 'a' && ch <= 'z')
|
|
30
|
+
|| (ch >= 'A' && ch <= 'Z');
|
|
31
|
+
});
|
|
32
|
+
// clang-format on
|
|
33
|
+
int radix = 10;
|
|
34
|
+
int offset = 0;
|
|
35
|
+
if (startsWith(str, "'")) {
|
|
36
|
+
radix = 8;
|
|
37
|
+
offset = 1;
|
|
38
|
+
} else if (startsWith(str, "\"")) {
|
|
39
|
+
radix = 16;
|
|
40
|
+
offset = 1;
|
|
41
|
+
}
|
|
42
|
+
int n = 0;
|
|
43
|
+
str2int(str.c_str() + offset, str.length() - offset, n, radix);
|
|
44
|
+
return tp.getCharAtom(n);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
macro(cr) {
|
|
48
|
+
if (tp.isArrayMode()) {
|
|
49
|
+
tp.addRow();
|
|
50
|
+
} else {
|
|
51
|
+
ArrayFormula arr;
|
|
52
|
+
arr.add(tp._formula->_root);
|
|
53
|
+
arr.addRow();
|
|
54
|
+
Parser parser(tp.isPartial(), tp.forwardBalancedGroup(), &arr, false, tp.isMathMode());
|
|
55
|
+
parser.parse();
|
|
56
|
+
arr.checkDimensions();
|
|
57
|
+
tp._formula->_root = arr.getAsVRow();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return nullptr;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
macro(kern) {
|
|
64
|
+
auto [value, unit] = tp.getDimen();
|
|
65
|
+
return sptrOf<SpaceAtom>(unit, value, 0.f, 0.f);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
macro(hvspace) {
|
|
69
|
+
auto [value, unit] = Units::getDimen(args[1]);
|
|
70
|
+
return args[0][0] == 'h' ? sptrOf<SpaceAtom>(unit, value, 0.f, 0.f)
|
|
71
|
+
: sptrOf<SpaceAtom>(unit, 0.f, value, 0.f);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
macro(rule) {
|
|
75
|
+
auto w = Units::getDimen(args[1]);
|
|
76
|
+
auto h = Units::getDimen(args[2]);
|
|
77
|
+
auto r = Units::getDimen(args[3]);
|
|
78
|
+
|
|
79
|
+
return sptrOf<RuleAtom>(w, h, -r);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
template <typename F>
|
|
83
|
+
sptr<Atom> _def_cmd(Parser& tp, Args& args, F&& f) {
|
|
84
|
+
string newcmd(args[1]);
|
|
85
|
+
int argc = 0;
|
|
86
|
+
if (!tp.isValidCmd(newcmd)) throw ex_parse("Invalid name for the command '" + newcmd);
|
|
87
|
+
|
|
88
|
+
if (!args[3].empty()) valueOf(args[3], argc);
|
|
89
|
+
|
|
90
|
+
const bool hasOption = !args[4].empty();
|
|
91
|
+
if (hasOption && argc > 0) --argc;
|
|
92
|
+
|
|
93
|
+
f(hasOption, newcmd.substr(1), args[2], argc, args[4]);
|
|
94
|
+
|
|
95
|
+
return nullptr;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
macro(newcommand) {
|
|
99
|
+
return _def_cmd(
|
|
100
|
+
tp,
|
|
101
|
+
args,
|
|
102
|
+
[](bool hasOption, const string& cmd, const string& def, int argc, const string& opt) {
|
|
103
|
+
if (!hasOption) {
|
|
104
|
+
NewCommandMacro::addNewCommand(cmd, def, argc);
|
|
105
|
+
} else {
|
|
106
|
+
NewCommandMacro::addNewCommand(cmd, def, argc, opt);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
macro(renewcommand) {
|
|
113
|
+
return _def_cmd(
|
|
114
|
+
tp,
|
|
115
|
+
args,
|
|
116
|
+
[](bool hasOption, const string& cmd, const string& def, int argc, const string& opt) {
|
|
117
|
+
if (!hasOption) {
|
|
118
|
+
NewCommandMacro::addRenewCommand(cmd, def, argc);
|
|
119
|
+
} else {
|
|
120
|
+
NewCommandMacro::addRenewCommand(cmd, def, argc, opt);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
macro(raisebox) {
|
|
127
|
+
auto r = Units::getDimen(args[1]);
|
|
128
|
+
auto h = Units::getDimen(args[3]);
|
|
129
|
+
auto d = Units::getDimen(args[4]);
|
|
130
|
+
return sptrOf<RaiseAtom>(Formula(tp, args[2], false, tp.isMathMode())._root, -r, h, d);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
macro(romannumeral) {
|
|
134
|
+
static const int numbers[] = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
|
|
135
|
+
static const string letters[] =
|
|
136
|
+
{"M", "CM", "D", "CD", "C", "XC", "", "XL", "X", "IX", "V", "IV", "I"};
|
|
137
|
+
string roman;
|
|
138
|
+
|
|
139
|
+
int num;
|
|
140
|
+
valueOf(trim(args[1]), num);
|
|
141
|
+
for (int i = 0; i < 13; i++) {
|
|
142
|
+
while (num >= numbers[i]) {
|
|
143
|
+
roman += letters[i];
|
|
144
|
+
num -= numbers[i];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (args[0][0] == 'r') {
|
|
149
|
+
toLower(roman);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return sptrOf<FontStyleAtom>(
|
|
153
|
+
FontStyle::rm,
|
|
154
|
+
tp.isMathMode(),
|
|
155
|
+
Formula(tp, roman, false, tp.isMathMode())._root
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
macro(debug) {
|
|
160
|
+
auto& config = DebugConfig::INSTANCE;
|
|
161
|
+
const auto& options = parseOption(args[1]);
|
|
162
|
+
config.enable = true;
|
|
163
|
+
const auto& showOnlyChar = options.find("showonlychar");
|
|
164
|
+
if (showOnlyChar != options.end()) {
|
|
165
|
+
config.showOnlyChar = showOnlyChar->second == "true";
|
|
166
|
+
}
|
|
167
|
+
const auto& boundColor = options.find("boundcolor");
|
|
168
|
+
if (boundColor != options.end()) {
|
|
169
|
+
config.boundColor = ColorAtom::getColor(boundColor->second);
|
|
170
|
+
}
|
|
171
|
+
const auto& baselineColor = options.find("baselinecolor");
|
|
172
|
+
if (baselineColor != options.end()) {
|
|
173
|
+
config.baselineColor = ColorAtom::getColor(baselineColor->second);
|
|
174
|
+
}
|
|
175
|
+
return nullptr;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
macro(undebug) {
|
|
179
|
+
auto& config = DebugConfig::INSTANCE;
|
|
180
|
+
config.enable = false;
|
|
181
|
+
return nullptr;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
macro(zstack) {
|
|
185
|
+
auto halign = Alignment::left;
|
|
186
|
+
if (args[1] == "c") {
|
|
187
|
+
halign = Alignment::center;
|
|
188
|
+
} else if (args[1] == "r") {
|
|
189
|
+
halign = Alignment::right;
|
|
190
|
+
}
|
|
191
|
+
const auto& h = Units::getDimen(args[2]);
|
|
192
|
+
const ZStackArgs hargs{halign, h};
|
|
193
|
+
|
|
194
|
+
auto valign = Alignment::top;
|
|
195
|
+
if (args[3] == "c") {
|
|
196
|
+
valign = Alignment::center;
|
|
197
|
+
} else if (args[3] == "b") {
|
|
198
|
+
valign = Alignment::bottom;
|
|
199
|
+
} else if (args[3] == "B") {
|
|
200
|
+
valign = Alignment::none;
|
|
201
|
+
}
|
|
202
|
+
const auto& v = Units::getDimen(args[4]);
|
|
203
|
+
const ZStackArgs& vargs{valign, v};
|
|
204
|
+
|
|
205
|
+
const auto atom = Formula(tp, args[5], false)._root;
|
|
206
|
+
const auto anchor = Formula(tp, args[6], false)._root;
|
|
207
|
+
|
|
208
|
+
return sptrOf<ZStackAtom>(hargs, vargs, atom, anchor);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
} // namespace microtex
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#ifndef MICROTEX_MACRO_MISC_H
|
|
2
|
+
#define MICROTEX_MACRO_MISC_H
|
|
3
|
+
|
|
4
|
+
#include <memory>
|
|
5
|
+
|
|
6
|
+
#include "atom/atom_basic.h"
|
|
7
|
+
#include "atom/atom_misc.h"
|
|
8
|
+
#include "atom/atom_sideset.h"
|
|
9
|
+
#include "core/formula.h"
|
|
10
|
+
#include "core/parser.h"
|
|
11
|
+
#include "core/split.h"
|
|
12
|
+
#include "graphic/graphic.h"
|
|
13
|
+
#include "macro/macro.h"
|
|
14
|
+
#include "macro/macro_decl.h"
|
|
15
|
+
#include "utils/exceptions.h"
|
|
16
|
+
#include "utils/string_utils.h"
|
|
17
|
+
#include "utils/utf.h"
|
|
18
|
+
|
|
19
|
+
namespace microtex {
|
|
20
|
+
|
|
21
|
+
inline macro(fatalIfCmdConflict) {
|
|
22
|
+
NewCommandMacro::_errIfConflict = args[1] == "true";
|
|
23
|
+
return nullptr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
inline macro(breakEverywhere) {
|
|
27
|
+
RowAtom::_breakEverywhere = args[1] == "true";
|
|
28
|
+
return nullptr;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
inline macro(st) {
|
|
32
|
+
auto base = Formula(tp, args[1], false, tp.isMathMode())._root;
|
|
33
|
+
return sptrOf<StrikeThroughAtom>(base);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
inline macro(spATbreve) {
|
|
37
|
+
auto* vra = new VRowAtom(Formula("\\displaystyle\\!\\breve{}")._root);
|
|
38
|
+
vra->setRaise(UnitType::ex, 0.6f);
|
|
39
|
+
return sptrOf<SmashedAtom>(sptr<Atom>(vra), "");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
inline macro(clrlap) {
|
|
43
|
+
return sptrOf<LapedAtom>(Formula(tp, args[1])._root, args[0][0]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
inline macro(mathclrlap) {
|
|
47
|
+
return sptrOf<LapedAtom>(Formula(tp, args[1])._root, args[0][4]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
inline sptr<Atom> _cancel(int cancelType, Parser& tp, std::vector<std::string>& args) {
|
|
51
|
+
auto base = Formula(tp, args[1], false)._root;
|
|
52
|
+
if (base == nullptr) throw ex_parse("Cancel content must not be empty!");
|
|
53
|
+
return sptrOf<CancelAtom>(base, cancelType);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
inline macro(cancel) {
|
|
57
|
+
return _cancel(CancelAtom::SLASH, tp, args);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
inline macro(bcancel) {
|
|
61
|
+
return _cancel(CancelAtom::BACKSLASH, tp, args);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
inline macro(xcancel) {
|
|
65
|
+
return _cancel(CancelAtom::CROSS, tp, args);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
inline macro(underscore) {
|
|
69
|
+
return SymbolAtom::get("_");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
inline macro(nbsp) {
|
|
73
|
+
return sptrOf<SpaceAtom>();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
inline macro(joinrel) {
|
|
77
|
+
return sptrOf<TypedAtom>(
|
|
78
|
+
AtomType::relation,
|
|
79
|
+
AtomType::relation,
|
|
80
|
+
sptrOf<SpaceAtom>(UnitType::mu, -2.6f, 0.f, 0.f)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
inline macro(smash) {
|
|
85
|
+
return sptrOf<SmashedAtom>(Formula(tp, args[1], false)._root, args[2]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
inline macro(makeatletter) {
|
|
89
|
+
tp.makeAtLetter();
|
|
90
|
+
return nullptr;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
inline macro(makeatother) {
|
|
94
|
+
tp.makeAtOther();
|
|
95
|
+
return nullptr;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
inline macro(newenvironment) {
|
|
99
|
+
int opt = 0;
|
|
100
|
+
if (!args[4].empty()) valueOf(args[4], opt);
|
|
101
|
+
|
|
102
|
+
NewEnvironmentMacro::addNewEnvironment(args[1], args[2], args[3], opt);
|
|
103
|
+
return nullptr;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
inline macro(renewenvironment) {
|
|
107
|
+
int opt = 0;
|
|
108
|
+
if (!args[4].empty()) valueOf(args[4], opt);
|
|
109
|
+
|
|
110
|
+
NewEnvironmentMacro::addRenewEnvironment(args[1], args[2], args[3], opt);
|
|
111
|
+
return nullptr;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
inline macro(hphantom) {
|
|
115
|
+
return sptrOf<PhantomAtom>(Formula(tp, args[1], false)._root, true, false, false);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
inline macro(vphantom) {
|
|
119
|
+
return sptrOf<PhantomAtom>(Formula(tp, args[1], false)._root, false, true, true);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
inline macro(phantom) {
|
|
123
|
+
return sptr<Atom>(new PhantomAtom(Formula(tp, args[1], false)._root, true, true, true));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
inline macro(surd) {
|
|
127
|
+
return sptrOf<VCenterAtom>(SymbolAtom::get("surdsign"));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
inline macro(lmoustache) {
|
|
131
|
+
auto* s = new SymbolAtom(*(SymbolAtom::get("lmoustache")));
|
|
132
|
+
auto b = sptrOf<BigSymbolAtom>(sptr<SymbolAtom>(s), 1);
|
|
133
|
+
b->_type = AtomType::opening;
|
|
134
|
+
return b;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
inline macro(rmoustache) {
|
|
138
|
+
auto* s = new SymbolAtom(*(SymbolAtom::get("rmoustache")));
|
|
139
|
+
auto b = sptrOf<BigSymbolAtom>(sptr<SymbolAtom>(s), 1);
|
|
140
|
+
b->_type = AtomType::closing;
|
|
141
|
+
return b;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
inline macro(breakmark) {
|
|
145
|
+
return sptrOf<BreakMarkAtom>();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
inline macro(nokern) {
|
|
149
|
+
return sptrOf<NokernAtom>();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**************************************** limits macros *******************************************/
|
|
153
|
+
|
|
154
|
+
inline sptr<Atom> _limits_type(Parser& tp, Args& args, LimitsType type) {
|
|
155
|
+
auto atom = tp.popBack();
|
|
156
|
+
if (atom != nullptr)
|
|
157
|
+
atom->_limitsType = type;
|
|
158
|
+
return atom;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
inline macro(nolimits) {
|
|
162
|
+
return _limits_type(tp, args, LimitsType::noLimits);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
inline macro(limits) {
|
|
166
|
+
return _limits_type(tp, args, LimitsType::limits);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
inline macro(normal) {
|
|
170
|
+
return _limits_type(tp, args, LimitsType::normal);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/***************************************** implement at .cpp **************************************/
|
|
174
|
+
|
|
175
|
+
macro(longdiv);
|
|
176
|
+
|
|
177
|
+
macro(char);
|
|
178
|
+
|
|
179
|
+
macro(cr);
|
|
180
|
+
|
|
181
|
+
macro(kern);
|
|
182
|
+
|
|
183
|
+
macro(hvspace);
|
|
184
|
+
|
|
185
|
+
macro(rule);
|
|
186
|
+
|
|
187
|
+
macro(newcommand);
|
|
188
|
+
|
|
189
|
+
macro(renewcommand);
|
|
190
|
+
|
|
191
|
+
macro(raisebox);
|
|
192
|
+
|
|
193
|
+
macro(romannumeral);
|
|
194
|
+
|
|
195
|
+
macro(zstack);
|
|
196
|
+
|
|
197
|
+
#ifdef GRAPHICS_DEBUG
|
|
198
|
+
|
|
199
|
+
macro(debug);
|
|
200
|
+
|
|
201
|
+
macro(undebug);
|
|
202
|
+
|
|
203
|
+
#endif // GRAPHICS_DEBUG
|
|
204
|
+
|
|
205
|
+
inline macro(backslashcr) {
|
|
206
|
+
return macro_cr(tp, args);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**************************************** not implemented *****************************************/
|
|
210
|
+
|
|
211
|
+
inline macro(includegraphics) {
|
|
212
|
+
return nullptr;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
} // namespace microtex
|
|
216
|
+
|
|
217
|
+
#endif // MICROTEX_MACRO_MISC_H
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#include "macro/macro_scripts.h"
|
|
2
|
+
|
|
3
|
+
#include "atom/atom_basic.h"
|
|
4
|
+
#include "atom/atom_scripts.h"
|
|
5
|
+
|
|
6
|
+
namespace microtex {
|
|
7
|
+
|
|
8
|
+
using namespace std;
|
|
9
|
+
|
|
10
|
+
macro(sideset) {
|
|
11
|
+
auto l = Formula(tp, args[1])._root;
|
|
12
|
+
auto r = Formula(tp, args[2])._root;
|
|
13
|
+
auto op = Formula(tp, args[3])._root;
|
|
14
|
+
if (op == nullptr) {
|
|
15
|
+
auto in = sptrOf<CharAtom>('M', FontStyle::rm, true);
|
|
16
|
+
op = sptrOf<PhantomAtom>(in, false, true, true);
|
|
17
|
+
}
|
|
18
|
+
op->_limitsType = LimitsType::limits;
|
|
19
|
+
op->_type = AtomType::bigOperator;
|
|
20
|
+
auto cl = dynamic_cast<CumulativeScriptsAtom*>(l.get());
|
|
21
|
+
auto cr = dynamic_cast<CumulativeScriptsAtom*>(r.get());
|
|
22
|
+
if (cl != nullptr) l = cl->getScriptsAtom();
|
|
23
|
+
if (cr != nullptr) r = cr->getScriptsAtom();
|
|
24
|
+
return sptrOf<SideSetsAtom>(op, l, r);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
macro(prescript) {
|
|
28
|
+
auto base = Formula(tp, args[3])._root;
|
|
29
|
+
return sptrOf<ScriptsAtom>(base, Formula(tp, args[2])._root, Formula(tp, args[1])._root, false);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
} // namespace microtex
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#ifndef MICROTEX_MACRO_SCRIPTS_H
|
|
2
|
+
#define MICROTEX_MACRO_SCRIPTS_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom_frac.h"
|
|
5
|
+
#include "atom/atom_misc.h"
|
|
6
|
+
#include "atom/atom_sideset.h"
|
|
7
|
+
#include "macro/macro_decl.h"
|
|
8
|
+
|
|
9
|
+
namespace microtex {
|
|
10
|
+
|
|
11
|
+
macro(prescript);
|
|
12
|
+
|
|
13
|
+
macro(sideset);
|
|
14
|
+
|
|
15
|
+
} // namespace microtex
|
|
16
|
+
|
|
17
|
+
#endif // MICROTEX_MACRO_SCRIPTS_H
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#ifndef MICROTEX_MACRO_SIZES_H
|
|
2
|
+
#define MICROTEX_MACRO_SIZES_H
|
|
3
|
+
|
|
4
|
+
#include "macro/macro_decl.h"
|
|
5
|
+
|
|
6
|
+
namespace microtex {
|
|
7
|
+
|
|
8
|
+
inline macro(declaremathsizes) {
|
|
9
|
+
float a, b, c, d;
|
|
10
|
+
valueOf(args[1], a), valueOf(args[2], b), valueOf(args[3], c), valueOf(args[4], d);
|
|
11
|
+
// TODO setMathSizes(a, b, c, d);
|
|
12
|
+
return nullptr;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
inline macro(magnification) {
|
|
16
|
+
float x;
|
|
17
|
+
valueOf(args[1], x);
|
|
18
|
+
// TODO setMagnification(x);
|
|
19
|
+
return nullptr;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
inline macro(sizes) {
|
|
23
|
+
float f = 1;
|
|
24
|
+
if (args[0] == "tiny")
|
|
25
|
+
f = 0.5f;
|
|
26
|
+
else if (args[0] == "scriptsize")
|
|
27
|
+
f = 0.7f;
|
|
28
|
+
else if (args[0] == "footnotesize")
|
|
29
|
+
f = 0.8f;
|
|
30
|
+
else if (args[0] == "small")
|
|
31
|
+
f = 0.9f;
|
|
32
|
+
else if (args[0] == "normalsize")
|
|
33
|
+
f = 1.f;
|
|
34
|
+
else if (args[0] == "large")
|
|
35
|
+
f = 1.2f;
|
|
36
|
+
else if (args[0] == "Large")
|
|
37
|
+
f = 1.4f;
|
|
38
|
+
else if (args[0] == "LARGE")
|
|
39
|
+
f = 1.8f;
|
|
40
|
+
else if (args[0] == "huge")
|
|
41
|
+
f = 2.f;
|
|
42
|
+
else if (args[0] == "Huge")
|
|
43
|
+
f = 2.5f;
|
|
44
|
+
|
|
45
|
+
auto a = Formula(tp, tp.getOverArgument(), false, tp.isMathMode())._root;
|
|
46
|
+
a = a == nullptr ? sptrOf<EmptyAtom>() : a;
|
|
47
|
+
return sptrOf<ScaleAtom>(a, f);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
inline sptr<Atom>
|
|
51
|
+
_big(Parser& tp, std::vector<std::string>& args, int size, AtomType type = AtomType::none) {
|
|
52
|
+
auto a = Formula(tp, args[1], false)._root;
|
|
53
|
+
auto s = std::dynamic_pointer_cast<SymbolAtom>(a);
|
|
54
|
+
if (s == nullptr) return a;
|
|
55
|
+
auto t = sptrOf<BigSymbolAtom>(s, size);
|
|
56
|
+
if (type != AtomType::none) t->_type = type;
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
inline macro(big) {
|
|
61
|
+
return _big(tp, args, 1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
inline macro(Big) {
|
|
65
|
+
return _big(tp, args, 2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
inline macro(bigg) {
|
|
69
|
+
return _big(tp, args, 3);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
inline macro(Bigg) {
|
|
73
|
+
return _big(tp, args, 4);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
inline macro(bigl) {
|
|
77
|
+
return _big(tp, args, 1, AtomType::opening);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
inline macro(Bigl) {
|
|
81
|
+
return _big(tp, args, 2, AtomType::opening);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
inline macro(biggl) {
|
|
85
|
+
return _big(tp, args, 3, AtomType::opening);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
inline macro(Biggl) {
|
|
89
|
+
return _big(tp, args, 4, AtomType::opening);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
inline macro(bigr) {
|
|
93
|
+
return _big(tp, args, 1, AtomType::closing);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
inline macro(Bigr) {
|
|
97
|
+
return _big(tp, args, 2, AtomType::closing);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
inline macro(biggr) {
|
|
101
|
+
return _big(tp, args, 3, AtomType::closing);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
inline macro(Biggr) {
|
|
105
|
+
return _big(tp, args, 4, AtomType::closing);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
} // namespace microtex
|
|
109
|
+
|
|
110
|
+
#endif // MICROTEX_MACRO_SIZES_H
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#include "macro/macro_space.h"
|
|
2
|
+
|
|
3
|
+
namespace microtex {
|
|
4
|
+
|
|
5
|
+
macro(muskips) {
|
|
6
|
+
SpaceType type = SpaceType::none;
|
|
7
|
+
if (args[0] == ",")
|
|
8
|
+
type = SpaceType::thinMuSkip;
|
|
9
|
+
else if (args[0] == ":")
|
|
10
|
+
type = SpaceType::medMuSkip;
|
|
11
|
+
else if (args[0] == ";")
|
|
12
|
+
type = SpaceType::thickMuSkip;
|
|
13
|
+
else if (args[0] == "thinspace")
|
|
14
|
+
type = SpaceType::thinMuSkip;
|
|
15
|
+
else if (args[0] == "medspace")
|
|
16
|
+
type = SpaceType::medMuSkip;
|
|
17
|
+
else if (args[0] == "thickspace")
|
|
18
|
+
type = SpaceType::thickMuSkip;
|
|
19
|
+
else if (args[0] == "!")
|
|
20
|
+
type = SpaceType::negThinMuSkip;
|
|
21
|
+
else if (args[0] == "negthinspace")
|
|
22
|
+
type = SpaceType::negThinMuSkip;
|
|
23
|
+
else if (args[0] == "negmedspace")
|
|
24
|
+
type = SpaceType::negMedMuSkip;
|
|
25
|
+
else if (args[0] == "negthickspace")
|
|
26
|
+
type = SpaceType::negThickMuSkip;
|
|
27
|
+
|
|
28
|
+
return sptrOf<SpaceAtom>(type);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
} // namespace microtex
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#ifndef MICROTEX_MACRO_SPACE_H
|
|
2
|
+
#define MICROTEX_MACRO_SPACE_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom_space.h"
|
|
5
|
+
#include "macro/macro_decl.h"
|
|
6
|
+
|
|
7
|
+
namespace microtex {
|
|
8
|
+
|
|
9
|
+
inline macro(quad) {
|
|
10
|
+
return sptrOf<SpaceAtom>(UnitType::em, 1.f, 0.f, 0.f);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
macro(muskips);
|
|
14
|
+
|
|
15
|
+
} // namespace microtex
|
|
16
|
+
|
|
17
|
+
#endif // MICROTEX_MACRO_SPACE_H
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#include "macro/macro_styles.h"
|
|
2
|
+
|
|
3
|
+
#include "atom/atom_basic.h"
|
|
4
|
+
#include "microtex.h"
|
|
5
|
+
#include "utils/utf.h"
|
|
6
|
+
|
|
7
|
+
namespace microtex {
|
|
8
|
+
|
|
9
|
+
TexStyle texStyleOf(const std::string& str) {
|
|
10
|
+
TexStyle style = TexStyle::text;
|
|
11
|
+
if (str == "displaystyle") {
|
|
12
|
+
style = TexStyle::display;
|
|
13
|
+
} else if (str == "textstyle") {
|
|
14
|
+
style = TexStyle::text;
|
|
15
|
+
} else if (str == "scriptstyle") {
|
|
16
|
+
style = TexStyle::script;
|
|
17
|
+
} else if (str == "scriptscriptstyle") {
|
|
18
|
+
style = TexStyle::scriptScript;
|
|
19
|
+
}
|
|
20
|
+
return style;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
macro(everymath) {
|
|
24
|
+
if (args[1].empty()) {
|
|
25
|
+
MicroTeX::overrideTexStyle(false);
|
|
26
|
+
} else {
|
|
27
|
+
TexStyle style = texStyleOf(args[1].substr(1));
|
|
28
|
+
MicroTeX::overrideTexStyle(true, style);
|
|
29
|
+
}
|
|
30
|
+
return nullptr;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
macro(texstyle) {
|
|
34
|
+
auto g = Formula(tp, tp.getOverArgument(), false)._root;
|
|
35
|
+
g = g == nullptr ? sptrOf<EmptyAtom>() : g;
|
|
36
|
+
TexStyle style = texStyleOf(args[0]);
|
|
37
|
+
return sptrOf<StyleAtom>(style, g);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
macro(atexstyle) {
|
|
41
|
+
auto g = Formula(tp, args[1], false)._root;
|
|
42
|
+
return sptrOf<AStyleAtom>(args[0], g);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
} // namespace microtex
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#ifndef MICROTEX_MACRO_STYLES_H
|
|
2
|
+
#define MICROTEX_MACRO_STYLES_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom_misc.h"
|
|
5
|
+
#include "core/formula.h"
|
|
6
|
+
#include "core/parser.h"
|
|
7
|
+
#include "macro/macro.h"
|
|
8
|
+
#include "macro/macro_decl.h"
|
|
9
|
+
|
|
10
|
+
namespace microtex {
|
|
11
|
+
|
|
12
|
+
TexStyle texStyleOf(const std::string& str);
|
|
13
|
+
|
|
14
|
+
macro(everymath);
|
|
15
|
+
|
|
16
|
+
macro(texstyle);
|
|
17
|
+
|
|
18
|
+
macro(atexstyle);
|
|
19
|
+
|
|
20
|
+
} // namespace microtex
|
|
21
|
+
|
|
22
|
+
#endif // MICROTEX_MACRO_STYLES_H
|