@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,273 @@
|
|
|
1
|
+
#ifndef MICROTEX_ATOM_BASIC_H
|
|
2
|
+
#define MICROTEX_ATOM_BASIC_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom.h"
|
|
5
|
+
#include "atom/atom_row.h"
|
|
6
|
+
#include "box/box_single.h"
|
|
7
|
+
#include "unimath/math_type.h"
|
|
8
|
+
|
|
9
|
+
namespace microtex {
|
|
10
|
+
|
|
11
|
+
class Formula;
|
|
12
|
+
|
|
13
|
+
/** Atom to mark do not add kern between */
|
|
14
|
+
class NokernAtom : public Atom {
|
|
15
|
+
public:
|
|
16
|
+
NokernAtom() { _type = AtomType::none; }
|
|
17
|
+
|
|
18
|
+
sptr<Box> createBox(Env& env) override { return StrutBox::empty(); }
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* An atom representing a modification of style in a formula
|
|
23
|
+
* (e.g. text-style or display-style)
|
|
24
|
+
*/
|
|
25
|
+
class StyleAtom : public WrapAtom {
|
|
26
|
+
private:
|
|
27
|
+
TexStyle _style;
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
StyleAtom() = delete;
|
|
31
|
+
|
|
32
|
+
StyleAtom(TexStyle style, const sptr<Atom>& a) : _style(style), WrapAtom(a) {}
|
|
33
|
+
|
|
34
|
+
sptr<Box> createBox(Env& env) override;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An atom representing a modification of style in a formula
|
|
39
|
+
* relative to current style
|
|
40
|
+
*/
|
|
41
|
+
class AStyleAtom : public WrapAtom {
|
|
42
|
+
private:
|
|
43
|
+
std::string _name;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
AStyleAtom() = delete;
|
|
47
|
+
|
|
48
|
+
AStyleAtom(std::string name, const sptr<Atom>& a) : _name(std::move(name)), WrapAtom(a) {}
|
|
49
|
+
|
|
50
|
+
sptr<Box> createBox(Env& env) override;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** An empty atom */
|
|
54
|
+
class EmptyAtom : public Atom {
|
|
55
|
+
public:
|
|
56
|
+
sptr<Box> createBox(Env& env) override { return StrutBox::empty(); }
|
|
57
|
+
|
|
58
|
+
static sptr<EmptyAtom> create() { return sptrOf<EmptyAtom>(); }
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** A placeholder atom */
|
|
62
|
+
class PlaceholderAtom : public Atom {
|
|
63
|
+
private:
|
|
64
|
+
sptr<Box> _box;
|
|
65
|
+
float _italic;
|
|
66
|
+
|
|
67
|
+
public:
|
|
68
|
+
PlaceholderAtom(float width, float height, float depth, float italic = 0.f) : _italic(italic) {
|
|
69
|
+
_box = sptrOf<StrutBox>(width, height, depth, 0.f);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
PlaceholderAtom(const sptr<Box>& box, float italic = 0.f) : _box(box), _italic(italic) {}
|
|
73
|
+
|
|
74
|
+
sptr<Box> createBox(Env& env) override { return _box; }
|
|
75
|
+
|
|
76
|
+
inline float italic() const { return _italic; }
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** An atom representing a smashed atom (i.e. with no height and no depth) */
|
|
80
|
+
class SmashedAtom : public WrapAtom {
|
|
81
|
+
private:
|
|
82
|
+
bool _h, _d;
|
|
83
|
+
|
|
84
|
+
public:
|
|
85
|
+
SmashedAtom() = delete;
|
|
86
|
+
|
|
87
|
+
SmashedAtom(const sptr<Atom>& a, const std::string& opt) : _h(true), _d(true), WrapAtom(a) {
|
|
88
|
+
if (opt == "opt")
|
|
89
|
+
_d = false;
|
|
90
|
+
else if (opt == "b")
|
|
91
|
+
_h = false;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
explicit SmashedAtom(const sptr<Atom>& a) : _h(true), _d(true), WrapAtom(a) {}
|
|
95
|
+
|
|
96
|
+
sptr<Box> createBox(Env& env) override;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** An atom representing a scaled atom */
|
|
100
|
+
class ScaleAtom : public WrapAtom {
|
|
101
|
+
private:
|
|
102
|
+
float _sx, _sy;
|
|
103
|
+
|
|
104
|
+
public:
|
|
105
|
+
ScaleAtom() = delete;
|
|
106
|
+
|
|
107
|
+
ScaleAtom(const sptr<Atom>& base, float sx, float sy) noexcept
|
|
108
|
+
: WrapAtom(base), _sx(sx), _sy(sy) {}
|
|
109
|
+
|
|
110
|
+
ScaleAtom(const sptr<Atom>& base, float scale) : ScaleAtom(base, scale, scale) {}
|
|
111
|
+
|
|
112
|
+
sptr<Box> createBox(Env& env) override;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** An atom representing a math atom */
|
|
116
|
+
class MathAtom : public WrapAtom {
|
|
117
|
+
private:
|
|
118
|
+
TexStyle _style;
|
|
119
|
+
|
|
120
|
+
public:
|
|
121
|
+
MathAtom() = delete;
|
|
122
|
+
|
|
123
|
+
MathAtom(const sptr<Atom>& base, TexStyle style) noexcept : _style(style), WrapAtom(base) {}
|
|
124
|
+
|
|
125
|
+
sptr<Box> createBox(Env& env) override;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** An atom representing a horizontal-line in array environment */
|
|
129
|
+
class HlineAtom : public Atom {
|
|
130
|
+
private:
|
|
131
|
+
float _width, _shift;
|
|
132
|
+
color _color;
|
|
133
|
+
|
|
134
|
+
public:
|
|
135
|
+
HlineAtom() noexcept : _color(transparent), _width(0), _shift(0) { _type = AtomType::hline; }
|
|
136
|
+
|
|
137
|
+
inline void setWidth(float w) { _width = w; }
|
|
138
|
+
|
|
139
|
+
inline void setShift(float s) { _shift = s; }
|
|
140
|
+
|
|
141
|
+
inline void setColor(color c) { _color = c; }
|
|
142
|
+
|
|
143
|
+
sptr<Box> createBox(Env& env) override;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** An atom representing a cumulative scripts atom */
|
|
147
|
+
class CumulativeScriptsAtom : public Atom {
|
|
148
|
+
private:
|
|
149
|
+
sptr<Atom> _base;
|
|
150
|
+
sptr<RowAtom> _sup, _sub;
|
|
151
|
+
|
|
152
|
+
public:
|
|
153
|
+
CumulativeScriptsAtom() = delete;
|
|
154
|
+
|
|
155
|
+
CumulativeScriptsAtom(const sptr<Atom>& base, const sptr<Atom>& sub, const sptr<Atom>& sup);
|
|
156
|
+
|
|
157
|
+
void addSuperscript(const sptr<Atom>& sup);
|
|
158
|
+
|
|
159
|
+
void addSubscript(const sptr<Atom>& sub);
|
|
160
|
+
|
|
161
|
+
sptr<Atom> getScriptsAtom() const;
|
|
162
|
+
|
|
163
|
+
sptr<Box> createBox(Env& env) override;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/** An atom representing the foreground and background color of an other atom */
|
|
167
|
+
class ColorAtom : public Atom, public Row {
|
|
168
|
+
private:
|
|
169
|
+
static std::map<std::string, color> _colors;
|
|
170
|
+
static const color _default;
|
|
171
|
+
|
|
172
|
+
color _background, _color;
|
|
173
|
+
// RowAtom for which the color settings apply
|
|
174
|
+
sptr<RowAtom> _elements;
|
|
175
|
+
|
|
176
|
+
public:
|
|
177
|
+
ColorAtom() = delete;
|
|
178
|
+
|
|
179
|
+
ColorAtom(const sptr<Atom>& atom, color bg, color c);
|
|
180
|
+
|
|
181
|
+
sptr<Box> createBox(Env& env) override;
|
|
182
|
+
|
|
183
|
+
AtomType leftType() const override { return _elements->leftType(); }
|
|
184
|
+
|
|
185
|
+
AtomType rightType() const override { return _elements->rightType(); }
|
|
186
|
+
|
|
187
|
+
void setPreviousAtom(const sptr<AtomDecor>& prev) override { _elements->setPreviousAtom(prev); }
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Parse color from given name. The name can be one of the following format:
|
|
191
|
+
* [#AARRGGBB] or [AARRGGBB], [gray color], [c,m,y,k], [c;m;y;k], [r,g,b], [r;g;b]
|
|
192
|
+
* or a predefined color name. Return black if not found.
|
|
193
|
+
*/
|
|
194
|
+
static color getColor(std::string name);
|
|
195
|
+
|
|
196
|
+
/** Define a color with given name */
|
|
197
|
+
static void defineColor(const std::string& name, color c);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/** An atom representing another atom that should be drawn invisibly */
|
|
201
|
+
class PhantomAtom : public Atom, public Row {
|
|
202
|
+
private:
|
|
203
|
+
sptr<RowAtom> _elements;
|
|
204
|
+
// if show with width, height or depth
|
|
205
|
+
bool _w, _h, _d;
|
|
206
|
+
|
|
207
|
+
public:
|
|
208
|
+
PhantomAtom() = delete;
|
|
209
|
+
|
|
210
|
+
explicit PhantomAtom(const sptr<Atom>& el);
|
|
211
|
+
|
|
212
|
+
PhantomAtom(const sptr<Atom>& el, bool w, bool h, bool d);
|
|
213
|
+
|
|
214
|
+
AtomType leftType() const override { return _elements->leftType(); }
|
|
215
|
+
|
|
216
|
+
AtomType rightType() const override { return _elements->rightType(); }
|
|
217
|
+
|
|
218
|
+
void setPreviousAtom(const sptr<AtomDecor>& prev) override { _elements->setPreviousAtom(prev); }
|
|
219
|
+
|
|
220
|
+
sptr<Box> createBox(Env& env) override;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* An atom representing another atom with an override left-type and right-type
|
|
225
|
+
* this affects the glue inserted before and after this atom.
|
|
226
|
+
*/
|
|
227
|
+
class TypedAtom : public Atom {
|
|
228
|
+
private:
|
|
229
|
+
// override left-type and right-type
|
|
230
|
+
AtomType _leftType, _rightType;
|
|
231
|
+
// atom for which new types are set
|
|
232
|
+
sptr<Atom> _atom;
|
|
233
|
+
|
|
234
|
+
public:
|
|
235
|
+
TypedAtom() = delete;
|
|
236
|
+
|
|
237
|
+
TypedAtom(AtomType lt, AtomType rt, const sptr<Atom>& atom)
|
|
238
|
+
: _leftType(lt), _rightType(rt), _atom(atom) {
|
|
239
|
+
_limitsType = atom->_limitsType;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
sptr<Atom> base() {
|
|
243
|
+
_atom->_limitsType = _limitsType;
|
|
244
|
+
return _atom;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
sptr<Box> createBox(Env& env) override { return _atom->createBox(env); }
|
|
248
|
+
|
|
249
|
+
AtomType leftType() const override { return _leftType; }
|
|
250
|
+
|
|
251
|
+
AtomType rightType() const override { return _rightType; }
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
class ExtensibleAtom : public Atom {
|
|
255
|
+
private:
|
|
256
|
+
std::string _sym;
|
|
257
|
+
bool _vertical;
|
|
258
|
+
std::function<float(const Env&)> _getLen;
|
|
259
|
+
|
|
260
|
+
public:
|
|
261
|
+
explicit ExtensibleAtom(
|
|
262
|
+
std::string sym,
|
|
263
|
+
std::function<float(const Env&)>&& getLen,
|
|
264
|
+
bool isVertical = false
|
|
265
|
+
)
|
|
266
|
+
: _sym(std::move(sym)), _getLen(getLen), _vertical(isVertical) {}
|
|
267
|
+
|
|
268
|
+
sptr<Box> createBox(Env& env) override;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
} // namespace microtex
|
|
272
|
+
|
|
273
|
+
#endif // MICROTEX_ATOM_BASIC_H
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#include "atom/atom_box.h"
|
|
2
|
+
|
|
3
|
+
#include "box/box_group.h"
|
|
4
|
+
#include "box/box_single.h"
|
|
5
|
+
#include "env/env.h"
|
|
6
|
+
#include "env/units.h"
|
|
7
|
+
|
|
8
|
+
using namespace microtex;
|
|
9
|
+
|
|
10
|
+
float OvalAtom::_multiplier = 0.5f;
|
|
11
|
+
float OvalAtom::_diameter = 0.f;
|
|
12
|
+
|
|
13
|
+
sptr<Box> FBoxAtom::createBox(Env& env) {
|
|
14
|
+
auto base = _base->createBox(env);
|
|
15
|
+
auto t = env.mathConsts().fractionRuleThickness() * env.scale();
|
|
16
|
+
auto space = Units::fsize(0.5_em, env);
|
|
17
|
+
if (isTransparent(_bg)) return sptrOf<FramedBox>(base, t, space);
|
|
18
|
+
return sptrOf<FramedBox>(base, t, space, _line, _bg);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
sptr<Box> DoubleFramedAtom::createBox(Env& env) {
|
|
22
|
+
auto base = _base->createBox(env);
|
|
23
|
+
auto t = env.mathConsts().fractionRuleThickness() * env.scale();
|
|
24
|
+
auto space = Units::fsize(0.5_em, env);
|
|
25
|
+
auto sspace = 1.5f * t + Units::fsize(1._pt, env);
|
|
26
|
+
auto inner = sptrOf<FramedBox>(base, 0.75f * t, space);
|
|
27
|
+
return sptrOf<FramedBox>(inner, 1.5f * t, sspace);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
sptr<Box> ShadowAtom::createBox(Env& env) {
|
|
31
|
+
auto x = FBoxAtom::createBox(env);
|
|
32
|
+
auto b = std::static_pointer_cast<FramedBox>(x);
|
|
33
|
+
float t = env.mathConsts().fractionRuleThickness() * env.scale() * 3;
|
|
34
|
+
return sptrOf<ShadowBox>(b, t);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
sptr<Box> OvalAtom::createBox(Env& env) {
|
|
38
|
+
auto x = FBoxAtom::createBox(env);
|
|
39
|
+
auto b = std::static_pointer_cast<FramedBox>(x);
|
|
40
|
+
return sptrOf<OvalBox>(b, _multiplier, _diameter);
|
|
41
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#ifndef MICROTEX_ATOM_BOX_H
|
|
2
|
+
#define MICROTEX_ATOM_BOX_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom.h"
|
|
5
|
+
#include "atom/atom_row.h"
|
|
6
|
+
#include "graphic/graphic_basic.h"
|
|
7
|
+
|
|
8
|
+
namespace microtex {
|
|
9
|
+
|
|
10
|
+
/** An atom representing a boxed base atom */
|
|
11
|
+
class FBoxAtom : public Atom {
|
|
12
|
+
protected:
|
|
13
|
+
sptr<Atom> _base;
|
|
14
|
+
color _bg, _line;
|
|
15
|
+
|
|
16
|
+
public:
|
|
17
|
+
FBoxAtom() = delete;
|
|
18
|
+
|
|
19
|
+
explicit FBoxAtom(const sptr<Atom>& base, color bg = TRANSPARENT, color line = TRANSPARENT) {
|
|
20
|
+
if (base == nullptr)
|
|
21
|
+
_base = sptrOf<RowAtom>();
|
|
22
|
+
else {
|
|
23
|
+
_base = base;
|
|
24
|
+
_type = base->_type;
|
|
25
|
+
}
|
|
26
|
+
_bg = bg;
|
|
27
|
+
_line = line;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
sptr<Box> createBox(Env& env) override;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** An atom representing a boxed base atom */
|
|
34
|
+
class DoubleFramedAtom : public FBoxAtom {
|
|
35
|
+
public:
|
|
36
|
+
DoubleFramedAtom() = delete;
|
|
37
|
+
|
|
38
|
+
explicit DoubleFramedAtom(const sptr<Atom>& base) : FBoxAtom(base) {}
|
|
39
|
+
|
|
40
|
+
sptr<Box> createBox(Env& env) override;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** An atom representing a box-shadowed atom */
|
|
44
|
+
class ShadowAtom : public FBoxAtom {
|
|
45
|
+
public:
|
|
46
|
+
ShadowAtom() = delete;
|
|
47
|
+
|
|
48
|
+
explicit ShadowAtom(const sptr<Atom>& base) : FBoxAtom(base) {}
|
|
49
|
+
|
|
50
|
+
sptr<Box> createBox(Env& env) override;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* An atom representing a oval-boxed base atom
|
|
55
|
+
*/
|
|
56
|
+
class OvalAtom : public FBoxAtom {
|
|
57
|
+
public:
|
|
58
|
+
static float _multiplier;
|
|
59
|
+
static float _diameter;
|
|
60
|
+
|
|
61
|
+
OvalAtom() = delete;
|
|
62
|
+
|
|
63
|
+
explicit OvalAtom(const sptr<Atom>& base) : FBoxAtom(base) {}
|
|
64
|
+
|
|
65
|
+
sptr<Box> createBox(Env& env) override;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
} // namespace microtex
|
|
69
|
+
|
|
70
|
+
#endif // MICROTEX_ATOM_BOX_H
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#include "atom/atom_char.h"
|
|
2
|
+
|
|
3
|
+
#include "box/box_single.h"
|
|
4
|
+
#include "core/split.h"
|
|
5
|
+
#include "env/env.h"
|
|
6
|
+
#include "utils/utf.h"
|
|
7
|
+
|
|
8
|
+
using namespace microtex;
|
|
9
|
+
using namespace std;
|
|
10
|
+
|
|
11
|
+
std::string FixedCharAtom::name() const {
|
|
12
|
+
// TODO name?
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
sptr<Box> FixedCharAtom::createBox(Env& env) {
|
|
17
|
+
return sptrOf<CharBox>(_chr);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
sptr<SymbolAtom> SymbolAtom::get(const std::string& name) {
|
|
21
|
+
const auto symbol = Symbol::get(name.c_str());
|
|
22
|
+
return symbol == nullptr ? nullptr : sptrOf<SymbolAtom>(symbol);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
SymbolAtom::SymbolAtom(const Symbol* symbol) noexcept : _symbol(symbol) {
|
|
26
|
+
if (_symbol == nullptr) {
|
|
27
|
+
_type = AtomType::none;
|
|
28
|
+
} else {
|
|
29
|
+
_type = _symbol->type();
|
|
30
|
+
_limitsType = _symbol->limitsType();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
c32 SymbolAtom::unicode() const {
|
|
35
|
+
return _symbol == nullptr ? 0 : _symbol->unicode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
string SymbolAtom::name() const {
|
|
39
|
+
return _symbol == nullptr ? "" : _symbol->name;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
bool SymbolAtom::isValid() const {
|
|
43
|
+
return _symbol != nullptr;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
Char SymbolAtom::getChar(Env& env) const {
|
|
47
|
+
if (_symbol == nullptr) return {};
|
|
48
|
+
if (env.style() >= TexStyle::script) {
|
|
49
|
+
const auto& chr = env.getChar(*_symbol);
|
|
50
|
+
return chr.script(0);
|
|
51
|
+
}
|
|
52
|
+
if (_type == AtomType::bigOperator) {
|
|
53
|
+
const auto& chr = env.getChar(*_symbol);
|
|
54
|
+
return env.style() < TexStyle::text ? chr.vLarger(1) : chr;
|
|
55
|
+
}
|
|
56
|
+
return env.getChar(*_symbol);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
sptr<Box> SymbolAtom::createBox(Env& env) {
|
|
60
|
+
const auto& chr = getChar(env);
|
|
61
|
+
if (_type == AtomType::bigOperator) {
|
|
62
|
+
auto box = sptrOf<CharBox>(chr);
|
|
63
|
+
const auto axis = env.axisHeight();
|
|
64
|
+
box->_shift = (box->_height - box->_depth) / 2 - axis;
|
|
65
|
+
return sptrOf<HBox>(box);
|
|
66
|
+
} else {
|
|
67
|
+
return sptrOf<CharBox>(chr);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Char CharAtom::getChar(Env& env) const {
|
|
72
|
+
if (_mathMode && env.style() >= TexStyle::script) {
|
|
73
|
+
const auto& chr = env.getChar(_unicode, true, _fontStyle);
|
|
74
|
+
return chr.isValid() ? chr.script(0) : chr;
|
|
75
|
+
}
|
|
76
|
+
return env.getChar(unicode(), isMathMode(), _fontStyle);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
std::string CharAtom::name() const {
|
|
80
|
+
std::string str;
|
|
81
|
+
microtex::appendToUtf8(str, _unicode);
|
|
82
|
+
return str;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
sptr<Box> CharAtom::createBox(Env& env) {
|
|
86
|
+
const auto& chr = getChar(env);
|
|
87
|
+
if (chr.isValid()) return sptrOf<CharBox>(chr);
|
|
88
|
+
FontStyle fontStyle;
|
|
89
|
+
if (_fontStyle != FontStyle::invalid) {
|
|
90
|
+
fontStyle = _fontStyle;
|
|
91
|
+
} else {
|
|
92
|
+
fontStyle = _mathMode ? env.mathFontStyle() : env.textFontStyle();
|
|
93
|
+
}
|
|
94
|
+
return sptrOf<TextBox>(name(), fontStyle, Env::fixedTextSize() * env.scale());
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
sptr<Box> BreakMarkAtom::createBox(Env& env) {
|
|
98
|
+
return StrutBox::empty();
|
|
99
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#ifndef MICROTEX_ATOM_CHAR_H
|
|
2
|
+
#define MICROTEX_ATOM_CHAR_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom.h"
|
|
5
|
+
#include "box/box.h"
|
|
6
|
+
#include "unimath/uni_char.h"
|
|
7
|
+
#include "unimath/uni_font.h"
|
|
8
|
+
#include "unimath/uni_symbol.h"
|
|
9
|
+
#include "utils/utils.h"
|
|
10
|
+
|
|
11
|
+
namespace microtex {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* An common superclass for atoms that represent one single character and access
|
|
15
|
+
* the font information.
|
|
16
|
+
*/
|
|
17
|
+
class CharSymbol : public Atom {
|
|
18
|
+
private:
|
|
19
|
+
/**
|
|
20
|
+
* Row will mark certain CharSymbol atoms as a text symbol. Subsup will use
|
|
21
|
+
* this property for a certain spacing rule.
|
|
22
|
+
*/
|
|
23
|
+
bool _isText;
|
|
24
|
+
|
|
25
|
+
public:
|
|
26
|
+
CharSymbol() : _isText(false) {}
|
|
27
|
+
|
|
28
|
+
/** Mark as text symbol */
|
|
29
|
+
inline void markAsText() { _isText = true; }
|
|
30
|
+
|
|
31
|
+
/** Remove the mark so the atom remains unchanged (used by AtomDecor) */
|
|
32
|
+
inline void removeMark() { _isText = false; }
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Tests if this atom is marked as a text symbol (used by subsup)
|
|
36
|
+
*
|
|
37
|
+
* @return whether this CharSymbol is marked as a text symbol
|
|
38
|
+
*/
|
|
39
|
+
inline bool isText() const { return _isText; }
|
|
40
|
+
|
|
41
|
+
bool isChar() const override { return true; }
|
|
42
|
+
|
|
43
|
+
/** Test if is in math mode */
|
|
44
|
+
virtual bool isMathMode() const = 0;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get the Char-object that uniquely identifies the character that is
|
|
48
|
+
* represented by this atom.
|
|
49
|
+
*/
|
|
50
|
+
virtual Char getChar(Env& env) const = 0;
|
|
51
|
+
|
|
52
|
+
virtual std::string name() const = 0;
|
|
53
|
+
|
|
54
|
+
virtual c32 unicode() const = 0;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** An atom representing a fixed character (not depending on a text style). */
|
|
58
|
+
class FixedCharAtom : public CharSymbol {
|
|
59
|
+
private:
|
|
60
|
+
const Char _chr;
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
FixedCharAtom() = delete;
|
|
64
|
+
|
|
65
|
+
explicit FixedCharAtom(const Char& chr) : _chr(chr) {}
|
|
66
|
+
|
|
67
|
+
Char getChar(Env& env) const override { return _chr; }
|
|
68
|
+
|
|
69
|
+
std::string name() const override;
|
|
70
|
+
|
|
71
|
+
bool isMathMode() const override { return false; }
|
|
72
|
+
|
|
73
|
+
c32 unicode() const override { return _chr.mappedCode; }
|
|
74
|
+
|
|
75
|
+
sptr<Box> createBox(Env& env) override;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
class SymbolAtom : public CharSymbol {
|
|
79
|
+
private:
|
|
80
|
+
const Symbol* const _symbol = nullptr;
|
|
81
|
+
|
|
82
|
+
public:
|
|
83
|
+
SymbolAtom() = delete;
|
|
84
|
+
|
|
85
|
+
explicit SymbolAtom(const Symbol* symbol) noexcept;
|
|
86
|
+
|
|
87
|
+
c32 unicode() const override;
|
|
88
|
+
|
|
89
|
+
/** Name of this symbol */
|
|
90
|
+
std::string name() const override;
|
|
91
|
+
|
|
92
|
+
/** Test if this symbol is valid */
|
|
93
|
+
bool isValid() const;
|
|
94
|
+
|
|
95
|
+
bool isMathMode() const override {
|
|
96
|
+
// TODO math mode?
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
sptr<Box> createBox(Env& env) override;
|
|
101
|
+
|
|
102
|
+
Char getChar(Env& env) const override;
|
|
103
|
+
|
|
104
|
+
/** Get symbol from the given name, return null if not found */
|
|
105
|
+
static sptr<SymbolAtom> get(const std::string& name);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* An atom representing exactly one alphanumeric character and the text style in
|
|
110
|
+
* which it should be drawn.
|
|
111
|
+
*/
|
|
112
|
+
class CharAtom : public CharSymbol {
|
|
113
|
+
private:
|
|
114
|
+
// alphanumeric character
|
|
115
|
+
const c32 _unicode;
|
|
116
|
+
// the font style, invalid means use the environment default
|
|
117
|
+
FontStyle _fontStyle = FontStyle::invalid;
|
|
118
|
+
bool _mathMode = false;
|
|
119
|
+
|
|
120
|
+
public:
|
|
121
|
+
CharAtom() = delete;
|
|
122
|
+
|
|
123
|
+
CharAtom(c32 unicode, FontStyle style, bool mathMode = false)
|
|
124
|
+
: _unicode(unicode), _fontStyle(style), _mathMode(mathMode) {}
|
|
125
|
+
|
|
126
|
+
CharAtom(c32 unicode, bool mathMode) : _unicode(unicode), _mathMode(mathMode) {}
|
|
127
|
+
|
|
128
|
+
c32 unicode() const override { return _unicode; }
|
|
129
|
+
|
|
130
|
+
bool isMathMode() const override { return _mathMode; }
|
|
131
|
+
|
|
132
|
+
Char getChar(Env& env) const override;
|
|
133
|
+
|
|
134
|
+
std::string name() const override;
|
|
135
|
+
|
|
136
|
+
sptr<Box> createBox(Env& env) override;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** An empty atom just to add a line-break mark. */
|
|
140
|
+
class BreakMarkAtom : public Atom {
|
|
141
|
+
public:
|
|
142
|
+
sptr<Box> createBox(Env& env) override;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
} // namespace microtex
|
|
146
|
+
|
|
147
|
+
#endif // MICROTEX_ATOM_CHAR_H
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#include "atom/atom_delim.h"
|
|
2
|
+
|
|
3
|
+
#include "atom/atom_basic.h"
|
|
4
|
+
|
|
5
|
+
#include "box/box_factory.h"
|
|
6
|
+
#include "box/box_group.h"
|
|
7
|
+
#include "box/box_single.h"
|
|
8
|
+
#include "env/env.h"
|
|
9
|
+
|
|
10
|
+
using namespace microtex;
|
|
11
|
+
|
|
12
|
+
sptr<Box> OverUnderBar::createBox(Env& env) {
|
|
13
|
+
const auto base = (_base == nullptr ? sptrOf<EmptyAtom>() : _base)->createBox(env);
|
|
14
|
+
const auto vbox = sptrOf<VBox>();
|
|
15
|
+
if (_over) {
|
|
16
|
+
const auto asc = env.mathConsts().overbarExtraAscender() * env.scale();
|
|
17
|
+
vbox->add(sptrOf<StrutBox>(0.f, asc, 0.f, 0.f));
|
|
18
|
+
const auto t = env.mathConsts().overbarRuleThickness() * env.scale();
|
|
19
|
+
vbox->add(sptrOf<RuleBox>(t, base->_width, 0.f));
|
|
20
|
+
const auto gap = env.mathConsts().overbarVerticalGap() * env.scale();
|
|
21
|
+
vbox->add(sptrOf<StrutBox>(0.f, gap, 0.f, 0.f));
|
|
22
|
+
vbox->add(base);
|
|
23
|
+
const auto h = vbox->_height + vbox->_depth;
|
|
24
|
+
vbox->_depth = base->_depth;
|
|
25
|
+
vbox->_height = h - vbox->_depth;
|
|
26
|
+
} else {
|
|
27
|
+
vbox->add(base);
|
|
28
|
+
const auto gap = env.mathConsts().underbarVerticalGap() * env.scale();
|
|
29
|
+
vbox->add(sptrOf<StrutBox>(0.f, gap, 0.f, 0.f));
|
|
30
|
+
const auto t = env.mathConsts().underbarRuleThickness() * env.scale();
|
|
31
|
+
vbox->add(sptrOf<RuleBox>(t, base->_width, 0.f));
|
|
32
|
+
const auto dsc = env.mathConsts().underbarExtraDescender() * env.scale();
|
|
33
|
+
vbox->add(sptrOf<StrutBox>(0.f, dsc, 0.f, 0.f));
|
|
34
|
+
const auto h = vbox->_height + vbox->_depth;
|
|
35
|
+
vbox->_height = base->_height;
|
|
36
|
+
vbox->_depth = h - vbox->_height;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return vbox;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
sptr<Box> OverUnderDelimiter::createBox(Env& env) {
|
|
43
|
+
const auto base = _base->createBox(env);
|
|
44
|
+
const auto delim = microtex::createHDelim(_delim, env, base->_width);
|
|
45
|
+
base->_shift = (delim->_width - base->_width) / 2;
|
|
46
|
+
|
|
47
|
+
const auto vbox = sptrOf<VBox>();
|
|
48
|
+
if (_over) {
|
|
49
|
+
vbox->add(delim);
|
|
50
|
+
const auto kern = SpaceAtom(UnitType::ex, 0.f, -1.f, 0.f).createBox(env);
|
|
51
|
+
vbox->add(kern);
|
|
52
|
+
vbox->add(base);
|
|
53
|
+
const auto h = vbox->_height + vbox->_depth;
|
|
54
|
+
vbox->_depth = base->_depth;
|
|
55
|
+
vbox->_height = h - vbox->_depth;
|
|
56
|
+
} else {
|
|
57
|
+
vbox->add(base);
|
|
58
|
+
vbox->add(delim);
|
|
59
|
+
const auto h = vbox->_height + vbox->_depth;
|
|
60
|
+
vbox->_height = base->_height;
|
|
61
|
+
vbox->_depth = h - vbox->_height;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return vbox;
|
|
65
|
+
}
|