@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,140 @@
|
|
|
1
|
+
#include <cstdio>
|
|
2
|
+
|
|
3
|
+
#include "otf/clm.h"
|
|
4
|
+
#include "otf/otf.h"
|
|
5
|
+
|
|
6
|
+
microtex::i32 find_liga(const microtex::Otf* font, const char* txt) {
|
|
7
|
+
auto p = font->ligatures();
|
|
8
|
+
while (p != nullptr && *txt != '\0') {
|
|
9
|
+
auto id = font->glyphId(*txt);
|
|
10
|
+
p = (*p)[id];
|
|
11
|
+
txt++;
|
|
12
|
+
}
|
|
13
|
+
return p == nullptr ? -1 : p->value();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
void show_metrics(const microtex::Glyph* glyph) {
|
|
17
|
+
printf(
|
|
18
|
+
"metrics: [%d, %d, %d]\n",
|
|
19
|
+
glyph->metrics().width(),
|
|
20
|
+
glyph->metrics().height(),
|
|
21
|
+
glyph->metrics().depth()
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
void show_glyph_assembly(const microtex::GlyphAssembly& assembly, const char* dir) {
|
|
26
|
+
printf("%s glyph assembly: italics correction: %d\n", dir, assembly.italicsCorrection());
|
|
27
|
+
printf(
|
|
28
|
+
"glyph | extender | start length | end length | full advance\n"
|
|
29
|
+
"-----------------------------------------------------------\n" //
|
|
30
|
+
);
|
|
31
|
+
for (microtex::u16 i = 0; i < assembly.partCount(); i++) {
|
|
32
|
+
const microtex::GlyphPart& part = assembly[i];
|
|
33
|
+
printf(
|
|
34
|
+
"%5u | %8d | %12u | %10u | %12u\n",
|
|
35
|
+
part.glyph(),
|
|
36
|
+
part.isExtender(),
|
|
37
|
+
part.startConnectorLength(),
|
|
38
|
+
part.endConnectorLength(),
|
|
39
|
+
part.fullAdvance() //
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
void show_math_kern(const microtex::MathKern& kern) {
|
|
45
|
+
if (kern.count() == 0) printf("absent");
|
|
46
|
+
for (microtex::u16 i = 0; i < kern.count(); i++) {
|
|
47
|
+
printf("(%d, %d), ", kern.correctionHeight(i), kern.value(i));
|
|
48
|
+
}
|
|
49
|
+
printf("\n");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void show_math_kerns(const microtex::Math& math) {
|
|
53
|
+
printf("math kern record:\n");
|
|
54
|
+
const microtex::MathKernRecord& record = math.kernRecord();
|
|
55
|
+
printf(" top left: ");
|
|
56
|
+
show_math_kern(record.topLeft());
|
|
57
|
+
printf(" top right: ");
|
|
58
|
+
show_math_kern(record.topRight());
|
|
59
|
+
printf(" bottom left: ");
|
|
60
|
+
show_math_kern(record.bottomLeft());
|
|
61
|
+
printf("bottom right: ");
|
|
62
|
+
show_math_kern(record.bottomRight());
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void show_math(microtex::Otf* font, const microtex::Glyph* glyph) {
|
|
66
|
+
const microtex::Math& math = glyph->math();
|
|
67
|
+
const microtex::Variants& hv = math.horizontalVariants();
|
|
68
|
+
printf("horizontal variants: ");
|
|
69
|
+
for (microtex::u16 i = 0; i < hv.count(); i++) {
|
|
70
|
+
printf("%u, ", hv[i]);
|
|
71
|
+
}
|
|
72
|
+
printf("\n");
|
|
73
|
+
const microtex::Variants& vv = math.verticalVariants();
|
|
74
|
+
printf("vertical variants: ");
|
|
75
|
+
for (microtex::u16 i = 0; i < vv.count(); i++) {
|
|
76
|
+
printf("%u, ", vv[i]);
|
|
77
|
+
}
|
|
78
|
+
printf("\n");
|
|
79
|
+
show_glyph_assembly(math.horizontalAssembly(), "horizontal");
|
|
80
|
+
show_glyph_assembly(math.verticalAssembly(), "vertical");
|
|
81
|
+
show_math_kerns(math);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
int main(int argc, char* argv[]) {
|
|
85
|
+
if (argc < 2) {
|
|
86
|
+
printf("No clm file specified\n");
|
|
87
|
+
exit(1);
|
|
88
|
+
}
|
|
89
|
+
microtex::Otf* font = microtex::Otf::fromFile(argv[1]);
|
|
90
|
+
printf("font from %s\n", argv[1]);
|
|
91
|
+
printf(
|
|
92
|
+
"unicodes count: %u, glyphs count: %u\n"
|
|
93
|
+
"is math font: %d, em: %u, x-height: %u\n"
|
|
94
|
+
"ascent: %d, descent:%d\n",
|
|
95
|
+
font->unicodesCount(),
|
|
96
|
+
font->glyphsCount(),
|
|
97
|
+
font->isMathFont(),
|
|
98
|
+
font->em(),
|
|
99
|
+
font->xHeight(),
|
|
100
|
+
font->ascent(),
|
|
101
|
+
font->descent()
|
|
102
|
+
);
|
|
103
|
+
printf("\n");
|
|
104
|
+
|
|
105
|
+
const microtex::Glyph* glyph_f = font->glyphOfUnicode('f');
|
|
106
|
+
printf("glyph info for 'f':\n");
|
|
107
|
+
printf("glyph id: %d, \n", font->glyphId('f'));
|
|
108
|
+
show_metrics(glyph_f);
|
|
109
|
+
printf("kerning of [f, a]: %d\n", glyph_f->kernRecord()[font->glyphId('a')]);
|
|
110
|
+
// glyph id of 2378 is the a.sc in XITS-Regular font
|
|
111
|
+
printf("class kerning of [V, a.sc]: %d\n", font->classKerning(font->glyphId('V'), 2378));
|
|
112
|
+
printf("ligatures:\n");
|
|
113
|
+
printf(
|
|
114
|
+
" fj | fa | ffj | ffjk\n"
|
|
115
|
+
"--------------------------\n"
|
|
116
|
+
"%5d |%5d |%5d |%5d\n",
|
|
117
|
+
find_liga(font, "fj"),
|
|
118
|
+
find_liga(font, "fa"),
|
|
119
|
+
find_liga(font, "ffj"),
|
|
120
|
+
find_liga(font, "ffjk") //
|
|
121
|
+
);
|
|
122
|
+
printf("\n");
|
|
123
|
+
|
|
124
|
+
const microtex::Glyph* brace_left = font->glyphOfUnicode('{');
|
|
125
|
+
printf("glyph info for '{':\n");
|
|
126
|
+
printf("glyph id: %d\n", font->glyphId('{'));
|
|
127
|
+
show_metrics(brace_left);
|
|
128
|
+
show_math(font, brace_left);
|
|
129
|
+
printf("\n");
|
|
130
|
+
|
|
131
|
+
const microtex::Glyph* Tau = font->glyphOfUnicode(0x0393);
|
|
132
|
+
printf("glyph info for 'Tau':\n");
|
|
133
|
+
printf("glyph id: %d\n", font->glyphId(0x0393));
|
|
134
|
+
show_metrics(Tau);
|
|
135
|
+
show_math(font, Tau);
|
|
136
|
+
printf("\n");
|
|
137
|
+
|
|
138
|
+
delete font;
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#include <cstdio>
|
|
2
|
+
#include <string>
|
|
3
|
+
|
|
4
|
+
#include "env/env.h"
|
|
5
|
+
#include "env/units.h"
|
|
6
|
+
#include "utils/utils.h"
|
|
7
|
+
|
|
8
|
+
using namespace std;
|
|
9
|
+
using namespace microtex;
|
|
10
|
+
|
|
11
|
+
void show_char(c32 code, const Env& env, bool isMathMode = true) {
|
|
12
|
+
const auto&& chr = env.getChar(code, isMathMode);
|
|
13
|
+
std::u32string str;
|
|
14
|
+
str.append(1, chr.mappedCode);
|
|
15
|
+
printf(
|
|
16
|
+
"font style: %hx: "
|
|
17
|
+
"{ code: %X, map: %X, font: %d, glyph: %d, scale: %f }\n",
|
|
18
|
+
static_cast<u16>(env.mathFontStyle()),
|
|
19
|
+
chr.code,
|
|
20
|
+
chr.mappedCode,
|
|
21
|
+
chr.fontId,
|
|
22
|
+
chr.glyphId,
|
|
23
|
+
chr.scale
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
int main(int argc, char* argv[]) {
|
|
28
|
+
if (argc < 3) {
|
|
29
|
+
fprintf(
|
|
30
|
+
stderr,
|
|
31
|
+
"Usage:\n"
|
|
32
|
+
" <clm file path>\n"
|
|
33
|
+
" <font file path>\n"
|
|
34
|
+
);
|
|
35
|
+
exit(1);
|
|
36
|
+
}
|
|
37
|
+
// load math font to context
|
|
38
|
+
FontSrcFile src{string(argv[1]), string(argv[2])};
|
|
39
|
+
FontContext::addFont(src);
|
|
40
|
+
// create a font context and env
|
|
41
|
+
auto fc = sptrOf<FontContext>();
|
|
42
|
+
fc->selectMathFont(argv[1]);
|
|
43
|
+
Env env(TexStyle::display, fc, 20.f);
|
|
44
|
+
// test unit conversions
|
|
45
|
+
printf("varies length in font design unit of 20 point-size:\n");
|
|
46
|
+
printf(
|
|
47
|
+
"1em = %f\n"
|
|
48
|
+
"1ex = %f\n"
|
|
49
|
+
"1px = %f\n"
|
|
50
|
+
"1bp = %f\n"
|
|
51
|
+
"1pc = %f\n"
|
|
52
|
+
"1mu = %f\n"
|
|
53
|
+
"1cm = %f\n"
|
|
54
|
+
"1mm = %f\n"
|
|
55
|
+
"1in = %f\n"
|
|
56
|
+
"1sp = %f\n"
|
|
57
|
+
"1pt = %f\n"
|
|
58
|
+
"1dd = %f\n"
|
|
59
|
+
"1cc = %f\n",
|
|
60
|
+
Units::fsize(UnitType::em, 1.f, env),
|
|
61
|
+
Units::fsize(UnitType::ex, 1.f, env),
|
|
62
|
+
Units::fsize(UnitType::pixel, 1.f, env),
|
|
63
|
+
Units::fsize(UnitType::point, 1.f, env),
|
|
64
|
+
Units::fsize(UnitType::pica, 1.f, env),
|
|
65
|
+
Units::fsize(UnitType::mu, 1.f, env),
|
|
66
|
+
Units::fsize(UnitType::cm, 1.f, env),
|
|
67
|
+
Units::fsize(UnitType::mm, 1.f, env),
|
|
68
|
+
Units::fsize(UnitType::in, 1.f, env),
|
|
69
|
+
Units::fsize(UnitType::sp, 1.f, env),
|
|
70
|
+
Units::fsize(UnitType::pt, 1.f, env),
|
|
71
|
+
Units::fsize(UnitType::dd, 1.f, env),
|
|
72
|
+
Units::fsize(UnitType::cc, 1.f, env)
|
|
73
|
+
);
|
|
74
|
+
printf("\n");
|
|
75
|
+
|
|
76
|
+
env.setStyle(TexStyle::scriptScript);
|
|
77
|
+
printf("varies char with TexStyle::scriptScript in 20 point size:\n");
|
|
78
|
+
show_char('a', env);
|
|
79
|
+
show_char('h', env);
|
|
80
|
+
show_char('z', env);
|
|
81
|
+
show_char('{', env);
|
|
82
|
+
show_char(0x1d53a, env);
|
|
83
|
+
printf("\n");
|
|
84
|
+
|
|
85
|
+
env.addMathFontStyle(FontStyle::rm);
|
|
86
|
+
env.addMathFontStyle(FontStyle::bf);
|
|
87
|
+
env.addMathFontStyle(FontStyle::it);
|
|
88
|
+
env.addMathFontStyle(FontStyle::cal);
|
|
89
|
+
env.addMathFontStyle(FontStyle::frak);
|
|
90
|
+
env.addMathFontStyle(FontStyle::bb);
|
|
91
|
+
env.addMathFontStyle(FontStyle::sf);
|
|
92
|
+
env.addMathFontStyle(FontStyle::tt);
|
|
93
|
+
printf("varies char with TexStyle::scriptScript and full FontStyle in 20 point size:\n");
|
|
94
|
+
show_char('a', env);
|
|
95
|
+
show_char('h', env);
|
|
96
|
+
show_char('z', env);
|
|
97
|
+
show_char('{', env);
|
|
98
|
+
printf("\n");
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[binaries]
|
|
2
|
+
c = 'afl-cc'
|
|
3
|
+
cpp = 'afl-c++'
|
|
4
|
+
pkg-config = 'pkg-config'
|
|
5
|
+
|
|
6
|
+
[properties]
|
|
7
|
+
is_fuzzer = true
|
|
8
|
+
|
|
9
|
+
[project options]
|
|
10
|
+
CAIRO = false
|
|
11
|
+
EXAMPLE_GTKMM = false
|
|
12
|
+
|
|
13
|
+
GTK = false
|
|
14
|
+
EXAMPLE_GTK = false
|
|
15
|
+
|
|
16
|
+
QT = false
|
|
17
|
+
EXAMPLE_QT = false
|
|
18
|
+
|
|
19
|
+
GDI = 'disabled'
|
|
20
|
+
EXAMPLE_WIN32 = false
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# vim: set noet ts=2 sw=2:
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
project_root="../../"
|
|
6
|
+
build_root="./_fuzzi"
|
|
7
|
+
|
|
8
|
+
seeds_dir="./seeds/"
|
|
9
|
+
fuzz_out="./output/"
|
|
10
|
+
|
|
11
|
+
function print_help {
|
|
12
|
+
echo "Usage: fuzz.sh [--project-root <root>] [--build-root <intrumented build root>] [--seeds-dir <dir>] [--fuzzer-output-dir <dir>] <setup | [--no-cpu-check]>"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
while getopts ":h:p:b:s:o:-:" opt; do
|
|
16
|
+
case $opt in
|
|
17
|
+
h)
|
|
18
|
+
print_help
|
|
19
|
+
exit 0
|
|
20
|
+
;;
|
|
21
|
+
p)
|
|
22
|
+
project_root="$OPTARG"
|
|
23
|
+
;;
|
|
24
|
+
b)
|
|
25
|
+
build_root="$OPTARG"
|
|
26
|
+
;;
|
|
27
|
+
s)
|
|
28
|
+
seeds_dir="$OPTARG"
|
|
29
|
+
;;
|
|
30
|
+
o)
|
|
31
|
+
fuzz_out="$OPTARG"
|
|
32
|
+
;;
|
|
33
|
+
-)
|
|
34
|
+
case "${OPTARG}" in
|
|
35
|
+
help)
|
|
36
|
+
print_help
|
|
37
|
+
exit 0
|
|
38
|
+
;;
|
|
39
|
+
project-root)
|
|
40
|
+
project_root="${!OPTIND}"
|
|
41
|
+
OPTIND=$((OPTIND + 1))
|
|
42
|
+
;;
|
|
43
|
+
build-root)
|
|
44
|
+
build_root="${!OPTIND}"
|
|
45
|
+
OPTIND=$((OPTIND + 1))
|
|
46
|
+
;;
|
|
47
|
+
seeds-dir)
|
|
48
|
+
seeds_dir="${!OPTIND}"
|
|
49
|
+
OPTIND=$((OPTIND + 1))
|
|
50
|
+
;;
|
|
51
|
+
fuzzer-output-dir)
|
|
52
|
+
fuzz_out="${!OPTIND}"
|
|
53
|
+
OPTIND=$((OPTIND + 1))
|
|
54
|
+
;;
|
|
55
|
+
no-cpu-check)
|
|
56
|
+
export AFL_SKIP_CPUFREQ=1
|
|
57
|
+
;;
|
|
58
|
+
*)
|
|
59
|
+
echo "Invalid option: --${OPTARG}" >&2
|
|
60
|
+
exit 1
|
|
61
|
+
;;
|
|
62
|
+
esac
|
|
63
|
+
;;
|
|
64
|
+
\?)
|
|
65
|
+
echo "Invalid option: -$OPTARG" >&2
|
|
66
|
+
exit 1
|
|
67
|
+
;;
|
|
68
|
+
esac
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
shift $((OPTIND - 1))
|
|
72
|
+
|
|
73
|
+
dir="$project_root/test/fuzzer/"
|
|
74
|
+
|
|
75
|
+
case $1 in
|
|
76
|
+
setup)
|
|
77
|
+
echo "Running setup..."
|
|
78
|
+
if [ -d "$build_root" ]; then
|
|
79
|
+
echo "Build root \"$build_root\" already exists. Delete?"
|
|
80
|
+
# Credit to Tiago Lopo and John Kugelman on SO (https://stackoverflow.com/a/29436423)
|
|
81
|
+
# Licensed under CC-BY-SA-3.0
|
|
82
|
+
while true; do
|
|
83
|
+
read -p " [y/N]:" inp
|
|
84
|
+
case "$inp" in
|
|
85
|
+
[Yy*])
|
|
86
|
+
rm -rf -- "$build_root"
|
|
87
|
+
break
|
|
88
|
+
;;
|
|
89
|
+
*)
|
|
90
|
+
echo "Aborting setup. Have a great day!"
|
|
91
|
+
exit 1
|
|
92
|
+
;;
|
|
93
|
+
esac
|
|
94
|
+
done
|
|
95
|
+
fi
|
|
96
|
+
meson setup "$build_root" "$project_root" --native-file "$dir/afl.native"
|
|
97
|
+
mkdir -p "$seeds_dir" "$fuzz_out"
|
|
98
|
+
"$dir/generateSeed.java" "$project_root/res/SAMPLES.tex" "$seeds_dir"
|
|
99
|
+
exit 0
|
|
100
|
+
;;
|
|
101
|
+
min)
|
|
102
|
+
echo "Minimizing all crashes..."
|
|
103
|
+
CRASHDIR="$fuzz_out/default/crashes/"
|
|
104
|
+
if [ ! -d "$CRASHDIR" ]; then
|
|
105
|
+
echo "Did not found crash directory at expected location: $CRASHDIR, please run the fuzzer first."
|
|
106
|
+
exit 1
|
|
107
|
+
fi
|
|
108
|
+
MINOUT="$fuzz_out/default/crashes-min/"
|
|
109
|
+
mkdir -p "$MINOUT"
|
|
110
|
+
for crash in "$CRASHDIR"/id*; do
|
|
111
|
+
MICROTEX_FONTDIR="$project_root/res/lm-math/" afl-tmin -i "$crash" -o "$MINOUT"/`basename "$crash"` -- "$build_root/test/fuzzer/microtex-fuzzme"
|
|
112
|
+
done
|
|
113
|
+
exit 0
|
|
114
|
+
;;
|
|
115
|
+
dbg)
|
|
116
|
+
if [ -z "$2" ]; then
|
|
117
|
+
echo "You need to specify the specific crash. ./fuzz.sh [options] dbg <path/to/crashfile>"
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
ninja -C "$build_root"
|
|
121
|
+
MICROTEX_FONTDIR="$project_root/res/lm-math/" gdb "$build_root/test/fuzzer/microtex-fuzzme" -ex "run <'$2'"
|
|
122
|
+
exit 0
|
|
123
|
+
;;
|
|
124
|
+
"")
|
|
125
|
+
;;
|
|
126
|
+
*)
|
|
127
|
+
echo "Invalid argument: $1."
|
|
128
|
+
print_help
|
|
129
|
+
exit 1
|
|
130
|
+
;;
|
|
131
|
+
esac
|
|
132
|
+
|
|
133
|
+
ninja -C "$build_root"
|
|
134
|
+
mkdir -p "$fuzz_out"
|
|
135
|
+
MICROTEX_FONTDIR="$project_root/res/lm-math/" afl-fuzz -i "$seeds_dir" -o "$fuzz_out" -x "$dir/microtex.dict" -- "$build_root/test/fuzzer/microtex-fuzzme"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#include "platform_none.cpp"
|
|
2
|
+
|
|
3
|
+
#include <stdio.h>
|
|
4
|
+
#include <unistd.h>
|
|
5
|
+
|
|
6
|
+
#include <microtex.h>
|
|
7
|
+
#include <utils/exceptions.h>
|
|
8
|
+
|
|
9
|
+
#define FONT_SIZE 18.f
|
|
10
|
+
|
|
11
|
+
#ifndef __AFL_FUZZ_TESTCASE_LEN
|
|
12
|
+
ssize_t fuzz_len;
|
|
13
|
+
#define __AFL_FUZZ_TESTCASE_LEN fuzz_len
|
|
14
|
+
unsigned char fuzz_buf[1024000];
|
|
15
|
+
#define __AFL_FUZZ_TESTCASE_BUF fuzz_buf
|
|
16
|
+
#define __AFL_FUZZ_INIT() void sync(void);
|
|
17
|
+
#define __AFL_LOOP(x) ((fuzz_len = read(0, fuzz_buf, sizeof(fuzz_buf))) > 0 ? 1 : 0)
|
|
18
|
+
#define __AFL_INIT() sync()
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
__AFL_FUZZ_INIT();
|
|
22
|
+
int main(void) {
|
|
23
|
+
microtex::Init init = microtex::InitFontSenseAuto{};
|
|
24
|
+
microtex::MicroTeX::init(init);
|
|
25
|
+
|
|
26
|
+
microtex::PlatformFactory::registerFactory(
|
|
27
|
+
"none",
|
|
28
|
+
std::make_unique<microtex::PlatformFactory_none>()
|
|
29
|
+
);
|
|
30
|
+
microtex::PlatformFactory::activate("none");
|
|
31
|
+
|
|
32
|
+
#ifdef __AFL_HAVE_MANUAL_CONTROL
|
|
33
|
+
__AFL_INIT();
|
|
34
|
+
#endif
|
|
35
|
+
unsigned char* buf = __AFL_FUZZ_TESTCASE_BUF;
|
|
36
|
+
while (__AFL_LOOP(10000)) {
|
|
37
|
+
int len = __AFL_FUZZ_TESTCASE_LEN;
|
|
38
|
+
if (len < 2) // assume that single characters are always working
|
|
39
|
+
continue;
|
|
40
|
+
try {
|
|
41
|
+
microtex::Render* render = microtex::MicroTeX::parse(
|
|
42
|
+
std::string((char*)buf, len),
|
|
43
|
+
0,
|
|
44
|
+
FONT_SIZE,
|
|
45
|
+
FONT_SIZE / 3.f,
|
|
46
|
+
0xff000000
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
microtex::Graphics2D_none g2;
|
|
50
|
+
render->draw(g2, 0, 0);
|
|
51
|
+
|
|
52
|
+
delete render;
|
|
53
|
+
} catch (microtex::ex_parse& e) {
|
|
54
|
+
fprintf(stderr, "MicroTeX parsing error: %s\n", e.what());
|
|
55
|
+
} catch (microtex::ex_invalid_state& e) {
|
|
56
|
+
fprintf(stderr, "MicroTeX rendering error: %s\n", e.what());
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
microtex::MicroTeX::release();
|
|
61
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//usr/bin/env java "$0" "$@"; exit $?
|
|
2
|
+
|
|
3
|
+
import java.nio.file.Files;
|
|
4
|
+
import java.nio.file.Path;
|
|
5
|
+
import java.util.Arrays;
|
|
6
|
+
import java.util.stream.Collectors;
|
|
7
|
+
|
|
8
|
+
public class generateSeed {
|
|
9
|
+
public static void main(String[] args) throws java.io.IOException {
|
|
10
|
+
if (args.length < 1 || args.length > 2) {
|
|
11
|
+
System.err.println("Usage: generateSeed.java <path/to/SAMPLES.tex> [seeds_output_dir]");
|
|
12
|
+
System.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Arrays.stream(
|
|
16
|
+
Files.readString(Path.of(args[0]))
|
|
17
|
+
.split("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n")
|
|
18
|
+
).collect(
|
|
19
|
+
Collectors.toMap(
|
|
20
|
+
s -> s.lines().findFirst().get().replaceFirst("%", ""),
|
|
21
|
+
s -> s
|
|
22
|
+
)
|
|
23
|
+
).forEach(
|
|
24
|
+
(k,v) -> {
|
|
25
|
+
try {
|
|
26
|
+
Files.writeString(Path.of(args.length == 2 ? args[1] : "seeds", k + ".tex"), v);
|
|
27
|
+
} catch (java.io.IOException e) {
|
|
28
|
+
throw new RuntimeException(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|