@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,305 @@
|
|
|
1
|
+
/** A C-wrapper for microtex. */
|
|
2
|
+
|
|
3
|
+
#ifndef MICROTEX_CWRAPPER_H
|
|
4
|
+
#define MICROTEX_CWRAPPER_H
|
|
5
|
+
|
|
6
|
+
#ifdef HAVE_CWRAPPER
|
|
7
|
+
|
|
8
|
+
#include "microtexexport.h"
|
|
9
|
+
#include "wrapper/callback.h"
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
extern "C" {
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
typedef void* FontMetaPtr;
|
|
16
|
+
typedef void* RenderPtr;
|
|
17
|
+
typedef void* DrawingData;
|
|
18
|
+
|
|
19
|
+
/** Get the library version. */
|
|
20
|
+
MICROTEX_CAPI const char* microtex_version();
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Register callbacks to the engine.
|
|
24
|
+
*
|
|
25
|
+
* @param createTextLayout callback to create text-layout
|
|
26
|
+
* @param getTextLayoutBounds callback to retrieve the bounds of text-layout created
|
|
27
|
+
* by [createTextLayout]
|
|
28
|
+
* @param releaseTextLayout callback to release a text-layout created by [createTextLayout]
|
|
29
|
+
* @param isPathExists callback to check if a graphical-path is exists
|
|
30
|
+
*/
|
|
31
|
+
MICROTEX_CAPI void microtex_registerCallbacks(
|
|
32
|
+
CBCreateTextLayout createTextLayout,
|
|
33
|
+
CBGetTextLayoutBounds getTextLayoutBounds,
|
|
34
|
+
CBReleaseTextLayout releaseTextLayout,
|
|
35
|
+
CBIsPathExists isPathExists
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/** Set text-layout bounds by given width, height, and ascent. For FFI bindings. */
|
|
39
|
+
MICROTEX_CAPI void
|
|
40
|
+
microtex_setTextLayoutBounds(TextLayoutBounds* b, float width, float height, float ascent);
|
|
41
|
+
|
|
42
|
+
/** Test if a font is bold. For FFI bindings. */
|
|
43
|
+
MICROTEX_CAPI bool microtex_isBold(FontDesc* desc);
|
|
44
|
+
|
|
45
|
+
/** Test if a font is italic. For FFI bindings. */
|
|
46
|
+
MICROTEX_CAPI bool microtex_isItalic(FontDesc* desc);
|
|
47
|
+
|
|
48
|
+
/** Test if a font is sans-serif. For FFI bindings. */
|
|
49
|
+
MICROTEX_CAPI bool microtex_isSansSerif(FontDesc* desc);
|
|
50
|
+
|
|
51
|
+
/** Test if a font is monospace. For FFI bindings. */
|
|
52
|
+
MICROTEX_CAPI bool microtex_isMonospace(FontDesc* desc);
|
|
53
|
+
|
|
54
|
+
/** Retrieve the font size. For FFI bindings. */
|
|
55
|
+
MICROTEX_CAPI float microtex_fontSize(FontDesc* desc);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Initialize the engine by given `clm` data. The data must represents a math font.
|
|
59
|
+
*
|
|
60
|
+
* @param len the number of bytes of the `clm` data
|
|
61
|
+
* @param data the `clm` data
|
|
62
|
+
* @return the meta info of the font, you can retrieve the font family via
|
|
63
|
+
* [microtex_getFontFamily], the font name via [microtex_getFontName], and to test if
|
|
64
|
+
* the font is a math font by [microtex_isMathFont]. You must call [microtex_releaseFontMeta]
|
|
65
|
+
* after this object has no usages.
|
|
66
|
+
*/
|
|
67
|
+
MICROTEX_CAPI FontMetaPtr microtex_init(unsigned long len, const unsigned char* data);
|
|
68
|
+
|
|
69
|
+
/** Release the engine. */
|
|
70
|
+
MICROTEX_CAPI void microtex_release();
|
|
71
|
+
|
|
72
|
+
/** Test if the engine is initialized. */
|
|
73
|
+
MICROTEX_CAPI bool microtex_isInited();
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Add a font to the engine context.
|
|
77
|
+
*
|
|
78
|
+
* @param len the number of bytes of the `clm` data
|
|
79
|
+
* @param data the `clm` data
|
|
80
|
+
* @return the font meta info. You must call [microtex_releaseFontMeta] after this object has
|
|
81
|
+
* no usages.
|
|
82
|
+
*/
|
|
83
|
+
MICROTEX_CAPI FontMetaPtr microtex_addFont(unsigned long len, const unsigned char* data);
|
|
84
|
+
|
|
85
|
+
/** Get the font family name from the given FontMetaPtr. */
|
|
86
|
+
MICROTEX_CAPI const char* microtex_getFontFamily(FontMetaPtr ptr);
|
|
87
|
+
|
|
88
|
+
/** Get the font name from the given FontMetaPtr. */
|
|
89
|
+
MICROTEX_CAPI const char* microtex_getFontName(FontMetaPtr ptr);
|
|
90
|
+
|
|
91
|
+
/** Test if the given font is a math font. */
|
|
92
|
+
MICROTEX_CAPI bool microtex_isMathFont(FontMetaPtr ptr);
|
|
93
|
+
|
|
94
|
+
/** Release the font meta info. */
|
|
95
|
+
MICROTEX_CAPI void microtex_releaseFontMeta(FontMetaPtr ptr);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Set the default math font by name.
|
|
99
|
+
* See [lib/microtex.h: MicroTex::setDefaultMathFont] for details.
|
|
100
|
+
*/
|
|
101
|
+
MICROTEX_CAPI void microtex_setDefaultMathFont(const char* name);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Set the default main font family by name.
|
|
105
|
+
* See [lib/microtex.h: MicroTex::setDefaultMainFont] for details.
|
|
106
|
+
*/
|
|
107
|
+
MICROTEX_CAPI void microtex_setDefaultMainFont(const char* name);
|
|
108
|
+
|
|
109
|
+
/** Test if has the ability to use path to render glyphs. */
|
|
110
|
+
MICROTEX_CAPI bool microtex_hasGlyphPathRender();
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Set if use path to render glyphs, only works when compile option
|
|
114
|
+
* GLYPH_RENDER_TYPE is GLYPH_RENDER_TYPE_BOTH (equals to 0, that means render
|
|
115
|
+
* glyphs use font and path both), otherwise this function takes no effect.
|
|
116
|
+
*/
|
|
117
|
+
MICROTEX_CAPI void microtex_setRenderGlyphUsePath(bool use);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Test if currently use path to render glyphs.
|
|
121
|
+
*
|
|
122
|
+
* See [lib/microtex.h: MicroTeX::isRenderGlyphUsePath] for details.
|
|
123
|
+
*/
|
|
124
|
+
MICROTEX_CAPI bool microtex_isRenderGlyphUsePath();
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Parse a (La)TeX string (in UTF-8 encoding) to Render. You must
|
|
128
|
+
* call [microtex_deleteRender] after it has no usages.
|
|
129
|
+
*
|
|
130
|
+
* See [lib/microtex.h: MicroTeX::parse] for details.
|
|
131
|
+
*/
|
|
132
|
+
MICROTEX_CAPI RenderPtr microtex_parseRender(
|
|
133
|
+
const char* tex,
|
|
134
|
+
int width,
|
|
135
|
+
float textSize,
|
|
136
|
+
float lineSpace,
|
|
137
|
+
unsigned int color,
|
|
138
|
+
bool fillWidth,
|
|
139
|
+
bool enableOverrideTeXStyle,
|
|
140
|
+
unsigned int texStyle
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
/** Delete the render created by [microtex_parseRender] before. */
|
|
144
|
+
MICROTEX_CAPI void microtex_deleteRender(RenderPtr render);
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Get the drawing data from the render created by [microtex_parseRender] before.
|
|
148
|
+
* It generates the drawing commands from the render. You must call
|
|
149
|
+
* [microtex_freeDrawingData] after it has no usages.
|
|
150
|
+
*
|
|
151
|
+
* The drawing data are arranged by following format:
|
|
152
|
+
*
|
|
153
|
+
* @code
|
|
154
|
+
* bytes desc
|
|
155
|
+
* -----------------------------------------------------
|
|
156
|
+
* 4 number of bytes of the drawing data
|
|
157
|
+
* 1 drawing command (e.g. drawLine, setColor...)
|
|
158
|
+
* @endcode
|
|
159
|
+
*
|
|
160
|
+
* And for each drawing command, followed by its arguments, the tables below
|
|
161
|
+
* shows the drawing commands and its arguments.
|
|
162
|
+
*
|
|
163
|
+
* Short for data types:
|
|
164
|
+
*
|
|
165
|
+
* @code
|
|
166
|
+
* data type bytes short
|
|
167
|
+
* ---------------------------
|
|
168
|
+
* int 4 i32
|
|
169
|
+
* unsigned int 4 u32
|
|
170
|
+
* unsigned short 2 u16
|
|
171
|
+
* float 4 f32
|
|
172
|
+
* bool 1 u8
|
|
173
|
+
* @endcode
|
|
174
|
+
*
|
|
175
|
+
* And arguments for each drawing command:
|
|
176
|
+
*
|
|
177
|
+
* @code
|
|
178
|
+
* cmd args desc
|
|
179
|
+
* -----------------------------------------------------------------------------
|
|
180
|
+
* 0 color: u32 Set color.
|
|
181
|
+
*
|
|
182
|
+
* 1 line width : f32 Set line stroke. The possible line-caps are
|
|
183
|
+
* miter limit: f32 {0: butt, 1: round, 2: square}, and the possible
|
|
184
|
+
* line cap: u32 line-joins are {0: bevel, 1: miter, 2: round}.
|
|
185
|
+
* line join: u32
|
|
186
|
+
*
|
|
187
|
+
* 2 has dash: u8 Set the dash pattern to draw lines, users are free
|
|
188
|
+
* to use various dash patterns.
|
|
189
|
+
*
|
|
190
|
+
* 3 font family: string Set font by font family name, the name is 0
|
|
191
|
+
* terminated.
|
|
192
|
+
*
|
|
193
|
+
* 4 font size: f32 Set the font size.
|
|
194
|
+
*
|
|
195
|
+
* 5 delta-x: f32 Translate the context by delta-x and delta-y.
|
|
196
|
+
* delta-y: f32
|
|
197
|
+
*
|
|
198
|
+
* 6 scale-x: f32 Scale the context by scale-x and scale-y.
|
|
199
|
+
* scale-y: f32
|
|
200
|
+
*
|
|
201
|
+
* 7 radian: f32 Rotate the context by the given radian and pivot.
|
|
202
|
+
* pivot-x: f32
|
|
203
|
+
* pivot-y: f32
|
|
204
|
+
*
|
|
205
|
+
* 8 N/A Reset the transformation of the context.
|
|
206
|
+
*
|
|
207
|
+
* 9 glyph: u16 Draw a single glyph at given point (x, y), the glyph
|
|
208
|
+
* x: f32 drawing should be baseline aligned.
|
|
209
|
+
* y: f32
|
|
210
|
+
*
|
|
211
|
+
* 10 path-id: i32 Begin a path with id. The id will be >= 0 if the
|
|
212
|
+
* path is cacheable, otherwise it will be < 0. The
|
|
213
|
+
* engine will use [CBIsPathExists] to determine if the
|
|
214
|
+
* path is in cache.
|
|
215
|
+
*
|
|
216
|
+
* 11 x: f32 Move to point (x, y).
|
|
217
|
+
* y: f32
|
|
218
|
+
*
|
|
219
|
+
* 12 x: f32 Add a line with its end point (x, y) to path.
|
|
220
|
+
* y: f32
|
|
221
|
+
*
|
|
222
|
+
* 13 x1: f32 Add a cubic Bezier spline to path, with control
|
|
223
|
+
* y1: f32 points (x1, y1), (x2, y2) and the final point
|
|
224
|
+
* x2: f32 (x3, y3).
|
|
225
|
+
* y2: f32
|
|
226
|
+
* x3: f32
|
|
227
|
+
* y3: f32
|
|
228
|
+
*
|
|
229
|
+
* 14 x1: f32 Add a quadratic Bezier spline to path, with control
|
|
230
|
+
* y1: f32 point (x1, y1) and the final point (x2, y2).
|
|
231
|
+
* x2: f32
|
|
232
|
+
* y2: f32
|
|
233
|
+
*
|
|
234
|
+
* 15 N/A Close the path.
|
|
235
|
+
*
|
|
236
|
+
* 16 id: i32 Fill the path with the given id. If the path is not
|
|
237
|
+
* cacheable, it always is -1.
|
|
238
|
+
*
|
|
239
|
+
* 17 x1: f32 Draw a line from (x1, y1) to (x2, y2).
|
|
240
|
+
* y1: f32
|
|
241
|
+
* x2: f32
|
|
242
|
+
* y2: f32
|
|
243
|
+
*
|
|
244
|
+
* 18 x: f32 Draw an outlined rectangle at point (x, y) with its
|
|
245
|
+
* y: f32 width (w) and height (h).
|
|
246
|
+
* w: f32
|
|
247
|
+
* h: f32
|
|
248
|
+
*
|
|
249
|
+
* 19 x: f32 Draw a rectangle at point (x, y) with its width (w)
|
|
250
|
+
* y: f32 and height (h).
|
|
251
|
+
* w: f32
|
|
252
|
+
* h: f32
|
|
253
|
+
*
|
|
254
|
+
* 20 x: f32 Draw an outlined round rectangle at point (x, y)
|
|
255
|
+
* y: f32 with its width (w), height (h), radius in
|
|
256
|
+
* w: f32 x-direction (rx) and radius in y-direction (ry).
|
|
257
|
+
* h: f32
|
|
258
|
+
* rx: f32
|
|
259
|
+
* ry: f32
|
|
260
|
+
*
|
|
261
|
+
* 21 x: f32 Draw a round rectangle at point (x, y) with its
|
|
262
|
+
* y: f32 width(w), height(h), radius in x-direction (rx) and
|
|
263
|
+
* w: f32 radius in y-direction (ry).
|
|
264
|
+
* h: f32
|
|
265
|
+
* rx: f32
|
|
266
|
+
* ry: f32
|
|
267
|
+
*
|
|
268
|
+
* 22 id: u32 Draw a text-layout by given id at point (x, y). The
|
|
269
|
+
* x: f32 id was generated by [CBCreateTextLayout].
|
|
270
|
+
* y: f32
|
|
271
|
+
* @endcode
|
|
272
|
+
*/
|
|
273
|
+
MICROTEX_CAPI DrawingData microtex_getDrawingData(RenderPtr render, int x, int y);
|
|
274
|
+
|
|
275
|
+
/** Release the drawing data generated by [microtex_getDrawingData] before. */
|
|
276
|
+
MICROTEX_CAPI void microtex_freeDrawingData(DrawingData data);
|
|
277
|
+
|
|
278
|
+
/** Test if the host machine is little-endian. */
|
|
279
|
+
MICROTEX_CAPI bool microtex_isLittleEndian();
|
|
280
|
+
|
|
281
|
+
/** Get the render width. */
|
|
282
|
+
MICROTEX_CAPI int microtex_getRenderWidth(RenderPtr render);
|
|
283
|
+
|
|
284
|
+
/** Get the render height. */
|
|
285
|
+
MICROTEX_CAPI int microtex_getRenderHeight(RenderPtr render);
|
|
286
|
+
|
|
287
|
+
/** Get the render depth. */
|
|
288
|
+
MICROTEX_CAPI int microtex_getRenderDepth(RenderPtr render);
|
|
289
|
+
|
|
290
|
+
/** Test if the render is split (has new line). */
|
|
291
|
+
MICROTEX_CAPI bool microtex_isRenderSplit(RenderPtr render);
|
|
292
|
+
|
|
293
|
+
/** Set the text size to draw the render. */
|
|
294
|
+
MICROTEX_CAPI void microtex_setRenderTextSize(RenderPtr render, float size);
|
|
295
|
+
|
|
296
|
+
/** Set the foreground color to draw the render. */
|
|
297
|
+
MICROTEX_CAPI void microtex_setRenderForeground(RenderPtr render, unsigned int c);
|
|
298
|
+
|
|
299
|
+
#ifdef __cplusplus
|
|
300
|
+
}
|
|
301
|
+
#endif
|
|
302
|
+
|
|
303
|
+
#endif // HAVE_CWRAPPER
|
|
304
|
+
|
|
305
|
+
#endif // MICROTEX_CWRAPPER_H
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
#ifdef HAVE_CWRAPPER
|
|
2
|
+
|
|
3
|
+
#include "wrapper/graphic_wrapper.h"
|
|
4
|
+
|
|
5
|
+
#include "wrapper/callback.h"
|
|
6
|
+
|
|
7
|
+
using namespace microtex;
|
|
8
|
+
|
|
9
|
+
Font_wrapper::Font_wrapper(std::string name) : _name(std::move(name)) {}
|
|
10
|
+
|
|
11
|
+
const std::string& Font_wrapper::name() const {
|
|
12
|
+
return _name;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
bool Font_wrapper::operator==(const Font& f) const {
|
|
16
|
+
return _name == static_cast<const Font_wrapper&>(f)._name;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**************************************************************************************************/
|
|
20
|
+
|
|
21
|
+
TextLayout_wrapper::TextLayout_wrapper(u32 id) : _id(id) {}
|
|
22
|
+
|
|
23
|
+
TextLayout_wrapper::~TextLayout_wrapper() noexcept {
|
|
24
|
+
microtex_releaseTextLayout(_id);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
void TextLayout_wrapper::getBounds(Rect& bounds) {
|
|
28
|
+
TextLayoutBounds b{0, 0, 0};
|
|
29
|
+
microtex_getTextLayoutBounds(_id, &b);
|
|
30
|
+
bounds.x = 0;
|
|
31
|
+
bounds.w = b.width;
|
|
32
|
+
bounds.h = b.height;
|
|
33
|
+
bounds.y = b.ascent;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
void TextLayout_wrapper::draw(Graphics2D& g2, float x, float y) {
|
|
37
|
+
auto& g = static_cast<Graphics2D_wrapper&>(g2);
|
|
38
|
+
g.drawTextLayout(_id, x, y);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**************************************************************************************************/
|
|
42
|
+
|
|
43
|
+
sptr<TextLayout>
|
|
44
|
+
PlatformFactory_wrapper::createTextLayout(const std::string& src, FontStyle style, float size) {
|
|
45
|
+
FontDesc f{
|
|
46
|
+
microtex::isBold(style),
|
|
47
|
+
microtex::isItalic(style),
|
|
48
|
+
microtex::isSansSerif(style),
|
|
49
|
+
microtex::isMono(style),
|
|
50
|
+
size,
|
|
51
|
+
};
|
|
52
|
+
const auto id = microtex_createTextLayout(src.c_str(), &f);
|
|
53
|
+
return sptrOf<TextLayout_wrapper>(id);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
sptr<Font> PlatformFactory_wrapper::createFont(const std::string& file) {
|
|
57
|
+
return sptrOf<Font_wrapper>(file);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**************************************************************************************************/
|
|
61
|
+
|
|
62
|
+
Graphics2D_wrapper::Graphics2D_wrapper() : _color(black), _sx(1), _sy(1) {}
|
|
63
|
+
|
|
64
|
+
void* Graphics2D_wrapper::getDrawingData() {
|
|
65
|
+
return _cmds.finish();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
void Graphics2D_wrapper::setColor(color c) {
|
|
69
|
+
if (_color == c) return;
|
|
70
|
+
_color = c;
|
|
71
|
+
_cmds.put((u8)0, c);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
color Graphics2D_wrapper::getColor() const {
|
|
75
|
+
return _color;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
void Graphics2D_wrapper::setStroke(const Stroke& s) {
|
|
79
|
+
if (_stroke == s) return;
|
|
80
|
+
_stroke = s;
|
|
81
|
+
_cmds.put((u8)1, s.lineWidth, s.miterLimit, (u32)s.cap, (u32)s.join);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
void Graphics2D_wrapper::setStrokeWidth(float w) {
|
|
85
|
+
if (_stroke.lineWidth == w) return;
|
|
86
|
+
_stroke.lineWidth = w;
|
|
87
|
+
_cmds.put((u8)1, _stroke.lineWidth, _stroke.miterLimit, (u32)_stroke.cap, (u32)_stroke.join);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const Stroke& Graphics2D_wrapper::getStroke() const {
|
|
91
|
+
return _stroke;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
void Graphics2D_wrapper::setDash(const std::vector<float>& dash) {
|
|
95
|
+
// TODO only support command, no pattern was given
|
|
96
|
+
const auto hasDash = !dash.empty();
|
|
97
|
+
_cmds.put((u8)2, hasDash ? (u8)1 : (u8)0);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
std::vector<float> Graphics2D_wrapper::getDash() {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
sptr<Font> Graphics2D_wrapper::getFont() const {
|
|
105
|
+
return _font;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
void Graphics2D_wrapper::setFont(const sptr<Font>& font) {
|
|
109
|
+
if (_font != nullptr && *_font == *font) return;
|
|
110
|
+
_font = font;
|
|
111
|
+
_cmds.put((u8)3, std::static_pointer_cast<Font_wrapper>(_font)->name().c_str());
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
float Graphics2D_wrapper::getFontSize() const {
|
|
115
|
+
return _fontSize;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
void Graphics2D_wrapper::setFontSize(float size) {
|
|
119
|
+
if (_fontSize == size) return;
|
|
120
|
+
_cmds.put((u8)4, size);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
void Graphics2D_wrapper::translate(float dx, float dy) {
|
|
124
|
+
_cmds.put((u8)5, dx, dy);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
void Graphics2D_wrapper::scale(float sx, float sy) {
|
|
128
|
+
_sx *= sx;
|
|
129
|
+
_sy *= sy;
|
|
130
|
+
_cmds.put((u8)6, sx, sy);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
void Graphics2D_wrapper::rotate(float angle) {
|
|
134
|
+
_cmds.put((u8)7, angle, 0.f, 0.f);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
void Graphics2D_wrapper::rotate(float angle, float px, float py) {
|
|
138
|
+
_cmds.put((u8)7, angle, px, py);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
void Graphics2D_wrapper::reset() {
|
|
142
|
+
_sx = _sy = 1.f;
|
|
143
|
+
_cmds.put((u8)8);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
float Graphics2D_wrapper::sx() const {
|
|
147
|
+
return _sx;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
float Graphics2D_wrapper::sy() const {
|
|
151
|
+
return _sy;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
void Graphics2D_wrapper::drawGlyph(u16 glyph, float x, float y) {
|
|
155
|
+
_cmds.put((u8)9, glyph, x, y);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
bool Graphics2D_wrapper::beginPath(i32 id) {
|
|
159
|
+
_cmds.put((u8)10, id);
|
|
160
|
+
return microtex_isPathExists(id);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
void Graphics2D_wrapper::moveTo(float x, float y) {
|
|
164
|
+
_cmds.put((u8)11, x, y);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
void Graphics2D_wrapper::lineTo(float x, float y) {
|
|
168
|
+
_cmds.put((u8)12, x, y);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
void Graphics2D_wrapper::cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) {
|
|
172
|
+
_cmds.put((u8)13, x1, y1, x2, y2, x3, y3);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
void Graphics2D_wrapper::quadTo(float x1, float y1, float x2, float y2) {
|
|
176
|
+
_cmds.put((u8)14, x1, y1, x2, y2);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
void Graphics2D_wrapper::closePath() {
|
|
180
|
+
_cmds.put((u8)15);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
void Graphics2D_wrapper::fillPath(i32 id) {
|
|
184
|
+
_cmds.put((u8)16, id);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
void Graphics2D_wrapper::drawLine(float x1, float y1, float x2, float y2) {
|
|
188
|
+
_cmds.put((u8)17, x1, y1, x2, y2);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
void Graphics2D_wrapper::drawRect(float x, float y, float w, float h) {
|
|
192
|
+
_cmds.put((u8)18, x, y, w, h);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
void Graphics2D_wrapper::fillRect(float x, float y, float w, float h) {
|
|
196
|
+
_cmds.put((u8)19, x, y, w, h);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
void Graphics2D_wrapper::drawRoundRect(float x, float y, float w, float h, float rx, float ry) {
|
|
200
|
+
_cmds.put((u8)20, x, y, w, h, rx, ry);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
void Graphics2D_wrapper::fillRoundRect(float x, float y, float w, float h, float rx, float ry) {
|
|
204
|
+
_cmds.put((u8)21, x, y, w, h, rx, ry);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
void Graphics2D_wrapper::drawTextLayout(u32 id, float x, float y) {
|
|
208
|
+
_cmds.put((u8)22, id, x, y);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
#endif // HAVE_CWRAPPER
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#ifndef MICROTEX_GRAPHIC_WRAPPER_H
|
|
2
|
+
#define MICROTEX_GRAPHIC_WRAPPER_H
|
|
3
|
+
|
|
4
|
+
#ifdef HAVE_CWRAPPER
|
|
5
|
+
|
|
6
|
+
#include "graphic/graphic.h"
|
|
7
|
+
#include "wrapper/byte_seq.h"
|
|
8
|
+
|
|
9
|
+
namespace microtex {
|
|
10
|
+
|
|
11
|
+
class Font_wrapper : public Font {
|
|
12
|
+
private:
|
|
13
|
+
std::string _name;
|
|
14
|
+
|
|
15
|
+
public:
|
|
16
|
+
explicit Font_wrapper(std::string name);
|
|
17
|
+
|
|
18
|
+
const std::string& name() const;
|
|
19
|
+
|
|
20
|
+
bool operator==(const Font& f) const override;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**************************************************************************************************/
|
|
24
|
+
|
|
25
|
+
class TextLayout_wrapper : public TextLayout {
|
|
26
|
+
private:
|
|
27
|
+
const u32 _id;
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
explicit TextLayout_wrapper(u32 id);
|
|
31
|
+
|
|
32
|
+
~TextLayout_wrapper() noexcept override;
|
|
33
|
+
|
|
34
|
+
void getBounds(Rect& bounds) override;
|
|
35
|
+
|
|
36
|
+
void draw(Graphics2D& g2, float x, float y) override;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**************************************************************************************************/
|
|
40
|
+
|
|
41
|
+
class PlatformFactory_wrapper : public PlatformFactory {
|
|
42
|
+
public:
|
|
43
|
+
sptr<Font> createFont(const std::string& file) override;
|
|
44
|
+
|
|
45
|
+
sptr<TextLayout> createTextLayout(const std::string& src, FontStyle style, float size) override;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**************************************************************************************************/
|
|
49
|
+
|
|
50
|
+
class Graphics2D_wrapper : public Graphics2D {
|
|
51
|
+
private:
|
|
52
|
+
color _color;
|
|
53
|
+
Stroke _stroke;
|
|
54
|
+
ByteSeq _cmds;
|
|
55
|
+
float _sx, _sy;
|
|
56
|
+
|
|
57
|
+
sptr<Font> _font;
|
|
58
|
+
float _fontSize;
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
Graphics2D_wrapper();
|
|
62
|
+
|
|
63
|
+
void* getDrawingData();
|
|
64
|
+
|
|
65
|
+
// cmd: 0
|
|
66
|
+
void setColor(color c) override;
|
|
67
|
+
|
|
68
|
+
color getColor() const override;
|
|
69
|
+
|
|
70
|
+
// cmd: 1
|
|
71
|
+
void setStroke(const Stroke& s) override;
|
|
72
|
+
|
|
73
|
+
const Stroke& getStroke() const override;
|
|
74
|
+
|
|
75
|
+
// cmd: 1
|
|
76
|
+
void setStrokeWidth(float w) override;
|
|
77
|
+
|
|
78
|
+
// cmd: 2
|
|
79
|
+
void setDash(const std::vector<float>& dash) override;
|
|
80
|
+
|
|
81
|
+
std::vector<float> getDash() override;
|
|
82
|
+
|
|
83
|
+
sptr<Font> getFont() const override;
|
|
84
|
+
|
|
85
|
+
// cmd: 3
|
|
86
|
+
void setFont(const sptr<Font>& font) override;
|
|
87
|
+
|
|
88
|
+
float getFontSize() const override;
|
|
89
|
+
|
|
90
|
+
// cmd: 4
|
|
91
|
+
void setFontSize(float size) override;
|
|
92
|
+
|
|
93
|
+
// cmd: 5
|
|
94
|
+
void translate(float dx, float dy) override;
|
|
95
|
+
|
|
96
|
+
// cmd: 6
|
|
97
|
+
void scale(float sx, float sy) override;
|
|
98
|
+
|
|
99
|
+
// cmd: 7
|
|
100
|
+
void rotate(float angle) override;
|
|
101
|
+
|
|
102
|
+
// cmd: 7
|
|
103
|
+
void rotate(float angle, float px, float py) override;
|
|
104
|
+
|
|
105
|
+
// cmd: 8
|
|
106
|
+
void reset() override;
|
|
107
|
+
|
|
108
|
+
float sx() const override;
|
|
109
|
+
|
|
110
|
+
float sy() const override;
|
|
111
|
+
|
|
112
|
+
// cmd: 9
|
|
113
|
+
void drawGlyph(u16 glyph, float x, float y) override;
|
|
114
|
+
|
|
115
|
+
// cmd: 10
|
|
116
|
+
bool beginPath(i32 id) override;
|
|
117
|
+
|
|
118
|
+
// cmd: 11
|
|
119
|
+
void moveTo(float x, float y) override;
|
|
120
|
+
|
|
121
|
+
// cmd: 12
|
|
122
|
+
void lineTo(float x, float y) override;
|
|
123
|
+
|
|
124
|
+
// cmd: 13
|
|
125
|
+
void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) override;
|
|
126
|
+
|
|
127
|
+
// cmd: 14
|
|
128
|
+
void quadTo(float x1, float y1, float x2, float y2) override;
|
|
129
|
+
|
|
130
|
+
// cmd: 15
|
|
131
|
+
void closePath() override;
|
|
132
|
+
|
|
133
|
+
// cmd: 16
|
|
134
|
+
void fillPath(i32 id) override;
|
|
135
|
+
|
|
136
|
+
// cmd: 17
|
|
137
|
+
void drawLine(float x1, float y1, float x2, float y2) override;
|
|
138
|
+
|
|
139
|
+
// cmd: 18
|
|
140
|
+
void drawRect(float x, float y, float w, float h) override;
|
|
141
|
+
|
|
142
|
+
// cmd: 19
|
|
143
|
+
void fillRect(float x, float y, float w, float h) override;
|
|
144
|
+
|
|
145
|
+
// cmd: 20
|
|
146
|
+
void drawRoundRect(float x, float y, float w, float h, float rx, float ry) override;
|
|
147
|
+
|
|
148
|
+
// cmd: 21
|
|
149
|
+
void fillRoundRect(float x, float y, float w, float h, float rx, float ry) override;
|
|
150
|
+
|
|
151
|
+
// cmd: 22
|
|
152
|
+
void drawTextLayout(u32 id, float x, float y);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
} // namespace microtex
|
|
156
|
+
|
|
157
|
+
#endif // HAVE_CWRAPPER
|
|
158
|
+
|
|
159
|
+
#endif // MICROTEX_GRAPHIC_WRAPPER_H
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
cwrapper_src = [
|
|
2
|
+
'byte_seq.cpp',
|
|
3
|
+
'callback.cpp',
|
|
4
|
+
'cwrapper.cpp',
|
|
5
|
+
'graphic_wrapper.cpp'
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
microtex_cwrapper_lib = library('microtex-cwrapper', cwrapper_src,
|
|
9
|
+
link_with: microtex_lib,
|
|
10
|
+
include_directories: inc,
|
|
11
|
+
cpp_args: ['-DHAVE_CWRAPPER'],
|
|
12
|
+
version: meson.project_version(),
|
|
13
|
+
soversion: microtex_api_version,
|
|
14
|
+
install: false
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
microtex_cwrapper_dep = declare_dependency(
|
|
18
|
+
link_with: [microtex_lib, microtex_cwrapper_lib],
|
|
19
|
+
include_directories: ['.', inc],
|
|
20
|
+
compile_args: ['-DHAVE_CWRAPPER'],
|
|
21
|
+
version: meson.project_version()
|
|
22
|
+
)
|