@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,352 @@
|
|
|
1
|
+
#include "graphic_win32.h"
|
|
2
|
+
|
|
3
|
+
#include "utils/exceptions.h"
|
|
4
|
+
#include "utils/nums.h"
|
|
5
|
+
#include "utils/utils.h"
|
|
6
|
+
// fix error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
|
|
7
|
+
#include <comdef.h>
|
|
8
|
+
#include <gdiplus.h>
|
|
9
|
+
#include <windows.h>
|
|
10
|
+
|
|
11
|
+
using namespace std;
|
|
12
|
+
using namespace microtex;
|
|
13
|
+
|
|
14
|
+
std::wstring microtex::win32ToWideString(const std::string& str) {
|
|
15
|
+
std::wstring wstr;
|
|
16
|
+
auto l = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, nullptr, 0);
|
|
17
|
+
wstr.resize(l + 10);
|
|
18
|
+
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, &wstr[0], (int)wstr.size());
|
|
19
|
+
return wstr;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**************************************************************************************************/
|
|
23
|
+
|
|
24
|
+
std::map<std::string, sptr<Font_win32>> Font_win32::_win32Faces;
|
|
25
|
+
|
|
26
|
+
sptr<Font_win32> Font_win32::getOrCreate(const std::string& file) {
|
|
27
|
+
auto it = _win32Faces.find(file);
|
|
28
|
+
if (it != _win32Faces.end()) {
|
|
29
|
+
return it->second;
|
|
30
|
+
}
|
|
31
|
+
// add font to font collection, some like fontconfig
|
|
32
|
+
Gdiplus::PrivateFontCollection c;
|
|
33
|
+
const auto& wfile = win32ToWideString(file);
|
|
34
|
+
c.AddFontFile(wfile.c_str());
|
|
35
|
+
auto ff = new Gdiplus::FontFamily();
|
|
36
|
+
int num = 0;
|
|
37
|
+
c.GetFamilies(1, ff, &num);
|
|
38
|
+
if (num <= 0) {
|
|
39
|
+
throw microtex::ex_invalid_state("Cannot load font file " + file);
|
|
40
|
+
}
|
|
41
|
+
// search order:
|
|
42
|
+
// regular -> bold -> italic -> bold-italic
|
|
43
|
+
int style;
|
|
44
|
+
if (ff->IsStyleAvailable(Gdiplus::FontStyleRegular)) {
|
|
45
|
+
style = Gdiplus::FontStyleRegular;
|
|
46
|
+
} else if (ff->IsStyleAvailable(Gdiplus::FontStyleBold)) {
|
|
47
|
+
style = Gdiplus::FontStyleBold;
|
|
48
|
+
} else if (ff->IsStyleAvailable(Gdiplus::FontStyleItalic)) {
|
|
49
|
+
style = Gdiplus::FontStyleItalic;
|
|
50
|
+
} else if (ff->IsStyleAvailable(Gdiplus::FontStyleBoldItalic)) {
|
|
51
|
+
style = Gdiplus::FontStyleBoldItalic;
|
|
52
|
+
} else {
|
|
53
|
+
throw microtex::ex_invalid_state("No available font in file " + file);
|
|
54
|
+
}
|
|
55
|
+
auto f = sptrOf<Font_win32>(ff, style);
|
|
56
|
+
_win32Faces[file] = f;
|
|
57
|
+
return f;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Font_win32::Font_win32(const Gdiplus::FontFamily* family, int style, bool isSystem)
|
|
61
|
+
: _family(family), _style(style), _isSystem(isSystem) {}
|
|
62
|
+
|
|
63
|
+
sptr<Gdiplus::Font> Font_win32::getFont(float size) {
|
|
64
|
+
auto f = new Gdiplus::Font(_family, size, _style, Gdiplus::UnitPixel);
|
|
65
|
+
return sptr<Gdiplus::Font>(f);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
int Font_win32::getEmHeight() {
|
|
69
|
+
return _family->GetEmHeight(_style);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
int Font_win32::getCellAscent() {
|
|
73
|
+
return _family->GetCellAscent(_style);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
bool Font_win32::operator==(const Font& ft) const {
|
|
77
|
+
const auto& f = static_cast<const Font_win32&>(ft);
|
|
78
|
+
return f._family == _family;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Font_win32::~Font_win32() noexcept {
|
|
82
|
+
if (!_isSystem) delete _family;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**************************************************************************************************/
|
|
86
|
+
|
|
87
|
+
Gdiplus::Graphics* TextLayout_win32::_g = nullptr;
|
|
88
|
+
Gdiplus::Bitmap* TextLayout_win32::_img = nullptr;
|
|
89
|
+
const Gdiplus::StringFormat* TextLayout_win32::_format = nullptr;
|
|
90
|
+
|
|
91
|
+
TextLayout_win32::TextLayout_win32(const std::string& src, FontStyle style, float size)
|
|
92
|
+
: _fontSize(size) {
|
|
93
|
+
if (_img == nullptr) {
|
|
94
|
+
_img = new Gdiplus::Bitmap(1, 1, PixelFormat32bppARGB);
|
|
95
|
+
_g = Gdiplus::Graphics::FromImage(_img);
|
|
96
|
+
_format = Gdiplus::StringFormat::GenericTypographic();
|
|
97
|
+
}
|
|
98
|
+
const auto* f = Gdiplus::FontFamily::GenericSerif();
|
|
99
|
+
if (microtex::isSansSerif(style)) {
|
|
100
|
+
f = Gdiplus::FontFamily::GenericSansSerif();
|
|
101
|
+
}
|
|
102
|
+
if (microtex::isMono(style)) {
|
|
103
|
+
f = Gdiplus::FontFamily::GenericMonospace();
|
|
104
|
+
}
|
|
105
|
+
int s = Gdiplus::FontStyleRegular;
|
|
106
|
+
if (microtex::isBold(style)) {
|
|
107
|
+
s |= Gdiplus::FontStyleBold;
|
|
108
|
+
}
|
|
109
|
+
if (microtex::isItalic(style)) {
|
|
110
|
+
s |= Gdiplus::FontStyleItalic;
|
|
111
|
+
}
|
|
112
|
+
if (!f->IsStyleAvailable(s)) {
|
|
113
|
+
s = Gdiplus::FontStyleRegular;
|
|
114
|
+
}
|
|
115
|
+
_font = sptrOf<Font_win32>(f, s, true);
|
|
116
|
+
_txt = win32ToWideString(src);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
void TextLayout_win32::getBounds(Rect& r) {
|
|
120
|
+
int em = _font->getEmHeight();
|
|
121
|
+
int ascent = _font->getCellAscent();
|
|
122
|
+
float ap = _fontSize * ascent / em;
|
|
123
|
+
auto f = _font->getFont(_fontSize);
|
|
124
|
+
Gdiplus::RectF r1;
|
|
125
|
+
_g->MeasureString(
|
|
126
|
+
_txt.c_str(),
|
|
127
|
+
(int)wcslen(_txt.c_str()),
|
|
128
|
+
f.get(),
|
|
129
|
+
Gdiplus::PointF(0, 0),
|
|
130
|
+
_format,
|
|
131
|
+
&r1
|
|
132
|
+
);
|
|
133
|
+
r.x = 0;
|
|
134
|
+
r.y = -ap;
|
|
135
|
+
r.w = r1.Width;
|
|
136
|
+
r.h = r1.Height;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
void TextLayout_win32::draw(Graphics2D& g2, float x, float y) {
|
|
140
|
+
auto& g = static_cast<Graphics2D_win32&>(g2);
|
|
141
|
+
auto prev = g2.getFont();
|
|
142
|
+
auto prevSize = g2.getFontSize();
|
|
143
|
+
g.setFont(_font);
|
|
144
|
+
g.setFontSize(_fontSize);
|
|
145
|
+
g.drawText(_txt, x, y);
|
|
146
|
+
g.setFontSize(prevSize);
|
|
147
|
+
g.setFont(prev);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**************************************************************************************************/
|
|
151
|
+
|
|
152
|
+
sptr<microtex::Font> PlatformFactory_gdi::createFont(const std::string& file) {
|
|
153
|
+
return Font_win32::getOrCreate(file);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
sptr<TextLayout>
|
|
157
|
+
PlatformFactory_gdi::createTextLayout(const std::string& src, FontStyle style, float size) {
|
|
158
|
+
return sptrOf<TextLayout_win32>(src, style, size);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**************************************************************************************************/
|
|
162
|
+
|
|
163
|
+
const Gdiplus::StringFormat* Graphics2D_win32::_format;
|
|
164
|
+
|
|
165
|
+
Graphics2D_win32::Graphics2D_win32(Gdiplus::Graphics* g) {
|
|
166
|
+
if (_format == nullptr) {
|
|
167
|
+
_format = Gdiplus::StringFormat::GenericTypographic();
|
|
168
|
+
}
|
|
169
|
+
_fontSize = 0.f;
|
|
170
|
+
_sx = _sy = 1.f;
|
|
171
|
+
_color = black;
|
|
172
|
+
_g = g;
|
|
173
|
+
_g->ResetTransform();
|
|
174
|
+
_g->SetSmoothingMode(Gdiplus::SmoothingModeHighQuality);
|
|
175
|
+
_g->SetTextRenderingHint(Gdiplus::TextRenderingHintAntiAlias);
|
|
176
|
+
_pen = new Gdiplus::Pen(Gdiplus::Color(_color));
|
|
177
|
+
_brush = new Gdiplus::SolidBrush(Gdiplus::Color(_color));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
Graphics2D_win32::~Graphics2D_win32() {
|
|
181
|
+
delete _pen;
|
|
182
|
+
delete _brush;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
void Graphics2D_win32::setColor(color color) {
|
|
186
|
+
_color = color;
|
|
187
|
+
_pen->SetColor(Gdiplus::Color(color));
|
|
188
|
+
_brush->SetColor(Gdiplus::Color(color));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
color Graphics2D_win32::getColor() const {
|
|
192
|
+
return _color;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
void Graphics2D_win32::setStroke(const Stroke& s) {
|
|
196
|
+
_stroke = s;
|
|
197
|
+
_pen->SetWidth(s.lineWidth);
|
|
198
|
+
Gdiplus::LineCap c;
|
|
199
|
+
switch (s.cap) {
|
|
200
|
+
case CAP_BUTT: c = Gdiplus::LineCapFlat; break;
|
|
201
|
+
case CAP_ROUND: c = Gdiplus::LineCapRound; break;
|
|
202
|
+
case CAP_SQUARE: c = Gdiplus::LineCapSquare; break;
|
|
203
|
+
}
|
|
204
|
+
_pen->SetLineCap(c, c, Gdiplus::DashCapRound);
|
|
205
|
+
Gdiplus::LineJoin j;
|
|
206
|
+
switch (s.join) {
|
|
207
|
+
case JOIN_BEVEL: j = Gdiplus::LineJoinBevel; break;
|
|
208
|
+
case JOIN_ROUND: j = Gdiplus::LineJoinRound; break;
|
|
209
|
+
case JOIN_MITER: j = Gdiplus::LineJoinMiter; break;
|
|
210
|
+
}
|
|
211
|
+
_pen->SetLineJoin(j);
|
|
212
|
+
_pen->SetMiterLimit(s.miterLimit);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const Stroke& Graphics2D_win32::getStroke() const {
|
|
216
|
+
return _stroke;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
void Graphics2D_win32::setStrokeWidth(float w) {
|
|
220
|
+
_stroke.lineWidth = w;
|
|
221
|
+
_pen->SetWidth(w);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
void Graphics2D_win32::setDash(const std::vector<float>& dash) {
|
|
225
|
+
// todo
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
std::vector<float> Graphics2D_win32::getDash() {
|
|
229
|
+
// todo
|
|
230
|
+
return {};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
sptr<microtex::Font> Graphics2D_win32::getFont() const {
|
|
234
|
+
return _font;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
void Graphics2D_win32::setFont(const sptr<Font>& font) {
|
|
238
|
+
_font = std::static_pointer_cast<Font_win32>(font);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
float Graphics2D_win32::getFontSize() const {
|
|
242
|
+
return _fontSize;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
void Graphics2D_win32::setFontSize(float size) {
|
|
246
|
+
_fontSize = size;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
void Graphics2D_win32::translate(float dx, float dy) {
|
|
250
|
+
_g->TranslateTransform(dx, dy);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
void Graphics2D_win32::scale(float sx, float sy) {
|
|
254
|
+
_sx *= sx;
|
|
255
|
+
_sy *= sy;
|
|
256
|
+
_g->ScaleTransform(sx, sy);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
void Graphics2D_win32::rotate(float angle) {
|
|
260
|
+
_g->RotateTransform(angle / PI * 180);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
void Graphics2D_win32::rotate(float angle, float px, float py) {
|
|
264
|
+
_g->TranslateTransform(px, py);
|
|
265
|
+
_g->RotateTransform(angle / PI * 180);
|
|
266
|
+
_g->TranslateTransform(-px, -py);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
void Graphics2D_win32::reset() {
|
|
270
|
+
_g->ResetTransform();
|
|
271
|
+
_sx = _sy = 1.f;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
float Graphics2D_win32::sx() const {
|
|
275
|
+
return _sx;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
float Graphics2D_win32::sy() const {
|
|
279
|
+
return _sy;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
void Graphics2D_win32::drawGlyph(u16 glyph, float x, float y) {
|
|
283
|
+
if (_font == nullptr) return;
|
|
284
|
+
auto f = _font->getFont(_fontSize);
|
|
285
|
+
auto p = Gdiplus::PointF(x, y);
|
|
286
|
+
_g->DrawDriverString(&glyph, 1, f.get(), _brush, &p, 0, nullptr);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
bool Graphics2D_win32::beginPath(i32 id) {
|
|
290
|
+
// not supported
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
void Graphics2D_win32::moveTo(float x, float y) {
|
|
295
|
+
// not supported
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
void Graphics2D_win32::lineTo(float x, float y) {
|
|
299
|
+
// not supported
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
void Graphics2D_win32::cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) {
|
|
303
|
+
// not supported
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
void Graphics2D_win32::quadTo(float x1, float y1, float x2, float y2) {
|
|
307
|
+
// not supported
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
void Graphics2D_win32::closePath() {
|
|
311
|
+
// not supported
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
void Graphics2D_win32::fillPath(i32 id) {
|
|
315
|
+
// not supported
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
void Graphics2D_win32::drawText(const std::wstring& src, float x, float y) {
|
|
319
|
+
auto f = std::static_pointer_cast<Font_win32>(_font);
|
|
320
|
+
int em = f->getEmHeight();
|
|
321
|
+
int ascent = f->getCellAscent();
|
|
322
|
+
float ap = _fontSize * ascent / em;
|
|
323
|
+
int len = src.length();
|
|
324
|
+
auto font = _font->getFont(_fontSize);
|
|
325
|
+
Gdiplus::RectF r1, r2;
|
|
326
|
+
_g->MeasureString(src.c_str(), len, font.get(), Gdiplus::PointF(0, 0), &r1);
|
|
327
|
+
_g->MeasureString(src.c_str(), len, font.get(), Gdiplus::PointF(0, 0), _format, &r2);
|
|
328
|
+
float off = (r1.Width - r2.Width) / 2.f;
|
|
329
|
+
_g->DrawString(src.c_str(), len, font.get(), Gdiplus::PointF(x - off, y - ap), _brush);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
void Graphics2D_win32::drawLine(float x1, float y1, float x2, float y2) {
|
|
333
|
+
_g->DrawLine(_pen, x1, y1, x2, y2);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
void Graphics2D_win32::drawRect(float x, float y, float w, float h) {
|
|
337
|
+
_g->DrawRectangle(_pen, x, y, w, h);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
void Graphics2D_win32::fillRect(float x, float y, float w, float h) {
|
|
341
|
+
_g->FillRectangle(_brush, x, y, w, h);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
void Graphics2D_win32::drawRoundRect(float x, float y, float w, float h, float rx, float ry) {
|
|
345
|
+
// not supported
|
|
346
|
+
drawRect(x, y, w, h);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
void Graphics2D_win32::fillRoundRect(float x, float y, float w, float h, float rx, float ry) {
|
|
350
|
+
// not supported
|
|
351
|
+
fillRect(x, y, w, h);
|
|
352
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#ifndef GRAPHIC_WIN32_H_INCLUDED
|
|
2
|
+
#define GRAPHIC_WIN32_H_INCLUDED
|
|
3
|
+
|
|
4
|
+
#include <map>
|
|
5
|
+
|
|
6
|
+
#include "graphic/graphic.h"
|
|
7
|
+
#include "microtexexport.h"
|
|
8
|
+
|
|
9
|
+
namespace Gdiplus {
|
|
10
|
+
|
|
11
|
+
class Font;
|
|
12
|
+
class FontFamily;
|
|
13
|
+
class Graphics;
|
|
14
|
+
class Pen;
|
|
15
|
+
class Brush;
|
|
16
|
+
class SolidBrush;
|
|
17
|
+
class StringFormat;
|
|
18
|
+
class Bitmap;
|
|
19
|
+
|
|
20
|
+
} // namespace Gdiplus
|
|
21
|
+
|
|
22
|
+
namespace microtex {
|
|
23
|
+
|
|
24
|
+
std::wstring win32ToWideString(const std::string& str);
|
|
25
|
+
|
|
26
|
+
class MICROTEX_EXPORT Font_win32 : public Font {
|
|
27
|
+
private:
|
|
28
|
+
static std::map<std::string, sptr<Font_win32>> _win32Faces;
|
|
29
|
+
|
|
30
|
+
const Gdiplus::FontFamily* _family;
|
|
31
|
+
int _style;
|
|
32
|
+
bool _isSystem;
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
Font_win32(const Gdiplus::FontFamily* family, int style, bool isSystem = false);
|
|
36
|
+
|
|
37
|
+
sptr<Gdiplus::Font> getFont(float size);
|
|
38
|
+
|
|
39
|
+
int getEmHeight();
|
|
40
|
+
|
|
41
|
+
int getCellAscent();
|
|
42
|
+
|
|
43
|
+
bool operator==(const Font& f) const override;
|
|
44
|
+
|
|
45
|
+
static sptr<Font_win32> getOrCreate(const std::string& file);
|
|
46
|
+
|
|
47
|
+
~Font_win32() noexcept override;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**************************************************************************************************/
|
|
51
|
+
|
|
52
|
+
class MICROTEX_EXPORT TextLayout_win32 : public TextLayout {
|
|
53
|
+
private:
|
|
54
|
+
std::wstring _txt;
|
|
55
|
+
sptr<Font_win32> _font;
|
|
56
|
+
float _fontSize;
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
static const Gdiplus::StringFormat* _format;
|
|
60
|
+
static Gdiplus::Graphics* _g;
|
|
61
|
+
static Gdiplus::Bitmap* _img;
|
|
62
|
+
|
|
63
|
+
TextLayout_win32(const std::string& src, FontStyle style, float size);
|
|
64
|
+
|
|
65
|
+
void getBounds(Rect& bounds) override;
|
|
66
|
+
|
|
67
|
+
void draw(Graphics2D& g2, float x, float y) override;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**************************************************************************************************/
|
|
71
|
+
|
|
72
|
+
class MICROTEX_EXPORT PlatformFactory_gdi : public PlatformFactory {
|
|
73
|
+
public:
|
|
74
|
+
sptr<Font> createFont(const std::string& file) override;
|
|
75
|
+
|
|
76
|
+
sptr<TextLayout> createTextLayout(const std::string& src, FontStyle style, float size) override;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**************************************************************************************************/
|
|
80
|
+
|
|
81
|
+
class MICROTEX_EXPORT Graphics2D_win32 : public Graphics2D {
|
|
82
|
+
private:
|
|
83
|
+
static const Gdiplus::StringFormat* _format;
|
|
84
|
+
|
|
85
|
+
color _color;
|
|
86
|
+
sptr<Font_win32> _font;
|
|
87
|
+
Stroke _stroke;
|
|
88
|
+
Gdiplus::Graphics* _g;
|
|
89
|
+
Gdiplus::Pen* _pen;
|
|
90
|
+
Gdiplus::SolidBrush* _brush;
|
|
91
|
+
|
|
92
|
+
float _fontSize;
|
|
93
|
+
float _sx, _sy;
|
|
94
|
+
|
|
95
|
+
public:
|
|
96
|
+
explicit Graphics2D_win32(Gdiplus::Graphics* g);
|
|
97
|
+
|
|
98
|
+
~Graphics2D_win32() override;
|
|
99
|
+
|
|
100
|
+
void setColor(color c) override;
|
|
101
|
+
color getColor() const override;
|
|
102
|
+
void setStroke(const Stroke& s) override;
|
|
103
|
+
const Stroke& getStroke() const override;
|
|
104
|
+
void setStrokeWidth(float w) override;
|
|
105
|
+
void setDash(const std::vector<float>& dash) override;
|
|
106
|
+
std::vector<float> getDash() override;
|
|
107
|
+
sptr<microtex::Font> getFont() const override;
|
|
108
|
+
void setFont(const sptr<Font>& font) override;
|
|
109
|
+
float getFontSize() const override;
|
|
110
|
+
void setFontSize(float size) override;
|
|
111
|
+
void translate(float dx, float dy) override;
|
|
112
|
+
void scale(float sx, float sy) override;
|
|
113
|
+
void rotate(float angle) override;
|
|
114
|
+
void rotate(float angle, float px, float py) override;
|
|
115
|
+
void reset() override;
|
|
116
|
+
float sx() const override;
|
|
117
|
+
float sy() const override;
|
|
118
|
+
void drawGlyph(u16 glyph, float x, float y) override;
|
|
119
|
+
bool beginPath(i32 id) override;
|
|
120
|
+
void moveTo(float x, float y) override;
|
|
121
|
+
void lineTo(float x, float y) override;
|
|
122
|
+
void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) override;
|
|
123
|
+
void quadTo(float x1, float y1, float x2, float y2) override;
|
|
124
|
+
void closePath() override;
|
|
125
|
+
void fillPath(i32 id) override;
|
|
126
|
+
/** Draw text */
|
|
127
|
+
void drawText(const std::wstring& src, float x, float y);
|
|
128
|
+
void drawLine(float x1, float y1, float x2, float y2) override;
|
|
129
|
+
void drawRect(float x, float y, float w, float h) override;
|
|
130
|
+
void fillRect(float x, float y, float w, float h) override;
|
|
131
|
+
void drawRoundRect(float x, float y, float w, float h, float rx, float ry) override;
|
|
132
|
+
void fillRoundRect(float x, float y, float w, float h, float rx, float ry) override;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
} // namespace microtex
|
|
136
|
+
|
|
137
|
+
#endif // GRAPHIC_WIN32_H_INCLUDED
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
gdi_src = [
|
|
2
|
+
'graphic_win32.cpp'
|
|
3
|
+
]
|
|
4
|
+
|
|
5
|
+
gdi_deps = [
|
|
6
|
+
gdi_dep
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
microtex_gdi_lib = library('microtex-gdi', gdi_src,
|
|
10
|
+
link_with: [microtex_lib],
|
|
11
|
+
include_directories: inc,
|
|
12
|
+
dependencies: gdi_deps,
|
|
13
|
+
version: meson.project_version(),
|
|
14
|
+
soversion: microtex_api_version,
|
|
15
|
+
install: true
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
microtex_gdi_dep = declare_dependency(
|
|
19
|
+
link_with: [microtex_lib, microtex_gdi_lib],
|
|
20
|
+
include_directories: ['.', inc],
|
|
21
|
+
version: meson.project_version()
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if get_option('TARGET_DEVEL')
|
|
25
|
+
pkgconfig.generate(microtex_gdi_lib,
|
|
26
|
+
libraries: microtex_lib,
|
|
27
|
+
version: meson.project_version(),
|
|
28
|
+
name: 'microtex-gdi',
|
|
29
|
+
filebase: 'microtex-gdi',
|
|
30
|
+
subdirs: ['microtex/platform/gdi_win'],
|
|
31
|
+
description: 'win32 backend to microtex'
|
|
32
|
+
)
|
|
33
|
+
endif
|
|
34
|
+
|
|
35
|
+
if install_headerfiles
|
|
36
|
+
install_headers([
|
|
37
|
+
'graphic_win32.h'
|
|
38
|
+
], subdir: 'microtex/platform/gdi_win')
|
|
39
|
+
endif
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
message(STATUS "Building µTex GTK Widget")
|
|
2
|
+
|
|
3
|
+
add_library(microtex-gtk SHARED microtexequation.cpp)
|
|
4
|
+
|
|
5
|
+
set_target_properties(
|
|
6
|
+
microtex-gtk PROPERTIES
|
|
7
|
+
VERSION ${PROJECT_VERSION}
|
|
8
|
+
SOVERSION ${MICROTEX_API_VERSION}
|
|
9
|
+
CXX_VISIBILITY_PRESET hidden
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
find_package(PkgConfig REQUIRED)
|
|
13
|
+
pkg_check_modules(Glib REQUIRED IMPORTED_TARGET glib-2.0)
|
|
14
|
+
pkg_check_modules(Gtk REQUIRED IMPORTED_TARGET gtk4)
|
|
15
|
+
pkg_check_modules(Cairo REQUIRED IMPORTED_TARGET cairo)
|
|
16
|
+
pkg_check_modules(CairoSvg REQUIRED IMPORTED_TARGET cairo-svg)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
target_include_directories(
|
|
20
|
+
microtex-gtk PUBLIC
|
|
21
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
22
|
+
$<INSTALL_INTERFACE:include/microtex-gtk>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
target_link_libraries(
|
|
26
|
+
microtex-gtk PRIVATE
|
|
27
|
+
microtex-cairo PRIVATE
|
|
28
|
+
microtex
|
|
29
|
+
PkgConfig::Glib
|
|
30
|
+
PkgConfig::Gtk
|
|
31
|
+
PkgConfig::Cairo
|
|
32
|
+
PkgConfig::CairoSvg
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
microtex_install_target(microtex-gtk)
|
|
36
|
+
microtex_install_headers(microtex-gtk HEADERS microtexequation.h)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
gnome = import('gnome')
|
|
2
|
+
|
|
3
|
+
gtk_src = [
|
|
4
|
+
'microtexequation.cpp'
|
|
5
|
+
]
|
|
6
|
+
gtk_headers = [
|
|
7
|
+
'microtexequation.h'
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
gtk_deps = [
|
|
11
|
+
dependency('glib-2.0'),
|
|
12
|
+
dependency('gtk4'),
|
|
13
|
+
dependency('cairo'),
|
|
14
|
+
dependency('cairo-svg'),
|
|
15
|
+
microtex_cairo_dep
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
microtex_gtk_lib = library('microtex-gtk', gtk_src,
|
|
19
|
+
link_with: microtex_lib,
|
|
20
|
+
include_directories: inc,
|
|
21
|
+
dependencies: gtk_deps,
|
|
22
|
+
version: meson.project_version(),
|
|
23
|
+
soversion: microtex_api_version,
|
|
24
|
+
install: true
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
microtex_gtk_dep = declare_dependency(
|
|
28
|
+
link_with: [microtex_lib, microtex_gtk_lib],
|
|
29
|
+
include_directories: ['.', inc],
|
|
30
|
+
dependencies: [
|
|
31
|
+
dependency('glib-2.0'),
|
|
32
|
+
dependency('gtk4'),
|
|
33
|
+
],
|
|
34
|
+
version: meson.project_version()
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
if get_option('TARGET_DEVEL')
|
|
38
|
+
pkgconfig.generate(microtex_gtk_lib,
|
|
39
|
+
libraries: microtex_lib,
|
|
40
|
+
version: meson.project_version(),
|
|
41
|
+
name: 'microtex-gtk',
|
|
42
|
+
filebase: 'microtex-gtk',
|
|
43
|
+
subdirs: ['microtex/platform/gtk'],
|
|
44
|
+
description: 'gtk widget rendering microtex equation'
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
gtk_gir = gnome.generate_gir(microtex_gtk_lib,
|
|
48
|
+
sources: gtk_src + gtk_headers,
|
|
49
|
+
namespace: 'MicroTex',
|
|
50
|
+
nsversion: '1',
|
|
51
|
+
symbol_prefix: 'microtex',
|
|
52
|
+
export_packages: ['microtex-gtk'],
|
|
53
|
+
dependencies: [
|
|
54
|
+
dependency('glib-2.0'),
|
|
55
|
+
dependency('gtk4')
|
|
56
|
+
],
|
|
57
|
+
includes: ['GLib-2.0', 'GObject-2.0', 'Gtk-4.0'],
|
|
58
|
+
header: 'microtexequation.h',
|
|
59
|
+
install: true
|
|
60
|
+
)
|
|
61
|
+
endif
|
|
62
|
+
|
|
63
|
+
if install_headerfiles
|
|
64
|
+
install_headers(gtk_headers, subdir: 'microtex/platform/gtk')
|
|
65
|
+
endif
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include(CMakeFindDependencyMacro)
|
|
2
|
+
|
|
3
|
+
find_dependency(microtex-cairo REQUIRED)
|
|
4
|
+
find_dependency(microtex REQUIRED)
|
|
5
|
+
# FIXME is these really needed?
|
|
6
|
+
find_dependency(PkgConfig REQUIRED)
|
|
7
|
+
pkg_check_modules(Glib REQUIRED IMPORTED_TARGET glib-2.0)
|
|
8
|
+
pkg_check_modules(Gtk REQUIRED IMPORTED_TARGET gtk4)
|
|
9
|
+
pkg_check_modules(Cairo REQUIRED IMPORTED_TARGET cairo)
|
|
10
|
+
|
|
11
|
+
include("${CMAKE_CURRENT_LIST_DIR}/microtex-gtkTargets.cmake")
|