@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,53 @@
|
|
|
1
|
+
#include "otf/glyph.h"
|
|
2
|
+
|
|
3
|
+
namespace microtex {
|
|
4
|
+
|
|
5
|
+
const KernRecord KernRecord::empty(0);
|
|
6
|
+
|
|
7
|
+
const Variants Variants::empty(0);
|
|
8
|
+
|
|
9
|
+
const GlyphAssembly GlyphAssembly::empty(0);
|
|
10
|
+
|
|
11
|
+
const MathKern MathKern::empty(0);
|
|
12
|
+
|
|
13
|
+
const MathKernRecord MathKernRecord::empty(0);
|
|
14
|
+
|
|
15
|
+
const Math Math::empty(0);
|
|
16
|
+
|
|
17
|
+
i16 KernRecord::operator[](u16 glyph) const {
|
|
18
|
+
const int i = binIndexOf(_count, [&](int i) { return glyph - _fields[i << 1]; });
|
|
19
|
+
return i < 0 ? 0 : (i16)_fields[(i << 1) + 1];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
u16 MathKern::indexOf(i32 height) const {
|
|
23
|
+
if (_count == 0) return 0;
|
|
24
|
+
return binIndexOf(
|
|
25
|
+
_count,
|
|
26
|
+
[&](int i) { return height - _fields[(i << 1) + 1]; },
|
|
27
|
+
true
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
MathKernRecord::~MathKernRecord() {
|
|
32
|
+
for (auto& _field : _fields) {
|
|
33
|
+
if (_field != &MathKern::empty) delete _field;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Math::~Math() {
|
|
38
|
+
if (_horizontalVariants != &Variants::empty) delete _horizontalVariants;
|
|
39
|
+
if (_verticalVariants != &Variants::empty) delete _verticalVariants;
|
|
40
|
+
if (_horizontalAssembly != &GlyphAssembly::empty) delete _horizontalAssembly;
|
|
41
|
+
if (_verticalAssembly != &GlyphAssembly::empty) delete _verticalAssembly;
|
|
42
|
+
if (_kernRecord != &MathKernRecord::empty) delete _kernRecord;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Glyph::~Glyph() {
|
|
46
|
+
if (_kernRecord != &KernRecord::empty) delete _kernRecord;
|
|
47
|
+
if (_math != &Math::empty) delete _math;
|
|
48
|
+
#ifdef HAVE_GLYPH_RENDER_PATH
|
|
49
|
+
if (_path != &Path::empty) delete _path;
|
|
50
|
+
#endif
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
} // namespace microtex
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
#ifndef MICROTEX_GLYPH_H
|
|
2
|
+
#define MICROTEX_GLYPH_H
|
|
3
|
+
|
|
4
|
+
#include "otf/path.h"
|
|
5
|
+
#include "utils/dict_tree.h"
|
|
6
|
+
#include "utils/utils.h"
|
|
7
|
+
|
|
8
|
+
namespace microtex {
|
|
9
|
+
|
|
10
|
+
class CLMReader;
|
|
11
|
+
|
|
12
|
+
class Glyph;
|
|
13
|
+
|
|
14
|
+
/** Represents metrics for one glyph. */
|
|
15
|
+
struct Metrics final {
|
|
16
|
+
private:
|
|
17
|
+
i16 _width{}, _height{}, _depth{};
|
|
18
|
+
|
|
19
|
+
Metrics() = default;
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
no_copy_assign(Metrics);
|
|
23
|
+
|
|
24
|
+
/** Glyph width */
|
|
25
|
+
inline i16 width() const { return _width; }
|
|
26
|
+
|
|
27
|
+
/** Distance above baseline (positive) */
|
|
28
|
+
inline i16 height() const { return _height; }
|
|
29
|
+
|
|
30
|
+
/** Distance below baseline (positive) */
|
|
31
|
+
inline i16 depth() const { return _depth; }
|
|
32
|
+
|
|
33
|
+
friend CLMReader;
|
|
34
|
+
friend Glyph;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Represents standard kerning info for one glyph. */
|
|
38
|
+
struct KernRecord final {
|
|
39
|
+
private:
|
|
40
|
+
u16 _count;
|
|
41
|
+
u16* _fields;
|
|
42
|
+
|
|
43
|
+
explicit KernRecord(u16 count) noexcept
|
|
44
|
+
: _count(count), _fields(_count == 0 ? nullptr : new u16[count * 2]) {}
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
no_copy_assign(KernRecord);
|
|
48
|
+
|
|
49
|
+
static const KernRecord empty;
|
|
50
|
+
|
|
51
|
+
inline u16 count() const { return _count; }
|
|
52
|
+
|
|
53
|
+
/** Get the kerning value should be added to the given glyph, return 0 if no kerning. */
|
|
54
|
+
i16 operator[](u16 glyph) const;
|
|
55
|
+
|
|
56
|
+
~KernRecord() { delete[] _fields; }
|
|
57
|
+
|
|
58
|
+
friend CLMReader;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** Defines variant for one glyph */
|
|
62
|
+
struct Variants final {
|
|
63
|
+
private:
|
|
64
|
+
u16 _count = 0;
|
|
65
|
+
/** Array of glyph id in font to represents variant */
|
|
66
|
+
u16* _glyphs = nullptr;
|
|
67
|
+
|
|
68
|
+
explicit Variants(u16 count) noexcept
|
|
69
|
+
: _count(count), _glyphs(count == 0 ? nullptr : new u16[count]) {}
|
|
70
|
+
|
|
71
|
+
public:
|
|
72
|
+
no_copy_assign(Variants);
|
|
73
|
+
|
|
74
|
+
/** To represents an empty Variants that the number of its glyphs is 0 */
|
|
75
|
+
static const Variants empty;
|
|
76
|
+
|
|
77
|
+
/** Glyph count for this variant */
|
|
78
|
+
inline u16 count() const { return _count; }
|
|
79
|
+
|
|
80
|
+
/** Test if the variant is empty */
|
|
81
|
+
inline bool isEmpty() const { return _count == 0; }
|
|
82
|
+
|
|
83
|
+
/** Get glyph id at index i */
|
|
84
|
+
inline u16 operator[](u32 i) const { return _glyphs[i]; }
|
|
85
|
+
|
|
86
|
+
~Variants() { delete[] _glyphs; }
|
|
87
|
+
|
|
88
|
+
friend CLMReader;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
struct GlyphAssembly;
|
|
92
|
+
|
|
93
|
+
/** Defines glyph part to assemble large glyph */
|
|
94
|
+
struct GlyphPart final {
|
|
95
|
+
private:
|
|
96
|
+
u16 _glyph = 0;
|
|
97
|
+
u16 _startConnectorLength = 0;
|
|
98
|
+
u16 _endConnectorLength = 0;
|
|
99
|
+
u16 _fullAdvance = 0;
|
|
100
|
+
/**
|
|
101
|
+
* Part qualifiers. PartFlags enumeration currently uses only one bit:
|
|
102
|
+
*
|
|
103
|
+
* - 0x0001 EXTENDER_FLAG: If set, the part can be skipped or repeated.
|
|
104
|
+
* - 0xFFFE Reserved.
|
|
105
|
+
*/
|
|
106
|
+
u16 _flags = 0;
|
|
107
|
+
|
|
108
|
+
GlyphPart() = default;
|
|
109
|
+
|
|
110
|
+
public:
|
|
111
|
+
no_copy_assign(GlyphPart);
|
|
112
|
+
|
|
113
|
+
/** Glyph id for this part. */
|
|
114
|
+
inline u16 glyph() const { return _glyph; }
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Advance width/ height, in design units, of the straight bar connector material at the start
|
|
118
|
+
* of the glyph in the direction of the extension (the left end for horizontal extension,
|
|
119
|
+
* the bottom end for vertical extension).
|
|
120
|
+
*/
|
|
121
|
+
inline u16 startConnectorLength() const { return _startConnectorLength; }
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Advance width/ height, in design units, of the straight bar connector material at the end of
|
|
125
|
+
* the glyph in the direction of the extension (the right end for horizontal extension, the top
|
|
126
|
+
* end for vertical extension).
|
|
127
|
+
*/
|
|
128
|
+
inline u16 endConnectorLength() const { return _endConnectorLength; }
|
|
129
|
+
|
|
130
|
+
/** Full advance width/height for this part in the direction of the extension, in design units. */
|
|
131
|
+
inline u16 fullAdvance() const { return _fullAdvance; }
|
|
132
|
+
|
|
133
|
+
/** Test if this part can be skipped or repeated. */
|
|
134
|
+
inline bool isExtender() const { return (_flags & 0x0001) == 1; }
|
|
135
|
+
|
|
136
|
+
friend GlyphAssembly;
|
|
137
|
+
friend CLMReader;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Specifies how the shape for a particular glyph can be constructed from parts found in the glyph
|
|
142
|
+
* set. This defines the italics correction of the resulting assembly, and a number of parts that
|
|
143
|
+
* have to be put together to form the required shape. Some glyph parts can be designated as
|
|
144
|
+
* extenders, which can be repeated as needed to obtain a target size.
|
|
145
|
+
*/
|
|
146
|
+
struct GlyphAssembly final {
|
|
147
|
+
private:
|
|
148
|
+
i16 _italicsCorrection = 0;
|
|
149
|
+
u16 _partCount = 0;
|
|
150
|
+
/**
|
|
151
|
+
* Array of GlyphPart, from left to right (for assemblies that extend horizontally)
|
|
152
|
+
* or bottom to top (for assemblies that extend vertically).
|
|
153
|
+
*/
|
|
154
|
+
GlyphPart* _parts = nullptr;
|
|
155
|
+
|
|
156
|
+
explicit GlyphAssembly(u16 partCount) noexcept
|
|
157
|
+
: _partCount(partCount), _parts(partCount == 0 ? nullptr : new GlyphPart[partCount]) {}
|
|
158
|
+
|
|
159
|
+
public:
|
|
160
|
+
no_copy_assign(GlyphAssembly);
|
|
161
|
+
|
|
162
|
+
/** To represents an empty GlyphAssembly that the number of its parts is 0 */
|
|
163
|
+
static const GlyphAssembly empty;
|
|
164
|
+
|
|
165
|
+
/** Italics correction of this GlyphAssembly. Should not depend on the assembly size. */
|
|
166
|
+
inline i16 italicsCorrection() const { return _italicsCorrection; }
|
|
167
|
+
|
|
168
|
+
/** Number of parts in this assembly. */
|
|
169
|
+
inline u16 partCount() const { return _partCount; }
|
|
170
|
+
|
|
171
|
+
/** Test if this assembly is empty. */
|
|
172
|
+
inline bool isEmpty() const { return _partCount == 0; }
|
|
173
|
+
|
|
174
|
+
/** Get part at index i */
|
|
175
|
+
inline const GlyphPart& operator[](u16 i) const { return _parts[i]; }
|
|
176
|
+
|
|
177
|
+
~GlyphAssembly() { delete[] _parts; }
|
|
178
|
+
|
|
179
|
+
friend CLMReader;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Provides kerning amounts for different heights in a glyph’s vertical extent. An array of kerning
|
|
184
|
+
* values is provided, each of which applies to a height range. A corresponding array of heights
|
|
185
|
+
* indicate the transition points between consecutive ranges.
|
|
186
|
+
* <p>
|
|
187
|
+
* Correction heights for each glyph are relative to the glyph baseline, with positive height values
|
|
188
|
+
* above the baseline, and negative height values below the baseline. The correctionHeights array is
|
|
189
|
+
* sorted in increasing order, from lowest to highest.
|
|
190
|
+
* <p>
|
|
191
|
+
* The kerning value corresponding to a particular height is determined by finding two consecutive
|
|
192
|
+
* entries in the correctionHeight array such that the given height is greater than or equal to the
|
|
193
|
+
* first entry and less than the second entry. The index of the second entry is used to look up a
|
|
194
|
+
* kerning value in the kernValues array. If the given height is less than the first entry in the
|
|
195
|
+
* correctionHeights array, the first kerning value (index 0) is used. For a height that is greater
|
|
196
|
+
* than or equal to the last entry in the correctionHeights array, the last entry is used.
|
|
197
|
+
*/
|
|
198
|
+
struct MathKern final {
|
|
199
|
+
private:
|
|
200
|
+
const u16 _count = 0;
|
|
201
|
+
/** in (kern, correctionHeight) pair format */
|
|
202
|
+
i16* _fields = nullptr;
|
|
203
|
+
|
|
204
|
+
explicit MathKern(u16 count) noexcept
|
|
205
|
+
: _count(count), _fields(count == 0 ? nullptr : new i16[count * 2]) {}
|
|
206
|
+
|
|
207
|
+
public:
|
|
208
|
+
no_copy_assign(MathKern);
|
|
209
|
+
|
|
210
|
+
static const MathKern empty;
|
|
211
|
+
|
|
212
|
+
inline u16 count() const { return _count; }
|
|
213
|
+
|
|
214
|
+
inline i16 correctionHeight(u16 i) const { return _count == 0 ? 0 : _fields[(i << 1) + 1]; }
|
|
215
|
+
|
|
216
|
+
inline i16 value(u16 i) const { return _count == 0 ? 0 : _fields[i << 1]; }
|
|
217
|
+
|
|
218
|
+
/** Find the index of the kern values that its correction height closest to the given height. */
|
|
219
|
+
u16 indexOf(i32 height) const;
|
|
220
|
+
|
|
221
|
+
~MathKern() { delete[] _fields; }
|
|
222
|
+
|
|
223
|
+
friend CLMReader;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Each MathKernRecord points to up to four kern info for each of the corners around the glyph.
|
|
228
|
+
* If no kern info is provided for a corner, a kerning amount of zero is assumed.
|
|
229
|
+
*/
|
|
230
|
+
struct MathKernRecord final {
|
|
231
|
+
private:
|
|
232
|
+
/** Content MUST NOT BE NULL, equals &MathKern::empty if absent */
|
|
233
|
+
const MathKern* _fields[4]{
|
|
234
|
+
&MathKern::empty,
|
|
235
|
+
&MathKern::empty,
|
|
236
|
+
&MathKern::empty,
|
|
237
|
+
&MathKern::empty,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
explicit MathKernRecord(u16 ignore) noexcept {}
|
|
241
|
+
|
|
242
|
+
public:
|
|
243
|
+
no_copy_assign(MathKernRecord);
|
|
244
|
+
|
|
245
|
+
static const MathKernRecord empty;
|
|
246
|
+
|
|
247
|
+
inline const MathKern& topLeft() const { return *_fields[0]; }
|
|
248
|
+
|
|
249
|
+
inline const MathKern& topRight() const { return *_fields[1]; }
|
|
250
|
+
|
|
251
|
+
inline const MathKern& bottomLeft() const { return *_fields[2]; }
|
|
252
|
+
|
|
253
|
+
inline const MathKern& bottomRight() const { return *_fields[3]; }
|
|
254
|
+
|
|
255
|
+
~MathKernRecord();
|
|
256
|
+
|
|
257
|
+
friend CLMReader;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Provides font data required for math layout.
|
|
262
|
+
*
|
|
263
|
+
* See [https://docs.microsoft.com/en-us/typography/opentype/spec/math]
|
|
264
|
+
*/
|
|
265
|
+
struct Math final {
|
|
266
|
+
private:
|
|
267
|
+
i16 _italicsCorrection = 0;
|
|
268
|
+
i16 _topAccentAttachment = 0;
|
|
269
|
+
/** MUST NOT BE NULL, equals to &Variants::empty if absent */
|
|
270
|
+
const Variants* _horizontalVariants = &Variants::empty;
|
|
271
|
+
/** MUST NOT BE NULL, equals to &Variants::empty if absent */
|
|
272
|
+
const Variants* _verticalVariants = &Variants::empty;
|
|
273
|
+
/** MUST NOT BE NULL, equals to &Variants::empty if absent */
|
|
274
|
+
const Variants* _scriptsVariants = &Variants::empty;
|
|
275
|
+
/** MUST NOT BE NULL, equals to &GlyphAssembly::empty if absent */
|
|
276
|
+
const GlyphAssembly* _horizontalAssembly = &GlyphAssembly::empty;
|
|
277
|
+
/** MUST NOT BE NULL, equals to &GlyphAssembly::empty if absent */
|
|
278
|
+
const GlyphAssembly* _verticalAssembly = &GlyphAssembly::empty;
|
|
279
|
+
/** MUST NOT BE NULL, equals to &MathKernRecord::empty if absent */
|
|
280
|
+
const MathKernRecord* _kernRecord = &MathKernRecord::empty;
|
|
281
|
+
|
|
282
|
+
explicit Math(u16 ignore) noexcept {};
|
|
283
|
+
|
|
284
|
+
public:
|
|
285
|
+
no_copy_assign(Math);
|
|
286
|
+
|
|
287
|
+
static const Math empty;
|
|
288
|
+
|
|
289
|
+
/** Italics correction */
|
|
290
|
+
inline i16 italicsCorrection() const { return _italicsCorrection; }
|
|
291
|
+
|
|
292
|
+
/** Top accent attachment */
|
|
293
|
+
inline i16 topAccentAttachment() const { return _topAccentAttachment; }
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Alternate forms of the current glyph for use in typesetting math,
|
|
297
|
+
* are of different sizes to layout horizontally.
|
|
298
|
+
*
|
|
299
|
+
* If absent, return Variants::emtpy
|
|
300
|
+
*/
|
|
301
|
+
inline const Variants& horizontalVariants() const { return *_horizontalVariants; }
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Alternate forms of the current glyph for use in typesetting math,
|
|
305
|
+
* are of different sizes to layout vertically.
|
|
306
|
+
*
|
|
307
|
+
* If absent, return Variants::empty
|
|
308
|
+
*/
|
|
309
|
+
inline const Variants& verticalVariants() const { return *_verticalVariants; }
|
|
310
|
+
|
|
311
|
+
/***
|
|
312
|
+
* Alternate forms of the current glyph for use in typesetting math,
|
|
313
|
+
* are of different sizes to place scripts.
|
|
314
|
+
*
|
|
315
|
+
* If absent, return Variants::empty
|
|
316
|
+
*/
|
|
317
|
+
inline const Variants& scriptsVariants() const { return *_scriptsVariants; }
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* This allows constructing very large versions of the glyph by stacking the components together
|
|
321
|
+
* horizontally. Some components may be repeated so there is no bound on the size.
|
|
322
|
+
*
|
|
323
|
+
* This is different from horizontalVariants which expects prebuilt glyphs of various fixed sizes.
|
|
324
|
+
*
|
|
325
|
+
* If absent, return GlyphAssembly::empty
|
|
326
|
+
*/
|
|
327
|
+
inline const GlyphAssembly& horizontalAssembly() const { return *_horizontalAssembly; }
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* This allows constructing very large versions of the glyph by stacking the components together
|
|
331
|
+
* vertically. Some components may be repeated so there is no bound on the size.
|
|
332
|
+
*
|
|
333
|
+
* This is different from verticalVariants which expects prebuilt glyphs of various fixed sizes.
|
|
334
|
+
*
|
|
335
|
+
* If absent, return GlyphAssembly::empty
|
|
336
|
+
*/
|
|
337
|
+
inline const GlyphAssembly& verticalAssembly() const { return *_verticalAssembly; }
|
|
338
|
+
|
|
339
|
+
inline const MathKernRecord& kernRecord() const { return *_kernRecord; }
|
|
340
|
+
|
|
341
|
+
~Math();
|
|
342
|
+
|
|
343
|
+
friend CLMReader;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/** Defines info for one glyph, device-table is JUST IGNORED. */
|
|
347
|
+
struct Glyph final {
|
|
348
|
+
private:
|
|
349
|
+
Metrics _metrics{};
|
|
350
|
+
/** MUST NOT BE NULL, equals to &KernRecord::empty if absent */
|
|
351
|
+
const KernRecord* _kernRecord = &KernRecord::empty;
|
|
352
|
+
/** MUST NOT BE NULL, equals to &Math::empty if absent */
|
|
353
|
+
const Math* _math = &Math::empty;
|
|
354
|
+
|
|
355
|
+
#ifdef HAVE_GLYPH_RENDER_PATH
|
|
356
|
+
/** MUST NOT BE NULL, equals to &Path::empty if absent */
|
|
357
|
+
const Path* _path = &Path::empty;
|
|
358
|
+
#endif
|
|
359
|
+
|
|
360
|
+
Glyph() = default;
|
|
361
|
+
|
|
362
|
+
public:
|
|
363
|
+
no_copy_assign(Glyph);
|
|
364
|
+
|
|
365
|
+
inline const Metrics& metrics() const { return _metrics; }
|
|
366
|
+
|
|
367
|
+
inline const Math& math() const { return *_math; }
|
|
368
|
+
|
|
369
|
+
inline const KernRecord& kernRecord() const { return *_kernRecord; }
|
|
370
|
+
|
|
371
|
+
#ifdef HAVE_GLYPH_RENDER_PATH
|
|
372
|
+
|
|
373
|
+
inline const Path& path() const { return *_path; }
|
|
374
|
+
|
|
375
|
+
#endif
|
|
376
|
+
|
|
377
|
+
~Glyph();
|
|
378
|
+
|
|
379
|
+
friend CLMReader;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
} // namespace microtex
|
|
383
|
+
|
|
384
|
+
#endif
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
#ifndef MICROTEX_MATH_CONSTS_H
|
|
2
|
+
#define MICROTEX_MATH_CONSTS_H
|
|
3
|
+
|
|
4
|
+
#include "utils/utils.h"
|
|
5
|
+
|
|
6
|
+
namespace microtex {
|
|
7
|
+
|
|
8
|
+
#define TEX_MATH_CONSTS_COUNT 57
|
|
9
|
+
|
|
10
|
+
class CLMReader;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Defines a number of constants required to properly position elements of mathematical formulas.
|
|
14
|
+
* See
|
|
15
|
+
* <a href="https://docs.microsoft.com/en-us/typography/opentype/spec/math#mathconstants-table">
|
|
16
|
+
* math constants specification
|
|
17
|
+
* </a>
|
|
18
|
+
* for details.
|
|
19
|
+
* <p>
|
|
20
|
+
* Device-table is JUST IGNORED, so all the fields are represent as microtex::i16 directly.
|
|
21
|
+
*/
|
|
22
|
+
struct MathConsts {
|
|
23
|
+
private:
|
|
24
|
+
/** Array to represents all constants */
|
|
25
|
+
i16 _fields[TEX_MATH_CONSTS_COUNT]{};
|
|
26
|
+
|
|
27
|
+
MathConsts() = default;
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
no_copy_assign(MathConsts);
|
|
31
|
+
|
|
32
|
+
inline i16 scriptPercentScaleDown() const { return _fields[0]; }
|
|
33
|
+
|
|
34
|
+
inline i16 scriptScriptPercentScaleDown() const { return _fields[1]; }
|
|
35
|
+
|
|
36
|
+
inline i16 delimitedSubFormulaMinHeight() const { return _fields[2]; }
|
|
37
|
+
|
|
38
|
+
inline i16 displayOperatorMinHeight() const { return _fields[3]; }
|
|
39
|
+
|
|
40
|
+
inline i16 mathLeading() const { return _fields[4]; }
|
|
41
|
+
|
|
42
|
+
inline i16 axisHeight() const { return _fields[5]; }
|
|
43
|
+
|
|
44
|
+
inline i16 accentBaseHeight() const { return _fields[6]; }
|
|
45
|
+
|
|
46
|
+
inline i16 flattenedAccentBaseHeight() const { return _fields[7]; }
|
|
47
|
+
|
|
48
|
+
inline i16 subscriptShiftDown() const { return _fields[8]; }
|
|
49
|
+
|
|
50
|
+
inline i16 subscriptTopMax() const { return _fields[9]; }
|
|
51
|
+
|
|
52
|
+
inline i16 subscriptBaselineDropMin() const { return _fields[10]; }
|
|
53
|
+
|
|
54
|
+
inline i16 superscriptShiftUp() const { return _fields[11]; }
|
|
55
|
+
|
|
56
|
+
inline i16 superscriptShiftUpCramped() const { return _fields[12]; }
|
|
57
|
+
|
|
58
|
+
inline i16 superscriptBottomMin() const { return _fields[13]; }
|
|
59
|
+
|
|
60
|
+
inline i16 superscriptBaselineDropMax() const { return _fields[14]; }
|
|
61
|
+
|
|
62
|
+
inline i16 subSuperscriptGapMin() const { return _fields[15]; }
|
|
63
|
+
|
|
64
|
+
inline i16 superscriptBottomMaxWithSubscript() const { return _fields[16]; }
|
|
65
|
+
|
|
66
|
+
inline i16 spaceAfterScript() const { return _fields[17]; }
|
|
67
|
+
|
|
68
|
+
inline i16 upperLimitGapMin() const { return _fields[18]; }
|
|
69
|
+
|
|
70
|
+
inline i16 upperLimitBaselineRiseMin() const { return _fields[19]; }
|
|
71
|
+
|
|
72
|
+
inline i16 lowerLimitGapMin() const { return _fields[20]; }
|
|
73
|
+
|
|
74
|
+
inline i16 lowerLimitBaselineDropMin() const { return _fields[21]; }
|
|
75
|
+
|
|
76
|
+
inline i16 stackTopShiftUp() const { return _fields[22]; }
|
|
77
|
+
|
|
78
|
+
inline i16 stackTopDisplayStyleShiftUp() const { return _fields[23]; }
|
|
79
|
+
|
|
80
|
+
inline i16 stackBottomShiftDown() const { return _fields[24]; }
|
|
81
|
+
|
|
82
|
+
inline i16 stackBottomDisplayStyleShiftDown() const { return _fields[25]; }
|
|
83
|
+
|
|
84
|
+
inline i16 stackGapMin() const { return _fields[26]; }
|
|
85
|
+
|
|
86
|
+
inline i16 stackDisplayStyleGapMin() const { return _fields[27]; }
|
|
87
|
+
|
|
88
|
+
// region TODO stretch stacks not used
|
|
89
|
+
inline i16 stretchStackTopShiftUp() const { return _fields[28]; }
|
|
90
|
+
|
|
91
|
+
inline i16 stretchStackBottomShiftDown() const { return _fields[29]; }
|
|
92
|
+
|
|
93
|
+
inline i16 stretchStackGapAboveMin() const { return _fields[30]; }
|
|
94
|
+
|
|
95
|
+
inline i16 stretchStackGapBelowMin() const { return _fields[31]; }
|
|
96
|
+
// endregion
|
|
97
|
+
|
|
98
|
+
inline i16 fractionNumeratorShiftUp() const { return _fields[32]; }
|
|
99
|
+
|
|
100
|
+
inline i16 fractionNumeratorDisplayStyleShiftUp() const { return _fields[33]; }
|
|
101
|
+
|
|
102
|
+
inline i16 fractionDenominatorShiftDown() const { return _fields[34]; }
|
|
103
|
+
|
|
104
|
+
inline i16 fractionDenominatorDisplayStyleShiftDown() const { return _fields[35]; }
|
|
105
|
+
|
|
106
|
+
inline i16 fractionNumeratorGapMin() const { return _fields[36]; }
|
|
107
|
+
|
|
108
|
+
inline i16 fractionNumeratorDisplayStyleGapMin() const { return _fields[37]; }
|
|
109
|
+
|
|
110
|
+
inline i16 fractionRuleThickness() const { return _fields[38]; }
|
|
111
|
+
|
|
112
|
+
inline i16 fractionDenominatorGapMin() const { return _fields[39]; }
|
|
113
|
+
|
|
114
|
+
inline i16 fractionDenominatorDisplayStyleGapMin() const { return _fields[40]; }
|
|
115
|
+
|
|
116
|
+
// TODO sfrac
|
|
117
|
+
inline i16 skewedFractionHorizontalGap() const { return _fields[41]; }
|
|
118
|
+
|
|
119
|
+
inline i16 skewedFractionVerticalGap() const { return _fields[42]; }
|
|
120
|
+
|
|
121
|
+
inline i16 overbarVerticalGap() const { return _fields[43]; }
|
|
122
|
+
|
|
123
|
+
inline i16 overbarRuleThickness() const { return _fields[44]; }
|
|
124
|
+
|
|
125
|
+
inline i16 overbarExtraAscender() const { return _fields[45]; }
|
|
126
|
+
|
|
127
|
+
inline i16 underbarVerticalGap() const { return _fields[46]; }
|
|
128
|
+
|
|
129
|
+
inline i16 underbarRuleThickness() const { return _fields[47]; }
|
|
130
|
+
|
|
131
|
+
inline i16 underbarExtraDescender() const { return _fields[48]; }
|
|
132
|
+
|
|
133
|
+
inline i16 radicalVerticalGap() const { return _fields[49]; }
|
|
134
|
+
|
|
135
|
+
inline i16 radicalDisplayStyleVerticalGap() const { return _fields[50]; }
|
|
136
|
+
|
|
137
|
+
inline i16 radicalRuleThickness() const { return _fields[51]; }
|
|
138
|
+
|
|
139
|
+
inline i16 radicalExtraAscender() const { return _fields[52]; }
|
|
140
|
+
|
|
141
|
+
inline i16 radicalKernBeforeDegree() const { return _fields[53]; }
|
|
142
|
+
|
|
143
|
+
inline i16 radicalKernAfterDegree() const { return _fields[54]; }
|
|
144
|
+
|
|
145
|
+
inline i16 radicalDegreeBottomRaisePercent() const { return _fields[55]; }
|
|
146
|
+
|
|
147
|
+
inline i16 minConnectorOverlap() const { return _fields[56]; }
|
|
148
|
+
|
|
149
|
+
friend CLMReader;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
} // namespace microtex
|
|
153
|
+
|
|
154
|
+
#endif // MICROTEX_MATH_CONSTS_H
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
otf_src = [
|
|
2
|
+
'otf/clm.cpp',
|
|
3
|
+
'otf/fontsense.cpp',
|
|
4
|
+
'otf/glyph.cpp',
|
|
5
|
+
'otf/otf.cpp',
|
|
6
|
+
'otf/path.cpp'
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
if install_headerfiles
|
|
10
|
+
install_headers([
|
|
11
|
+
'clm.h',
|
|
12
|
+
'fontsense.h',
|
|
13
|
+
'glyph.h',
|
|
14
|
+
'math_consts.h',
|
|
15
|
+
'otf.h',
|
|
16
|
+
'path.h'
|
|
17
|
+
], subdir: 'microtex/otf')
|
|
18
|
+
endif
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#include "otf/otf.h"
|
|
2
|
+
|
|
3
|
+
#include "otf/clm.h"
|
|
4
|
+
|
|
5
|
+
using namespace std;
|
|
6
|
+
|
|
7
|
+
namespace microtex {
|
|
8
|
+
|
|
9
|
+
pair<bool, i16> ClassKerning::operator()(u16 left, u16 right) const {
|
|
10
|
+
const int li = binIndexOf(_leftCount, [&](int i) { return left - _lefts[i << 1]; });
|
|
11
|
+
if (li < 0) return {false, 0};
|
|
12
|
+
const int ri = binIndexOf(_rightCount, [&](int i) { return right - _rights[i << 1]; });
|
|
13
|
+
if (ri < 0) return {false, 0};
|
|
14
|
+
const int i = _lefts[(li << 1) + 1];
|
|
15
|
+
const int j = _rights[(ri << 1) + 1];
|
|
16
|
+
return {true, _table[i * _columnLength + j]};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ClassKerning::~ClassKerning() {
|
|
20
|
+
delete _lefts;
|
|
21
|
+
delete _rights;
|
|
22
|
+
delete _table;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Otf* Otf::fromFile(const char* filePath) {
|
|
26
|
+
const CLMReader reader;
|
|
27
|
+
return reader.read(filePath);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Otf* Otf::fromData(size_t len, const u8* data) {
|
|
31
|
+
const CLMReader reader;
|
|
32
|
+
return reader.read(len, data);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
u16 Otf::space() const {
|
|
36
|
+
auto glyph = glyphOfUnicode(' ');
|
|
37
|
+
if (glyph != nullptr) {
|
|
38
|
+
return glyph->metrics().width();
|
|
39
|
+
}
|
|
40
|
+
// If no space glyph was found, we use the 1/3 em size
|
|
41
|
+
return em() / 3;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
i32 Otf::glyphId(c32 codepoint) const {
|
|
45
|
+
const int index = binIndexOf(_unicodeCount, [&](int i) { return codepoint - _unicodes[i]; });
|
|
46
|
+
if (index < 0) return -1;
|
|
47
|
+
return _unicodeGlyphs[index];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const Glyph* Otf::glyphOfUnicode(c32 codepoint) const {
|
|
51
|
+
const int id = glyphId(codepoint);
|
|
52
|
+
if (id < 0) return nullptr;
|
|
53
|
+
return _glyphs[id];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const Glyph* Otf::glyph(i32 id) const {
|
|
57
|
+
if (id >= _glyphCount || id < 0) return nullptr;
|
|
58
|
+
return _glyphs[id];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
i16 Otf::classKerning(u16 left, u16 right) const {
|
|
62
|
+
for (u16 i = 0; i < _classKerningCount; i++) {
|
|
63
|
+
auto [found, value] = (*_classKernings[i])(left, right);
|
|
64
|
+
if (found) return value;
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Otf::~Otf() {
|
|
70
|
+
delete[] _unicodes;
|
|
71
|
+
delete[] _unicodeGlyphs;
|
|
72
|
+
delete _mathConsts;
|
|
73
|
+
delete _ligatures;
|
|
74
|
+
if (_classKernings != nullptr) {
|
|
75
|
+
for (u16 i = 0; i < _classKerningCount; i++) delete _classKernings[i];
|
|
76
|
+
delete[] _classKernings;
|
|
77
|
+
}
|
|
78
|
+
if (_glyphs != nullptr) {
|
|
79
|
+
for (u16 i = 0; i < _glyphCount; i++) delete _glyphs[i];
|
|
80
|
+
delete[] _glyphs;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
} // namespace microtex
|