@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,234 @@
|
|
|
1
|
+
if (DEFINED _BUILD_STATIC AND _BUILD_STATIC)
|
|
2
|
+
add_library(microtex STATIC "")
|
|
3
|
+
else ()
|
|
4
|
+
add_library(microtex SHARED "")
|
|
5
|
+
endif ()
|
|
6
|
+
|
|
7
|
+
if (MSVC)
|
|
8
|
+
add_compile_options("/utf-8")
|
|
9
|
+
target_compile_features(microtex PUBLIC cxx_std_17)
|
|
10
|
+
target_compile_definitions(microtex PRIVATE -DMICROTEX_LIBRARY)
|
|
11
|
+
target_compile_definitions(microtex PUBLIC -D_HAS_STD_BYTE=1)
|
|
12
|
+
else ()
|
|
13
|
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
|
14
|
+
endif ()
|
|
15
|
+
|
|
16
|
+
set_target_properties(
|
|
17
|
+
microtex PROPERTIES
|
|
18
|
+
CXX_VISIBILITY_PRESET hidden
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
if (NOT DEFINED _DISABLE_ALIAS AND NOT _DISABLE_ALIAS)
|
|
22
|
+
set_target_properties(
|
|
23
|
+
microtex PROPERTIES
|
|
24
|
+
VERSION ${PROJECT_VERSION}
|
|
25
|
+
SOVERSION ${MICROTEX_API_VERSION}
|
|
26
|
+
)
|
|
27
|
+
endif ()
|
|
28
|
+
|
|
29
|
+
set(
|
|
30
|
+
_SRCS
|
|
31
|
+
# atom folder
|
|
32
|
+
atom/atom.cpp
|
|
33
|
+
atom/atom_basic.cpp
|
|
34
|
+
atom/atom_char.cpp
|
|
35
|
+
atom/atom_misc.cpp
|
|
36
|
+
atom/atom_matrix.cpp
|
|
37
|
+
atom/atom_row.cpp
|
|
38
|
+
atom/atom_space.cpp
|
|
39
|
+
atom/atom_stack.cpp
|
|
40
|
+
atom/atom_accent.cpp
|
|
41
|
+
atom/atom_scripts.cpp
|
|
42
|
+
atom/atom_vrow.cpp
|
|
43
|
+
atom/atom_operator.cpp
|
|
44
|
+
atom/atom_zstack.cpp
|
|
45
|
+
atom/atom_sideset.cpp
|
|
46
|
+
atom/atom_font.cpp
|
|
47
|
+
atom/atom_delim.cpp
|
|
48
|
+
atom/atom_root.cpp
|
|
49
|
+
atom/atom_frac.cpp
|
|
50
|
+
atom/atom_fence.cpp
|
|
51
|
+
atom/atom_box.cpp
|
|
52
|
+
atom/atom_text.cpp
|
|
53
|
+
atom/colors_def.cpp
|
|
54
|
+
# box folder
|
|
55
|
+
box/box.cpp
|
|
56
|
+
box/box_factory.cpp
|
|
57
|
+
box/box_group.cpp
|
|
58
|
+
box/box_single.cpp
|
|
59
|
+
# core folder
|
|
60
|
+
core/split.cpp
|
|
61
|
+
core/formula.cpp
|
|
62
|
+
core/formula_def.cpp
|
|
63
|
+
core/glue.cpp
|
|
64
|
+
core/localized_num.cpp
|
|
65
|
+
core/parser.cpp
|
|
66
|
+
core/debug_config.cpp
|
|
67
|
+
# macro folder
|
|
68
|
+
macro/macro.cpp
|
|
69
|
+
macro/macro_def.cpp
|
|
70
|
+
macro/macro_misc.cpp
|
|
71
|
+
macro/macro_scripts.cpp
|
|
72
|
+
macro/macro_accent.cpp
|
|
73
|
+
macro/macro_colors.cpp
|
|
74
|
+
macro/macro_space.cpp
|
|
75
|
+
macro/macro_delims.cpp
|
|
76
|
+
macro/macro_frac.cpp
|
|
77
|
+
macro/macro_styles.cpp
|
|
78
|
+
macro/macro_fonts.cpp
|
|
79
|
+
# env folder
|
|
80
|
+
env/env.cpp
|
|
81
|
+
env/units.cpp
|
|
82
|
+
# utils folder
|
|
83
|
+
utils/string_utils.cpp
|
|
84
|
+
utils/utf.cpp
|
|
85
|
+
utils/utils.cpp
|
|
86
|
+
# otf folder
|
|
87
|
+
otf/clm.cpp
|
|
88
|
+
otf/fontsense.cpp
|
|
89
|
+
otf/glyph.cpp
|
|
90
|
+
otf/otf.cpp
|
|
91
|
+
otf/path.cpp
|
|
92
|
+
# unimath folder
|
|
93
|
+
unimath/font_src.cpp
|
|
94
|
+
unimath/math_type.cpp
|
|
95
|
+
unimath/uni_char.cpp
|
|
96
|
+
unimath/uni_font.cpp
|
|
97
|
+
unimath/uni_symbol.cpp
|
|
98
|
+
# graphic folder
|
|
99
|
+
graphic/font_style.cpp
|
|
100
|
+
graphic/graphic_basic.cpp
|
|
101
|
+
graphic/graphic.cpp
|
|
102
|
+
# render folder
|
|
103
|
+
render/render.cpp
|
|
104
|
+
render/builder.cpp
|
|
105
|
+
|
|
106
|
+
microtex.cpp
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
message(STATUS "Have cwrapper: ${HAVE_CWRAPPER}")
|
|
110
|
+
if (DEFINED HAVE_CWRAPPER AND HAVE_CWRAPPER)
|
|
111
|
+
set(
|
|
112
|
+
_SRCS
|
|
113
|
+
${_SRCS}
|
|
114
|
+
wrapper/callback.cpp
|
|
115
|
+
wrapper/graphic_wrapper.cpp
|
|
116
|
+
wrapper/cwrapper.cpp
|
|
117
|
+
wrapper/byte_seq.cpp
|
|
118
|
+
)
|
|
119
|
+
target_compile_definitions(microtex PUBLIC -DHAVE_CWRAPPER)
|
|
120
|
+
endif ()
|
|
121
|
+
|
|
122
|
+
# source files
|
|
123
|
+
target_sources(microtex PRIVATE ${_SRCS})
|
|
124
|
+
target_include_directories(
|
|
125
|
+
microtex PUBLIC
|
|
126
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
127
|
+
$<INSTALL_INTERFACE:include/microtex>
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
###################
|
|
131
|
+
# compile options #
|
|
132
|
+
###################
|
|
133
|
+
|
|
134
|
+
# compile option: if debug graphics
|
|
135
|
+
option(GRAPHICS_DEBUG "If enable graphics debug" ON)
|
|
136
|
+
if (GRAPHICS_DEBUG)
|
|
137
|
+
target_compile_definitions(microtex PRIVATE -DGRAPHICS_DEBUG)
|
|
138
|
+
endif ()
|
|
139
|
+
|
|
140
|
+
if (NOT DEFINED _HAVE_AUTO_FONT_FIND)
|
|
141
|
+
set(_HAVE_AUTO_FONT_FIND ON)
|
|
142
|
+
endif ()
|
|
143
|
+
# compile option: HAVE_AUTO_FONT_FIND if enable auto font find
|
|
144
|
+
# this option is exported to users, will write into file 'microtexconfig.h'
|
|
145
|
+
option(HAVE_AUTO_FONT_FIND "If enable auto font find" ${_HAVE_AUTO_FONT_FIND_})
|
|
146
|
+
|
|
147
|
+
macro(CHECK_FS LIB_NAME)
|
|
148
|
+
if (EXISTS "${CMAKE_SOURCE_DIR}/test/has_filesystem.cpp")
|
|
149
|
+
if (${LIB_NAME} STREQUAL "none")
|
|
150
|
+
try_compile(
|
|
151
|
+
_HAS_FS
|
|
152
|
+
"${CMAKE_BINARY_DIR}/temp"
|
|
153
|
+
"${CMAKE_SOURCE_DIR}/test/has_filesystem.cpp"
|
|
154
|
+
CMAKE_FLAGS -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON
|
|
155
|
+
)
|
|
156
|
+
else ()
|
|
157
|
+
try_compile(
|
|
158
|
+
_HAS_FS
|
|
159
|
+
"${CMAKE_BINARY_DIR}/temp"
|
|
160
|
+
"${CMAKE_SOURCE_DIR}/test/has_filesystem.cpp"
|
|
161
|
+
CMAKE_FLAGS -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON
|
|
162
|
+
LINK_LIBRARIES ${LIB_NAME}
|
|
163
|
+
)
|
|
164
|
+
endif ()
|
|
165
|
+
set(_HAS_STD_FS ${_HAS_FS})
|
|
166
|
+
endif ()
|
|
167
|
+
endmacro()
|
|
168
|
+
|
|
169
|
+
if (HAVE_AUTO_FONT_FIND)
|
|
170
|
+
# iterate over the preset std c++ filesystem libraries
|
|
171
|
+
# `none` means there is no filesystem library to link
|
|
172
|
+
foreach (LIB IN ITEMS none;stdc++fs;c++fs;c++experimental)
|
|
173
|
+
check_fs(${LIB})
|
|
174
|
+
message(STATUS "Test for: ${LIB}, has std fs: ${_HAS_STD_FS}")
|
|
175
|
+
if (_HAS_STD_FS)
|
|
176
|
+
# special case: use the experimental filesystem
|
|
177
|
+
if (${LIB} STREQUAL "c++experimental")
|
|
178
|
+
target_compile_definitions(microtex PRIVATE -DUSE_EXPERIMENTAL_FILESYSTEM)
|
|
179
|
+
endif ()
|
|
180
|
+
if (NOT ${LIB} STREQUAL "none")
|
|
181
|
+
target_link_libraries(microtex ${LIB})
|
|
182
|
+
endif ()
|
|
183
|
+
break()
|
|
184
|
+
endif ()
|
|
185
|
+
endforeach ()
|
|
186
|
+
# oops... no std filesystem was found, use boost instead
|
|
187
|
+
if (NOT _HAS_STD_FS)
|
|
188
|
+
message(STATUS "No std c++ filesystem was found, use boost filesystem instead")
|
|
189
|
+
find_package(Boost REQUIRED COMPONENTS filesystem)
|
|
190
|
+
target_link_libraries(microtex PRIVATE Boost::filesystem)
|
|
191
|
+
target_compile_definitions(microtex PRIVATE USE_BOOST_FILESYSTEM)
|
|
192
|
+
endif ()
|
|
193
|
+
endif ()
|
|
194
|
+
|
|
195
|
+
if (NOT DEFINED _GLYPH_RENDER_TYPE)
|
|
196
|
+
set(_GLYPH_RENDER_TYPE 0)
|
|
197
|
+
endif ()
|
|
198
|
+
if (DEFINED GLYPH_RENDER_TYPE)
|
|
199
|
+
set(_GLYPH_RENDER_TYPE ${GLYPH_RENDER_TYPE})
|
|
200
|
+
endif ()
|
|
201
|
+
# compile option: GLYPH_RENDER_TYPE the glyph render type
|
|
202
|
+
# 0: use path and typeface both
|
|
203
|
+
# 1: use path only
|
|
204
|
+
# 2: use typeface only
|
|
205
|
+
target_compile_definitions(microtex PRIVATE -DGLYPH_RENDER_TYPE=${_GLYPH_RENDER_TYPE})
|
|
206
|
+
|
|
207
|
+
configure_file(microtexconfig.h.in microtexconfig.h @ONLY)
|
|
208
|
+
target_include_directories(microtex PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
|
209
|
+
|
|
210
|
+
################
|
|
211
|
+
# installation #
|
|
212
|
+
################
|
|
213
|
+
if (_HAS_MICROTEX_INSTALL)
|
|
214
|
+
microtex_install_target(microtex)
|
|
215
|
+
microtex_install_headers(
|
|
216
|
+
microtex
|
|
217
|
+
HEADERS ${CMAKE_CURRENT_BINARY_DIR}/microtexconfig.h microtexexport.h microtex.h microtexapi.h
|
|
218
|
+
)
|
|
219
|
+
microtex_install_headers(microtex PREFIX utils HEADERS utils/types.h)
|
|
220
|
+
microtex_install_headers(microtex PREFIX render HEADERS render/render.h)
|
|
221
|
+
microtex_install_headers(microtex PREFIX unimath HEADERS unimath/font_src.h unimath/font_meta.h)
|
|
222
|
+
microtex_install_headers(
|
|
223
|
+
microtex
|
|
224
|
+
PREFIX graphic
|
|
225
|
+
HEADERS graphic/graphic.h graphic/font_style.h graphic/graphic_basic.h
|
|
226
|
+
)
|
|
227
|
+
if (DEFINED HAVE_CWRAPPER AND HAVE_CWRAPPER)
|
|
228
|
+
microtex_install_headers(
|
|
229
|
+
microtex
|
|
230
|
+
PREFIX wrapper
|
|
231
|
+
HEADERS wrapper/callback.h wrapper/cwrapper.h
|
|
232
|
+
)
|
|
233
|
+
endif ()
|
|
234
|
+
endif ()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#include "atom/atom.h"
|
|
2
|
+
#include "atom/atom_basic.h"
|
|
3
|
+
|
|
4
|
+
using namespace microtex;
|
|
5
|
+
|
|
6
|
+
WrapAtom::WrapAtom(const sptr<Atom>& base) {
|
|
7
|
+
if (base) {
|
|
8
|
+
_type = base->_type;
|
|
9
|
+
_base = base;
|
|
10
|
+
} else {
|
|
11
|
+
_type = AtomType::ordinary;
|
|
12
|
+
_base = sptrOf<EmptyAtom>();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#ifndef ATOM_H_INCLUDED
|
|
2
|
+
#define ATOM_H_INCLUDED
|
|
3
|
+
|
|
4
|
+
#include "box/box.h"
|
|
5
|
+
|
|
6
|
+
namespace microtex {
|
|
7
|
+
|
|
8
|
+
class Env;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An abstract superclass for all logical mathematical constructions that can be a part
|
|
12
|
+
* of a Formula. The abstract method [createBox(Env)] transforms this logical unit into
|
|
13
|
+
* a concrete box (that can be painted).
|
|
14
|
+
*
|
|
15
|
+
* It also defines its type, used for determining what glue to use between adjacent atoms
|
|
16
|
+
* in a "row construction". That can be one single type by assigning one of the type
|
|
17
|
+
* constants to the [_type] field. But they can also be defined as having two types: a
|
|
18
|
+
* "left type" and a "right type". This can be done by implementing the methods
|
|
19
|
+
* [leftType()] and [rightType()]. The left type will then be used for determining the
|
|
20
|
+
* glue between this atom and the previous one (in a row, if any) and the right type for
|
|
21
|
+
* the glue between this atom and the following one (in a row, if any).
|
|
22
|
+
*
|
|
23
|
+
* And the [_limitsType] used for determining what variant to use when constructing scripts,
|
|
24
|
+
* defaults to [LimitsType::noLimits].
|
|
25
|
+
*/
|
|
26
|
+
class Atom {
|
|
27
|
+
public:
|
|
28
|
+
/** The type of the atom (default value: ordinary atom) */
|
|
29
|
+
AtomType _type = AtomType::ordinary;
|
|
30
|
+
/** The limits type of the atom (default value: nolimits) */
|
|
31
|
+
LimitsType _limitsType = LimitsType::noLimits;
|
|
32
|
+
/** The alignment type of the atom (default value: none) */
|
|
33
|
+
Alignment _alignment = Alignment::none;
|
|
34
|
+
|
|
35
|
+
Atom() = default;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get the type of the leftmost child atom. Most atoms have no child
|
|
39
|
+
* atoms, so the "left type" and the "right type" are the same: the atom's
|
|
40
|
+
* type. This also is the default implementation. But Some atoms are
|
|
41
|
+
* composed of child atoms put one after another in a horizontal row. These
|
|
42
|
+
* atoms must override this method.
|
|
43
|
+
*
|
|
44
|
+
* @return the type of the leftmost child atom
|
|
45
|
+
*/
|
|
46
|
+
virtual AtomType leftType() const { return _type; }
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the type of the rightmost child atom. Most atoms have no child
|
|
50
|
+
* atoms, so the "left type" and the "right type" are the same: the atom's
|
|
51
|
+
* type. This also is the default implementation. But Some atoms are
|
|
52
|
+
* composed of child atoms put one after another in a horizontal row. These
|
|
53
|
+
* atoms must override this method.
|
|
54
|
+
*
|
|
55
|
+
* @return the type of the rightmost child atom
|
|
56
|
+
*/
|
|
57
|
+
virtual AtomType rightType() const { return _type; }
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Convert this atom into a Box, using properties set by "parent"
|
|
61
|
+
* atoms, like the TeX style, the last used font, color settings, ...
|
|
62
|
+
*
|
|
63
|
+
* @param env the current environment settings
|
|
64
|
+
*
|
|
65
|
+
* @return the resulting box.
|
|
66
|
+
*/
|
|
67
|
+
virtual sptr<Box> createBox(Env& env) = 0;
|
|
68
|
+
|
|
69
|
+
/** Test if this atom is a single character */
|
|
70
|
+
virtual bool isChar() const { return false; }
|
|
71
|
+
|
|
72
|
+
virtual ~Atom() = default;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** Atom decor contains another atom */
|
|
76
|
+
class WrapAtom : public Atom {
|
|
77
|
+
protected:
|
|
78
|
+
sptr<Atom> _base;
|
|
79
|
+
|
|
80
|
+
public:
|
|
81
|
+
explicit WrapAtom(const sptr<Atom>& base);
|
|
82
|
+
|
|
83
|
+
inline sptr<Atom> base() const { return _base; }
|
|
84
|
+
|
|
85
|
+
AtomType leftType() const override {
|
|
86
|
+
return _base == nullptr ? Atom::leftType() : _base->leftType();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
AtomType rightType() const override {
|
|
90
|
+
return _base == nullptr ? Atom::rightType() : _base->rightType();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace microtex
|
|
95
|
+
|
|
96
|
+
#endif // ATOM_H_INCLUDED
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#include "atom/atom_accent.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
|
+
#include "utils/exceptions.h"
|
|
8
|
+
|
|
9
|
+
using namespace microtex;
|
|
10
|
+
using namespace std;
|
|
11
|
+
|
|
12
|
+
void AccentedAtom::setupBase(const sptr<Atom>& base) {
|
|
13
|
+
auto a = dynamic_cast<AccentedAtom*>(base.get());
|
|
14
|
+
_base = a != nullptr ? a->_base : base;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
AccentedAtom::AccentedAtom(const sptr<Atom>& base, const string& name, bool fitSize, bool fake) {
|
|
18
|
+
_accenter = SymbolAtom::get(name);
|
|
19
|
+
if (_accenter == nullptr) {
|
|
20
|
+
throw ex_parse("'" + name + "' is not defined as a symbol");
|
|
21
|
+
}
|
|
22
|
+
_fitSize = fitSize;
|
|
23
|
+
_fakeAccent = fake;
|
|
24
|
+
if (_accenter->_type == AtomType::accent) {
|
|
25
|
+
_accentee = base;
|
|
26
|
+
setupBase(base);
|
|
27
|
+
// the symbol is a real accent but specified as fake accent
|
|
28
|
+
_fakeAccent = false;
|
|
29
|
+
} else if (fake) {
|
|
30
|
+
_accentee = base;
|
|
31
|
+
setupBase(base);
|
|
32
|
+
} else {
|
|
33
|
+
throw ex_parse(
|
|
34
|
+
"The symbol with the name '" + name + "' is not defined as an accent (type='acc')!"
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
sptr<Box> AccentedAtom::createBox(Env& env) {
|
|
40
|
+
// create accentee box in cramped style
|
|
41
|
+
// clang-format off
|
|
42
|
+
auto accentee = (
|
|
43
|
+
_accentee == nullptr
|
|
44
|
+
? StrutBox::empty()
|
|
45
|
+
: env.withStyle(env.crampStyle(), [&](Env& cramp) { return _accentee->createBox(cramp); })
|
|
46
|
+
);
|
|
47
|
+
// clang-format on
|
|
48
|
+
|
|
49
|
+
float topAccent = Otf::undefinedMathValue;
|
|
50
|
+
if (auto sym = dynamic_cast<CharSymbol*>(_base.get()); sym != nullptr) {
|
|
51
|
+
topAccent = sym->getChar(env).topAccentAttachment();
|
|
52
|
+
}
|
|
53
|
+
topAccent = topAccent == Otf::undefinedMathValue ? accentee->_width / 2.f : topAccent;
|
|
54
|
+
|
|
55
|
+
// function to retrieve best char from the accent symbol to match the accentee box's width
|
|
56
|
+
const auto& getChar = [&]() {
|
|
57
|
+
const auto& chr = ((SymbolAtom*)_accenter.get())->getChar(env);
|
|
58
|
+
if (!_fitSize) return chr;
|
|
59
|
+
int i = 1;
|
|
60
|
+
for (; i < chr.hLargerCount(); i++) {
|
|
61
|
+
const auto& larger = chr.hLarger(i);
|
|
62
|
+
if (larger.width() > accentee->_width) break;
|
|
63
|
+
}
|
|
64
|
+
return chr.hLarger(i - 1);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// accenter
|
|
68
|
+
sptr<Box> accenter;
|
|
69
|
+
if (_fakeAccent) {
|
|
70
|
+
accenter = env.withStyle(env.subStyle(), [&](Env& sub) { return _accenter->createBox(sub); });
|
|
71
|
+
accenter->_shift = topAccent - accenter->_width / 2.f;
|
|
72
|
+
} else {
|
|
73
|
+
const auto& chr = getChar();
|
|
74
|
+
accenter = sptrOf<CharBox>(chr);
|
|
75
|
+
const auto pos = chr.topAccentAttachment();
|
|
76
|
+
const auto shift = pos == Otf::undefinedMathValue ? accenter->_width / 2.f : pos;
|
|
77
|
+
accenter->_shift = topAccent - shift;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// add to vertical box
|
|
81
|
+
auto vbox = new VBox();
|
|
82
|
+
// kerning
|
|
83
|
+
auto delta = 0.f;
|
|
84
|
+
auto sigma = 0.f;
|
|
85
|
+
if (_fakeAccent) {
|
|
86
|
+
delta = Units::fsize(UnitType::mu, 1, env);
|
|
87
|
+
} else if (accenter->_depth <= 0) {
|
|
88
|
+
delta = -min(accentee->_height, (float)env.mathConsts().accentBaseHeight());
|
|
89
|
+
} else {
|
|
90
|
+
// if accent has depth (e.g. \not), we need to align the accentee and accenter
|
|
91
|
+
// by its baseline
|
|
92
|
+
if (accentee->_height > accenter->_height) {
|
|
93
|
+
auto t = accenter;
|
|
94
|
+
accenter = accentee;
|
|
95
|
+
accentee = t;
|
|
96
|
+
}
|
|
97
|
+
delta = -(accentee->_height + accenter->_depth);
|
|
98
|
+
sigma = max(accenter->_depth - accentee->_depth, 0.f);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
vbox->add(accenter);
|
|
102
|
+
vbox->add(sptrOf<StrutBox>(0.f, delta, 0.f, 0.f));
|
|
103
|
+
vbox->add(accentee);
|
|
104
|
+
|
|
105
|
+
// set height and depth of the vertical box
|
|
106
|
+
vbox->_height = vbox->vlen() - accentee->_depth;
|
|
107
|
+
vbox->_depth = accentee->_depth;
|
|
108
|
+
|
|
109
|
+
// add extra space to make sure the box is tall enough to wrap all children
|
|
110
|
+
if (sigma > PREC) {
|
|
111
|
+
vbox->add(sptrOf<StrutBox>(0.f, sigma, 0.f, 0.f));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return sptr<Box>(vbox);
|
|
115
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#ifndef MICROTEX_ATOM_ACCENT_H
|
|
2
|
+
#define MICROTEX_ATOM_ACCENT_H
|
|
3
|
+
|
|
4
|
+
#include "atom/atom.h"
|
|
5
|
+
#include "atom/atom_char.h"
|
|
6
|
+
|
|
7
|
+
namespace microtex {
|
|
8
|
+
|
|
9
|
+
/** An atom representing another atom with an accent symbol above it */
|
|
10
|
+
class AccentedAtom : public Atom {
|
|
11
|
+
public:
|
|
12
|
+
sptr<SymbolAtom> _accenter;
|
|
13
|
+
sptr<Atom> _accentee;
|
|
14
|
+
sptr<Atom> _base;
|
|
15
|
+
|
|
16
|
+
bool _fakeAccent = false;
|
|
17
|
+
bool _fitSize = false;
|
|
18
|
+
|
|
19
|
+
void setupBase(const sptr<Atom>& base);
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
AccentedAtom() = delete;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create an AccentedAtom from a base atom and an accent symbol defined by
|
|
26
|
+
* its name
|
|
27
|
+
*
|
|
28
|
+
* @param base base atom
|
|
29
|
+
* @param name name of the accent symbol to be put over the base atom
|
|
30
|
+
* @param fitSize if accent fit the base atom's width
|
|
31
|
+
* @param fake if is a fake accent
|
|
32
|
+
*/
|
|
33
|
+
AccentedAtom(
|
|
34
|
+
const sptr<Atom>& base,
|
|
35
|
+
const std::string& name,
|
|
36
|
+
bool fitSize = false,
|
|
37
|
+
bool fake = false
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
AtomType leftType() const override {
|
|
41
|
+
return _accentee == nullptr ? AtomType::ordinary : _accentee->leftType();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
AtomType rightType() const override {
|
|
45
|
+
return _accentee == nullptr ? AtomType::ordinary : _accentee->rightType();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
sptr<Box> createBox(Env& env) override;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
} // namespace microtex
|
|
52
|
+
|
|
53
|
+
#endif // MICROTEX_ATOM_ACCENT_H
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#include "atom/atom_basic.h"
|
|
2
|
+
|
|
3
|
+
#include "atom/atom_scripts.h"
|
|
4
|
+
#include "box/box_factory.h"
|
|
5
|
+
#include "box/box_group.h"
|
|
6
|
+
#include "env/env.h"
|
|
7
|
+
|
|
8
|
+
using namespace std;
|
|
9
|
+
using namespace microtex;
|
|
10
|
+
|
|
11
|
+
sptr<Box> StyleAtom::createBox(Env& env) {
|
|
12
|
+
return env.withStyle(_style, [&](Env& e) { return _base->createBox(e); });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
sptr<Box> AStyleAtom::createBox(Env& env) {
|
|
16
|
+
TexStyle style = TexStyle::display;
|
|
17
|
+
if (_name == "dnomstyle") {
|
|
18
|
+
style = env.dnomStyle();
|
|
19
|
+
} else if (_name == "numstyle") {
|
|
20
|
+
style = env.numStyle();
|
|
21
|
+
} else if (_name == "substyle") {
|
|
22
|
+
style = env.subStyle();
|
|
23
|
+
} else if (_name == "supstyle") {
|
|
24
|
+
style = env.supStyle();
|
|
25
|
+
}
|
|
26
|
+
return env.withStyle(style, [&](Env& e) { return _base->createBox(e); });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
sptr<Box> SmashedAtom::createBox(Env& env) {
|
|
30
|
+
auto b = sptrOf<HBox>(_base->createBox(env));
|
|
31
|
+
if (_h) b->_height = 0;
|
|
32
|
+
if (_d) b->_depth = 0;
|
|
33
|
+
return b;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
sptr<Box> ScaleAtom::createBox(Env& env) {
|
|
37
|
+
return sptrOf<ScaleBox>(_base->createBox(env), _sx, _sy);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
sptr<Box> MathAtom::createBox(Env& env) {
|
|
41
|
+
const auto style = env.style();
|
|
42
|
+
// if parent style greater than "this style", that means the parent uses smaller font size,
|
|
43
|
+
// then uses parent style instead
|
|
44
|
+
if (_style > style) {
|
|
45
|
+
env.setStyle(_style);
|
|
46
|
+
}
|
|
47
|
+
_base = _base == nullptr ? sptrOf<EmptyAtom>() : _base;
|
|
48
|
+
auto box = _base->createBox(env);
|
|
49
|
+
env.setStyle(style);
|
|
50
|
+
return box;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
sptr<Box> HlineAtom::createBox(Env& env) {
|
|
54
|
+
const auto drt = env.ruleThickness();
|
|
55
|
+
auto b = new RuleBox(drt, _width, _shift, _color, false);
|
|
56
|
+
auto vb = new VBox();
|
|
57
|
+
vb->add(sptr<Box>(b));
|
|
58
|
+
vb->_type = AtomType::hline;
|
|
59
|
+
return sptr<Box>(vb);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
CumulativeScriptsAtom::CumulativeScriptsAtom(
|
|
63
|
+
const sptr<Atom>& base,
|
|
64
|
+
const sptr<Atom>& sub,
|
|
65
|
+
const sptr<Atom>& sup
|
|
66
|
+
) {
|
|
67
|
+
if (auto ca = dynamic_cast<CumulativeScriptsAtom*>(base.get()); ca != nullptr) {
|
|
68
|
+
_base = ca->_base;
|
|
69
|
+
ca->_sup->add(sup);
|
|
70
|
+
ca->_sub->add(sub);
|
|
71
|
+
_sup = ca->_sup;
|
|
72
|
+
_sub = ca->_sub;
|
|
73
|
+
} else if (auto sa = dynamic_cast<ScriptsAtom*>(base.get()); sa != nullptr) {
|
|
74
|
+
_base = sa->_base;
|
|
75
|
+
_sup = sptrOf<RowAtom>(sa->_sup);
|
|
76
|
+
_sub = sptrOf<RowAtom>(sa->_sub);
|
|
77
|
+
_sup->add(sup);
|
|
78
|
+
_sub->add(sub);
|
|
79
|
+
} else {
|
|
80
|
+
_base = base;
|
|
81
|
+
_sup = sptrOf<RowAtom>(sup);
|
|
82
|
+
_sub = sptrOf<RowAtom>(sub);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
void CumulativeScriptsAtom::addSuperscript(const sptr<Atom>& sup) {
|
|
87
|
+
_sup->add(sup);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void CumulativeScriptsAtom::addSubscript(const sptr<Atom>& sub) {
|
|
91
|
+
_sub->add(sub);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
sptr<Atom> CumulativeScriptsAtom::getScriptsAtom() const {
|
|
95
|
+
return sptrOf<ScriptsAtom>(_base, _sub, _sup);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
sptr<Box> CumulativeScriptsAtom::createBox(Env& env) {
|
|
99
|
+
return ScriptsAtom(_base, _sub, _sup).createBox(env);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const color ColorAtom::_default = black;
|
|
103
|
+
|
|
104
|
+
ColorAtom::ColorAtom(const sptr<Atom>& atom, color bg, color c) : _background(bg), _color(c) {
|
|
105
|
+
_elements = sptrOf<RowAtom>(atom);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
void ColorAtom::defineColor(const string& name, color c) {
|
|
109
|
+
_colors[name] = c;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
sptr<Box> ColorAtom::createBox(Env& env) {
|
|
113
|
+
const auto box = _elements->createBox(env);
|
|
114
|
+
return sptrOf<ColorBox>(box, _color, _background);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
PhantomAtom::PhantomAtom(const sptr<Atom>& el) {
|
|
118
|
+
if (el == nullptr)
|
|
119
|
+
_elements = sptrOf<RowAtom>();
|
|
120
|
+
else
|
|
121
|
+
_elements = sptrOf<RowAtom>(el);
|
|
122
|
+
_w = _h = _d = true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
PhantomAtom::PhantomAtom(const sptr<Atom>& el, bool w, bool h, bool d) {
|
|
126
|
+
if (el == nullptr)
|
|
127
|
+
_elements = sptrOf<RowAtom>();
|
|
128
|
+
else
|
|
129
|
+
_elements = sptrOf<RowAtom>(el);
|
|
130
|
+
_w = w, _h = h, _d = d;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
sptr<Box> PhantomAtom::createBox(Env& env) {
|
|
134
|
+
auto res = _elements->createBox(env);
|
|
135
|
+
float w = (_w ? res->_width : 0);
|
|
136
|
+
float h = (_h ? res->_height : 0);
|
|
137
|
+
float d = (_d ? res->_depth : 0);
|
|
138
|
+
float s = res->_shift;
|
|
139
|
+
return sptrOf<StrutBox>(w, h, d, s);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
sptr<Box> ExtensibleAtom::createBox(Env& env) {
|
|
143
|
+
const auto len = _getLen(env);
|
|
144
|
+
return _vertical ? microtex::createVDelim(_sym, env, len)
|
|
145
|
+
: microtex::createHDelim(_sym, env, len);
|
|
146
|
+
}
|