@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,268 @@
|
|
|
1
|
+
#ifndef MICROTEX_ATOM_MATRIX_H
|
|
2
|
+
#define MICROTEX_ATOM_MATRIX_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom.h"
|
|
5
|
+
#include "atom/atom_char.h"
|
|
6
|
+
#include "atom/atom_space.h"
|
|
7
|
+
#include "box/box_group.h"
|
|
8
|
+
#include "box/box_single.h"
|
|
9
|
+
|
|
10
|
+
namespace microtex {
|
|
11
|
+
|
|
12
|
+
class ArrayFormula;
|
|
13
|
+
|
|
14
|
+
/** Atom to justify cells in array */
|
|
15
|
+
class CellSpecifier : public Atom {
|
|
16
|
+
public:
|
|
17
|
+
virtual void apply(WrapperBox& box) = 0;
|
|
18
|
+
|
|
19
|
+
sptr<Box> createBox(Env& env) override { return sptrOf<StrutBox>(0.f, 0.f, 0.f, 0.f); }
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** Atom representing column color in array */
|
|
23
|
+
class CellColorAtom : public CellSpecifier {
|
|
24
|
+
private:
|
|
25
|
+
color _color;
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
CellColorAtom() = delete;
|
|
29
|
+
|
|
30
|
+
explicit CellColorAtom(color c) : _color(c) {}
|
|
31
|
+
|
|
32
|
+
void apply(WrapperBox& box) override { box.setBackground(_color); }
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Atom representing column foreground in array */
|
|
36
|
+
class CellForegroundAtom : public CellSpecifier {
|
|
37
|
+
private:
|
|
38
|
+
color _color;
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
CellForegroundAtom() = delete;
|
|
42
|
+
|
|
43
|
+
explicit CellForegroundAtom(color c) : _color(c) {}
|
|
44
|
+
|
|
45
|
+
void apply(WrapperBox& box) override { box.setForeground(_color); }
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
class VlineAtom;
|
|
49
|
+
|
|
50
|
+
enum class MatrixType : i8 {
|
|
51
|
+
array,
|
|
52
|
+
matrix,
|
|
53
|
+
align,
|
|
54
|
+
alignAt,
|
|
55
|
+
flAlign,
|
|
56
|
+
smallMatrix,
|
|
57
|
+
aligned,
|
|
58
|
+
alignedAt
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** Atom represents matrix */
|
|
62
|
+
class MatrixAtom : public Atom {
|
|
63
|
+
private:
|
|
64
|
+
static std::map<std::string, std::string> _colspeReplacement;
|
|
65
|
+
|
|
66
|
+
static SpaceAtom _align;
|
|
67
|
+
|
|
68
|
+
sptr<ArrayFormula> _matrix;
|
|
69
|
+
std::vector<Alignment> _position;
|
|
70
|
+
std::map<int, sptr<VlineAtom>> _vlines;
|
|
71
|
+
std::map<int, sptr<Atom>> _columnSpecifiers;
|
|
72
|
+
|
|
73
|
+
MatrixType _matType;
|
|
74
|
+
bool _isPartial;
|
|
75
|
+
bool _spaceAround;
|
|
76
|
+
|
|
77
|
+
void parsePositions(std::string opt, std::vector<Alignment>& lpos);
|
|
78
|
+
|
|
79
|
+
sptr<Box> generateMulticolumn(
|
|
80
|
+
Env& env,
|
|
81
|
+
const sptr<Box>& b,
|
|
82
|
+
const float* hsep,
|
|
83
|
+
const float* colWidth,
|
|
84
|
+
int i,
|
|
85
|
+
int j
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
static void recalculateLine(
|
|
89
|
+
int rows,
|
|
90
|
+
sptr<Box>** boxarr,
|
|
91
|
+
std::vector<sptr<Atom>>& multiRows,
|
|
92
|
+
float* height,
|
|
93
|
+
float* depth,
|
|
94
|
+
float drt,
|
|
95
|
+
float vspace
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
float* getColumnSep(Env& env, float width);
|
|
99
|
+
|
|
100
|
+
void applyCell(WrapperBox& box, int i, int j);
|
|
101
|
+
|
|
102
|
+
sptr<Box> createBoxInner(Env& env);
|
|
103
|
+
|
|
104
|
+
public:
|
|
105
|
+
// The color to draw the rule of the matrix
|
|
106
|
+
static color LINE_COLOR;
|
|
107
|
+
|
|
108
|
+
static SpaceAtom _hsep, _semihsep, _vsep_in, _vsep_ext_top, _vsep_ext_bot;
|
|
109
|
+
|
|
110
|
+
static sptr<Box> _nullbox;
|
|
111
|
+
|
|
112
|
+
MatrixAtom() = delete;
|
|
113
|
+
|
|
114
|
+
MatrixAtom(
|
|
115
|
+
bool isPartial,
|
|
116
|
+
const sptr<ArrayFormula>& arr,
|
|
117
|
+
const std::string& options,
|
|
118
|
+
bool spaceAround
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
MatrixAtom(bool isPartial, const sptr<ArrayFormula>& arr, const std::string& options);
|
|
122
|
+
|
|
123
|
+
MatrixAtom(bool isPartial, const sptr<ArrayFormula>& arr, MatrixType type);
|
|
124
|
+
|
|
125
|
+
sptr<Box> createBox(Env& env) override;
|
|
126
|
+
|
|
127
|
+
static void defineColumnSpecifier(const std::string& rep, const std::string& spe);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** An atom representing vertical-line in matrix Env */
|
|
131
|
+
class VlineAtom : public Atom {
|
|
132
|
+
private:
|
|
133
|
+
// Number of lines to draw
|
|
134
|
+
int _n;
|
|
135
|
+
|
|
136
|
+
public:
|
|
137
|
+
float _height, _shift;
|
|
138
|
+
|
|
139
|
+
VlineAtom() = delete;
|
|
140
|
+
|
|
141
|
+
explicit VlineAtom(int n) : _n(n), _height(0), _shift(0) {}
|
|
142
|
+
|
|
143
|
+
float getWidth(Env& env) const;
|
|
144
|
+
|
|
145
|
+
sptr<Box> createBox(Env& env) override;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** An atom used in array mode that across several columns */
|
|
149
|
+
class MulticolumnAtom : public Atom {
|
|
150
|
+
protected:
|
|
151
|
+
// Number of columns across
|
|
152
|
+
int _n;
|
|
153
|
+
Alignment _align;
|
|
154
|
+
float _width;
|
|
155
|
+
int _beforeVlines, _afterVlines;
|
|
156
|
+
int _row, _col;
|
|
157
|
+
sptr<Atom> _cols;
|
|
158
|
+
|
|
159
|
+
Alignment parseAlign(const std::string& str);
|
|
160
|
+
|
|
161
|
+
public:
|
|
162
|
+
MulticolumnAtom() = delete;
|
|
163
|
+
|
|
164
|
+
MulticolumnAtom(int n, const std::string& align, const sptr<Atom>& cols)
|
|
165
|
+
: _width(0), _beforeVlines(0), _afterVlines(0), _row(0), _col(0) {
|
|
166
|
+
_n = n >= 1 ? n : 1;
|
|
167
|
+
_cols = cols;
|
|
168
|
+
_align = parseAlign(align);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
virtual bool isNeedWidth() const { return false; }
|
|
172
|
+
|
|
173
|
+
inline void setColWidth(float w) { _width = w; }
|
|
174
|
+
|
|
175
|
+
inline float colWidth() const { return _width; }
|
|
176
|
+
|
|
177
|
+
inline int skipped() const { return _n; }
|
|
178
|
+
|
|
179
|
+
inline bool hasRightVline() const { return _afterVlines != 0; }
|
|
180
|
+
|
|
181
|
+
inline void setRowColumn(int i, int j) {
|
|
182
|
+
_row = i;
|
|
183
|
+
_col = j;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
inline Alignment align() { return _align; }
|
|
187
|
+
|
|
188
|
+
inline int row() const { return _row; }
|
|
189
|
+
|
|
190
|
+
inline int col() const { return _col; }
|
|
191
|
+
|
|
192
|
+
sptr<Box> createBox(Env& env) override;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/** An atom used in array mode representing "dots" */
|
|
196
|
+
class HdotsforAtom : public MulticolumnAtom {
|
|
197
|
+
private:
|
|
198
|
+
float _coeff;
|
|
199
|
+
|
|
200
|
+
static sptr<Box> createBox(float space, const sptr<Box>& b, Env& env);
|
|
201
|
+
|
|
202
|
+
public:
|
|
203
|
+
HdotsforAtom() = delete;
|
|
204
|
+
|
|
205
|
+
HdotsforAtom(int n, float coeff)
|
|
206
|
+
: MulticolumnAtom(n, "c", sptrOf<CharAtom>('.', true)), _coeff(coeff) {}
|
|
207
|
+
|
|
208
|
+
bool isNeedWidth() const override { return true; }
|
|
209
|
+
|
|
210
|
+
sptr<Box> createBox(Env& env) override;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/** Atom representing multi-row */
|
|
214
|
+
class MultiRowAtom : public Atom {
|
|
215
|
+
private:
|
|
216
|
+
sptr<Atom> _rows;
|
|
217
|
+
|
|
218
|
+
public:
|
|
219
|
+
int _i, _j, _n;
|
|
220
|
+
|
|
221
|
+
MultiRowAtom() = delete;
|
|
222
|
+
|
|
223
|
+
MultiRowAtom(int n, const std::string& option, const sptr<Atom>& rows)
|
|
224
|
+
: _i(0), _j(0), _rows(rows), _n(n == 0 ? 1 : n) {}
|
|
225
|
+
|
|
226
|
+
inline void setRowColumn(int r, int c) {
|
|
227
|
+
_i = r;
|
|
228
|
+
_j = c;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
sptr<Box> createBox(Env& env) override {
|
|
232
|
+
auto b = _rows->createBox(env);
|
|
233
|
+
b->_type = AtomType::multiRow;
|
|
234
|
+
return b;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
enum class MultiLineType { multiline, gather, gathered };
|
|
239
|
+
|
|
240
|
+
/** An atom representing a vertical row of other atoms */
|
|
241
|
+
class MultlineAtom : public Atom {
|
|
242
|
+
private:
|
|
243
|
+
static SpaceAtom _vsep_in;
|
|
244
|
+
sptr<ArrayFormula> _column;
|
|
245
|
+
MultiLineType _lineType;
|
|
246
|
+
bool _isPartial;
|
|
247
|
+
|
|
248
|
+
public:
|
|
249
|
+
MultlineAtom() = delete;
|
|
250
|
+
|
|
251
|
+
MultlineAtom(bool isPartial, const sptr<ArrayFormula>& col, MultiLineType type) {
|
|
252
|
+
_isPartial = isPartial;
|
|
253
|
+
_lineType = type;
|
|
254
|
+
_column = col;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
MultlineAtom(const sptr<ArrayFormula>& col, MultiLineType type) {
|
|
258
|
+
_isPartial = false;
|
|
259
|
+
_lineType = type;
|
|
260
|
+
_column = col;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
sptr<Box> createBox(Env& env) override;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
} // namespace microtex
|
|
267
|
+
|
|
268
|
+
#endif // MICROTEX_ATOM_MATRIX_H
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
#include "atom/atom_misc.h"
|
|
2
|
+
|
|
3
|
+
#include "atom/atom_basic.h"
|
|
4
|
+
#include "atom/atom_delim.h"
|
|
5
|
+
#include "env/units.h"
|
|
6
|
+
#include "utils/string_utils.h"
|
|
7
|
+
#include "utils/utf.h"
|
|
8
|
+
|
|
9
|
+
using namespace std;
|
|
10
|
+
using namespace microtex;
|
|
11
|
+
|
|
12
|
+
sptr<Box> BigSymbolAtom::createBox(Env& env) {
|
|
13
|
+
auto b = microtex::createVDelim(_delim, env, _size);
|
|
14
|
+
const auto axis = env.mathConsts().axisHeight() * env.scale();
|
|
15
|
+
b->_shift = -(b->vlen() / 2 - b->_height) - axis;
|
|
16
|
+
return sptrOf<HBox>(b);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
LapedAtom::LapedAtom(const sptr<Atom>& a, char type) : _type(type) {
|
|
20
|
+
_at = a == nullptr ? sptrOf<EmptyAtom>() : a;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
sptr<Box> LapedAtom::createBox(Env& env) {
|
|
24
|
+
auto b = _at->createBox(env);
|
|
25
|
+
auto* vb = new VBox();
|
|
26
|
+
vb->add(b);
|
|
27
|
+
vb->_width = 0;
|
|
28
|
+
switch (_type) {
|
|
29
|
+
case 'l': b->_shift = -b->_width; break;
|
|
30
|
+
case 'r': b->_shift = 0; break;
|
|
31
|
+
default: b->_shift = -b->_width / 2; break;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return sptr<Box>(vb);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
sptr<Box> RaiseAtom::createBox(Env& env) {
|
|
38
|
+
auto base = _base->createBox(env);
|
|
39
|
+
if (_raise.isValid()) {
|
|
40
|
+
base->_shift = Units::fsize(_raise, env);
|
|
41
|
+
}
|
|
42
|
+
auto hb = sptrOf<HBox>(base);
|
|
43
|
+
if (_height.isValid()) {
|
|
44
|
+
hb->_height = Units::fsize(_height, env);
|
|
45
|
+
}
|
|
46
|
+
if (_depth.isValid()) {
|
|
47
|
+
hb->_depth = Units::fsize(_depth, env);
|
|
48
|
+
}
|
|
49
|
+
return hb;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
sptr<Box> ResizeAtom::createBox(Env& env) {
|
|
53
|
+
auto box = _base->createBox(env);
|
|
54
|
+
if (!_width.isValid() && !_height.isValid()) return box;
|
|
55
|
+
auto sx = 1.f, sy = 1.f;
|
|
56
|
+
if (_width.isValid() && _height.isValid()) {
|
|
57
|
+
sx = Units::fsize(_width, env) / box->_width;
|
|
58
|
+
sy = Units::fsize(_height, env) / box->vlen();
|
|
59
|
+
if (_keepAspectRatio) {
|
|
60
|
+
sx = std::min(sx, sy);
|
|
61
|
+
sy = sx;
|
|
62
|
+
}
|
|
63
|
+
} else if (_width.isValid() && !_height.isValid()) {
|
|
64
|
+
sx = Units::fsize(_width, env) / box->_width;
|
|
65
|
+
sy = sx;
|
|
66
|
+
} else {
|
|
67
|
+
sy = Units::fsize(_height, env) / box->vlen();
|
|
68
|
+
sx = sy;
|
|
69
|
+
}
|
|
70
|
+
return sptrOf<ScaleBox>(box, sx, sy);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
RotateAtom::RotateAtom(const sptr<Atom>& base, float angle, const string& option)
|
|
74
|
+
: _angle(0), _option(Rotation::bl) {
|
|
75
|
+
_base = base == nullptr ? sptrOf<EmptyAtom>() : base;
|
|
76
|
+
_type = _base->_type;
|
|
77
|
+
_angle = angle;
|
|
78
|
+
const auto& opt = parseOption(option);
|
|
79
|
+
auto it = opt.find("origin");
|
|
80
|
+
if (it != opt.end()) {
|
|
81
|
+
_option = RotateBox::getOrigin(it->second);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
it = opt.find("x");
|
|
85
|
+
if (it != opt.end()) {
|
|
86
|
+
_x = Units::getDimen(it->second);
|
|
87
|
+
} else {
|
|
88
|
+
_x = 0._em;
|
|
89
|
+
}
|
|
90
|
+
it = opt.find("y");
|
|
91
|
+
if (it != opt.end()) {
|
|
92
|
+
_y = Units::getDimen(it->second);
|
|
93
|
+
} else {
|
|
94
|
+
_y = 0._em;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
RotateAtom::RotateAtom(const sptr<Atom>& base, const string& angle, const string& option)
|
|
99
|
+
: _angle(0), _option(Rotation::none), _x(0._em), _y(0._em) {
|
|
100
|
+
_type = base->_type;
|
|
101
|
+
_base = base;
|
|
102
|
+
valueOf(angle, _angle);
|
|
103
|
+
_option = RotateBox::getOrigin(option);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
sptr<Box> RotateAtom::createBox(Env& env) {
|
|
107
|
+
if (_option != Rotation::none) {
|
|
108
|
+
return sptrOf<RotateBox>(_base->createBox(env), _angle, _option);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const auto x = Units::fsize(_x, env);
|
|
112
|
+
const auto y = Units::fsize(_y, env);
|
|
113
|
+
return sptrOf<RotateBox>(_base->createBox(env), _angle, x, y);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
sptr<Box> RuleAtom::createBox(Env& env) {
|
|
117
|
+
float w = Units::fsize(_w, env);
|
|
118
|
+
float h = Units::fsize(_h, env);
|
|
119
|
+
float r = Units::fsize(_r, env);
|
|
120
|
+
return sptrOf<RuleBox>(h, w, r);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
sptr<Box> StrikeThroughAtom::createBox(Env& env) {
|
|
124
|
+
const auto t = env.mathConsts().overbarRuleThickness() * env.scale();
|
|
125
|
+
const auto h = env.mathConsts().axisHeight() * env.scale();
|
|
126
|
+
auto b = _at->createBox(env);
|
|
127
|
+
auto r = sptrOf<RuleBox>(t, b->_width, -h + t);
|
|
128
|
+
auto hb = sptrOf<HBox>(b);
|
|
129
|
+
hb->add(StrutBox::create(-b->_width));
|
|
130
|
+
hb->add(r);
|
|
131
|
+
return hb;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
sptr<Box> VCenterAtom::createBox(Env& env) {
|
|
135
|
+
auto b = _base->createBox(env);
|
|
136
|
+
auto a = env.mathConsts().axisHeight() * env.scale();
|
|
137
|
+
auto hb = sptrOf<HBox>(b);
|
|
138
|
+
hb->_height = b->vlen() / 2 + a;
|
|
139
|
+
hb->_depth = b->vlen() - hb->_height;
|
|
140
|
+
return hb;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
LongDivAtom::LongDivAtom(long divisor, long dividend) : _divisor(divisor), _dividend(dividend) {
|
|
144
|
+
_halign = Alignment::right;
|
|
145
|
+
setAlignTop(true);
|
|
146
|
+
vector<string> results;
|
|
147
|
+
calculate(results);
|
|
148
|
+
|
|
149
|
+
auto rule = sptrOf<RuleAtom>(0._ex, 2.5_ex, 0.3_ex);
|
|
150
|
+
|
|
151
|
+
const int s = results.size();
|
|
152
|
+
for (int i = 0; i < s; i++) {
|
|
153
|
+
auto num = Formula(results[i])._root;
|
|
154
|
+
if (i == 1) {
|
|
155
|
+
string divisor = toString(_divisor);
|
|
156
|
+
auto rparen = SymbolAtom::get("rparen");
|
|
157
|
+
auto big = sptrOf<BigSymbolAtom>(rparen, 1);
|
|
158
|
+
auto raise = sptrOf<RaiseAtom>(big, -1._tt, 0._tt, 0._tt);
|
|
159
|
+
auto row = sptrOf<RowAtom>(raise);
|
|
160
|
+
row->add(num);
|
|
161
|
+
auto o = sptrOf<OverUnderBar>(row, true);
|
|
162
|
+
auto r = sptrOf<RowAtom>(Formula(divisor, false)._root);
|
|
163
|
+
r->add(sptrOf<SpaceAtom>(SpaceType::thinMuSkip));
|
|
164
|
+
r->add(o);
|
|
165
|
+
append(r);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (i % 2 == 0) {
|
|
169
|
+
auto row = sptrOf<RowAtom>(num);
|
|
170
|
+
row->add(rule);
|
|
171
|
+
if (i == 0)
|
|
172
|
+
append(row);
|
|
173
|
+
else
|
|
174
|
+
append(sptrOf<OverUnderBar>(row, false));
|
|
175
|
+
} else {
|
|
176
|
+
auto row = sptrOf<RowAtom>(num);
|
|
177
|
+
row->add(rule);
|
|
178
|
+
append(row);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
void LongDivAtom::calculate(vector<string>& results) const {
|
|
184
|
+
long quotient = _dividend / _divisor;
|
|
185
|
+
results.push_back(toString(quotient));
|
|
186
|
+
string x = toString(quotient);
|
|
187
|
+
size_t len = x.length();
|
|
188
|
+
long remaining = _dividend;
|
|
189
|
+
results.push_back(toString(remaining));
|
|
190
|
+
for (size_t i = 0; i < len; i++) {
|
|
191
|
+
long b = (x[i] - '0') * pow(10, len - i - 1);
|
|
192
|
+
long product = b * _divisor;
|
|
193
|
+
remaining = remaining - product;
|
|
194
|
+
results.push_back(toString(product));
|
|
195
|
+
results.push_back(toString(remaining));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
sptr<Box> CancelAtom::createBox(Env& env) {
|
|
200
|
+
auto box = _base->createBox(env);
|
|
201
|
+
vector<float> lines;
|
|
202
|
+
if (_cancelType == SLASH) {
|
|
203
|
+
lines = {0, 0, box->_width, box->_height + box->_depth};
|
|
204
|
+
} else if (_cancelType == BACKSLASH) {
|
|
205
|
+
lines = {box->_width, 0, 0, box->_height + box->_depth};
|
|
206
|
+
} else if (_cancelType == CROSS) {
|
|
207
|
+
lines = {
|
|
208
|
+
0,
|
|
209
|
+
0,
|
|
210
|
+
box->_width,
|
|
211
|
+
box->_height + box->_depth,
|
|
212
|
+
box->_width,
|
|
213
|
+
0,
|
|
214
|
+
0,
|
|
215
|
+
box->_height + box->_depth,
|
|
216
|
+
};
|
|
217
|
+
} else {
|
|
218
|
+
return box;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const float rt = env.mathConsts().fractionRuleThickness() * env.scale();
|
|
222
|
+
auto overlap = sptrOf<LineBox>(lines, rt);
|
|
223
|
+
overlap->_width = box->_width;
|
|
224
|
+
overlap->_height = box->_height;
|
|
225
|
+
overlap->_depth = box->_depth;
|
|
226
|
+
auto hbox = new HBox(box);
|
|
227
|
+
hbox->add(sptr<Box>(new StrutBox(-box->_width, 0, 0, 0)));
|
|
228
|
+
hbox->add(overlap);
|
|
229
|
+
return sptr<Box>(hbox);
|
|
230
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#ifndef MICROTEX_ATOM_MISC_H
|
|
2
|
+
#define MICROTEX_ATOM_MISC_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom.h"
|
|
5
|
+
#include "atom/atom_basic.h"
|
|
6
|
+
#include "atom/atom_char.h"
|
|
7
|
+
#include "atom/atom_vrow.h"
|
|
8
|
+
#include "box/box_factory.h"
|
|
9
|
+
#include "box/box_group.h"
|
|
10
|
+
#include "core/formula.h"
|
|
11
|
+
#include "core/split.h"
|
|
12
|
+
#include "env/env.h"
|
|
13
|
+
#include "env/units.h"
|
|
14
|
+
#include "graphic/graphic.h"
|
|
15
|
+
|
|
16
|
+
namespace microtex {
|
|
17
|
+
|
|
18
|
+
/** An atom representing a big symbol atom (i.e. sigma) */
|
|
19
|
+
class BigSymbolAtom : public Atom {
|
|
20
|
+
private:
|
|
21
|
+
int _size;
|
|
22
|
+
|
|
23
|
+
public:
|
|
24
|
+
const sptr<SymbolAtom> _delim;
|
|
25
|
+
|
|
26
|
+
BigSymbolAtom() = delete;
|
|
27
|
+
|
|
28
|
+
BigSymbolAtom(const sptr<SymbolAtom>& delim, int size) : _delim(delim), _size(size) {}
|
|
29
|
+
|
|
30
|
+
AtomType leftType() const override { return _delim->leftType(); }
|
|
31
|
+
|
|
32
|
+
AtomType rightType() const override { return _delim->rightType(); }
|
|
33
|
+
|
|
34
|
+
sptr<Box> createBox(Env& env) override;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** An atom representing a lapped atom (i.e. with no width) */
|
|
38
|
+
class LapedAtom : public Atom {
|
|
39
|
+
private:
|
|
40
|
+
sptr<Atom> _at;
|
|
41
|
+
char _type;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
LapedAtom() = delete;
|
|
45
|
+
|
|
46
|
+
LapedAtom(const sptr<Atom>& a, char type);
|
|
47
|
+
|
|
48
|
+
sptr<Box> createBox(Env& env) override;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
class RaiseAtom : public Atom {
|
|
52
|
+
private:
|
|
53
|
+
sptr<Atom> _base;
|
|
54
|
+
Dimen _raise, _height, _depth;
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
RaiseAtom() = delete;
|
|
58
|
+
|
|
59
|
+
RaiseAtom(const sptr<Atom>& base, Dimen raise, Dimen height, Dimen depth)
|
|
60
|
+
: _base(base), _raise(raise), _height(height), _depth(depth) {}
|
|
61
|
+
|
|
62
|
+
AtomType leftType() const override { return _base->leftType(); }
|
|
63
|
+
|
|
64
|
+
AtomType rightType() const override { return _base->rightType(); }
|
|
65
|
+
|
|
66
|
+
sptr<Box> createBox(Env& env) override;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** An atom representing a reflected atom */
|
|
70
|
+
class ReflectAtom : public Atom {
|
|
71
|
+
private:
|
|
72
|
+
sptr<Atom> _base;
|
|
73
|
+
|
|
74
|
+
public:
|
|
75
|
+
ReflectAtom() = delete;
|
|
76
|
+
|
|
77
|
+
explicit ReflectAtom(const sptr<Atom>& base) : _base(base) { _type = _base->_type; }
|
|
78
|
+
|
|
79
|
+
sptr<Box> createBox(Env& env) override { return sptrOf<ReflectBox>(_base->createBox(env)); }
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** An atom representing a resize operation on given atom */
|
|
83
|
+
class ResizeAtom : public Atom {
|
|
84
|
+
private:
|
|
85
|
+
sptr<Atom> _base;
|
|
86
|
+
Dimen _width, _height;
|
|
87
|
+
bool _keepAspectRatio;
|
|
88
|
+
|
|
89
|
+
public:
|
|
90
|
+
ResizeAtom() = delete;
|
|
91
|
+
|
|
92
|
+
ResizeAtom(
|
|
93
|
+
const sptr<Atom>& base,
|
|
94
|
+
const std::string& ws,
|
|
95
|
+
const std::string& hs,
|
|
96
|
+
bool keepAspectRatio
|
|
97
|
+
) {
|
|
98
|
+
const sptr<Atom>& xbase = base == nullptr ? sptrOf<EmptyAtom>() : base;
|
|
99
|
+
_type = xbase->_type;
|
|
100
|
+
_base = xbase;
|
|
101
|
+
_keepAspectRatio = keepAspectRatio;
|
|
102
|
+
_width = Units::getDimen(ws);
|
|
103
|
+
_height = Units::getDimen(hs);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
AtomType leftType() const override { return _base->leftType(); }
|
|
107
|
+
|
|
108
|
+
AtomType rightType() const override { return _base->rightType(); }
|
|
109
|
+
|
|
110
|
+
sptr<Box> createBox(Env& env) override;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** An atom representing a rotated atom */
|
|
114
|
+
class RotateAtom : public Atom {
|
|
115
|
+
private:
|
|
116
|
+
sptr<Atom> _base;
|
|
117
|
+
float _angle;
|
|
118
|
+
Rotation _option;
|
|
119
|
+
Dimen _x, _y;
|
|
120
|
+
|
|
121
|
+
public:
|
|
122
|
+
RotateAtom() = delete;
|
|
123
|
+
|
|
124
|
+
RotateAtom(const sptr<Atom>& base, const std::string& angle, const std::string& option);
|
|
125
|
+
|
|
126
|
+
RotateAtom(const sptr<Atom>& base, float angle, const std::string& option);
|
|
127
|
+
|
|
128
|
+
sptr<Box> createBox(Env& env) override;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
class RuleAtom : public Atom {
|
|
132
|
+
private:
|
|
133
|
+
Dimen _w, _h, _r;
|
|
134
|
+
|
|
135
|
+
public:
|
|
136
|
+
RuleAtom() = delete;
|
|
137
|
+
|
|
138
|
+
RuleAtom(const Dimen& w, const Dimen& h, const Dimen& r) : _w(w), _h(h), _r(r) {}
|
|
139
|
+
|
|
140
|
+
sptr<Box> createBox(Env& env) override;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/** An atom representing a strike through atom */
|
|
144
|
+
class StrikeThroughAtom : public Atom {
|
|
145
|
+
private:
|
|
146
|
+
sptr<Atom> _at;
|
|
147
|
+
|
|
148
|
+
public:
|
|
149
|
+
explicit StrikeThroughAtom(const sptr<Atom>& a) {
|
|
150
|
+
_at = a == nullptr ? sptrOf<EmptyAtom>() : a;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
sptr<Box> createBox(Env& env) override;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* An atom representing another atom vertically centered with respect to
|
|
158
|
+
* the math axis
|
|
159
|
+
*/
|
|
160
|
+
class VCenterAtom : public WrapAtom {
|
|
161
|
+
public:
|
|
162
|
+
VCenterAtom() = delete;
|
|
163
|
+
|
|
164
|
+
explicit VCenterAtom(const sptr<Atom>& a) : WrapAtom(a) {}
|
|
165
|
+
|
|
166
|
+
sptr<Box> createBox(Env& env) override;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/** An atom representing long division */
|
|
170
|
+
class LongDivAtom : public VRowAtom {
|
|
171
|
+
private:
|
|
172
|
+
long _divisor, _dividend;
|
|
173
|
+
|
|
174
|
+
void calculate(std::vector<std::string>& results) const;
|
|
175
|
+
|
|
176
|
+
public:
|
|
177
|
+
LongDivAtom() = delete;
|
|
178
|
+
|
|
179
|
+
LongDivAtom(long divisor, long dividend);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/** An atom representing an atom with lines covered */
|
|
183
|
+
class CancelAtom : public Atom {
|
|
184
|
+
private:
|
|
185
|
+
sptr<Atom> _base;
|
|
186
|
+
int _cancelType;
|
|
187
|
+
|
|
188
|
+
public:
|
|
189
|
+
enum CancelType { SLASH, BACKSLASH, CROSS };
|
|
190
|
+
|
|
191
|
+
CancelAtom() = delete;
|
|
192
|
+
|
|
193
|
+
CancelAtom(const sptr<Atom>& base, int cancelType) : _base(base), _cancelType(cancelType) {}
|
|
194
|
+
|
|
195
|
+
sptr<Box> createBox(Env& env) override;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
} // namespace microtex
|
|
199
|
+
|
|
200
|
+
#endif // MICROTEX_ATOM_MISC_H
|