libstb 0.7.0__tar.gz → 0.8.0__tar.gz

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.
Files changed (239) hide show
  1. {libstb-0.7.0 → libstb-0.8.0}/CHANGELOG.md +63 -1
  2. {libstb-0.7.0 → libstb-0.8.0}/CMakeLists.txt +9 -0
  3. {libstb-0.7.0 → libstb-0.8.0}/PKG-INFO +10 -4
  4. {libstb-0.7.0 → libstb-0.8.0}/README.md +7 -2
  5. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/README.md +9 -9
  6. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/benchmark.json +1 -1
  7. libstb-0.8.0/benchmarks/outputs/index.html +1501 -0
  8. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/sizes.json +1 -1
  9. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/bench_sizes.py +1 -1
  10. libstb-0.8.0/benchmarks/report/CMakeLists.txt +36 -0
  11. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/report/generate_report.py +34 -93
  12. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/report/template.html.jinja2 +114 -307
  13. libstb-0.8.0/checklist.md +139 -0
  14. {libstb-0.7.0 → libstb-0.8.0}/cmake/coverage_iframe.html.in +1 -1
  15. {libstb-0.7.0 → libstb-0.8.0}/docs/CMakeLists.txt +6 -0
  16. {libstb-0.7.0 → libstb-0.8.0}/docs/CreateDocs.cmake +8 -3
  17. {libstb-0.7.0 → libstb-0.8.0}/docs/assets/libstb-docs.css +130 -78
  18. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/CreateDocs.cmake +1 -1
  19. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/Doxyfile.in +1 -1
  20. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/footer.html.in +1 -1
  21. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/libstb-doxygen.css +7 -7
  22. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/mainpage.md +16 -2
  23. {libstb-0.7.0 → libstb-0.8.0}/docs/generate_index.py +37 -30
  24. {libstb-0.7.0 → libstb-0.8.0}/docs/guide.md +48 -1
  25. {libstb-0.7.0 → libstb-0.8.0}/docs/index.html.in +115 -92
  26. {libstb-0.7.0 → libstb-0.8.0}/docs/initial_comment.in +1 -1
  27. {libstb-0.7.0 → libstb-0.8.0}/docs/make_showcase.py +27 -2
  28. libstb-0.8.0/docs/python/index-install.txt +2 -0
  29. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/_themes/libstb/layout.html +8 -6
  30. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/_themes/libstb/static/libstb-sphinx.css +12 -12
  31. libstb-0.8.0/docs/python/source/font.rst +61 -0
  32. {libstb-0.7.0 → libstb-0.8.0}/docs/supported_langs.json +13 -13
  33. libstb-0.8.0/examples/cpp/canvas.cpp +53 -0
  34. {libstb-0.7.0 → libstb-0.8.0}/examples/python/05_font_render.py +9 -0
  35. libstb-0.8.0/include/stb/canvas.hpp +304 -0
  36. libstb-0.8.0/include/stb/color.hpp +1051 -0
  37. {libstb-0.7.0 → libstb-0.8.0}/include/stb/font.hpp +25 -0
  38. {libstb-0.7.0 → libstb-0.8.0}/include/stb/image.hpp +4 -0
  39. libstb-0.8.0/include/stb/shape.hpp +67 -0
  40. libstb-0.8.0/include/stb/shaping.hpp +49 -0
  41. {libstb-0.7.0 → libstb-0.8.0}/include/stb.h +5 -1
  42. {libstb-0.7.0 → libstb-0.8.0}/pyproject.toml +2 -2
  43. libstb-0.8.0/src/bindings/python/bind_font.cpp +353 -0
  44. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/bind_image.cpp +0 -22
  45. libstb-0.8.0/src/bindings/python/binding.hpp +59 -0
  46. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/libstb/__init__.py +2 -2
  47. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/libstb/font.py +8 -0
  48. libstb-0.8.0/src/core/arabic.cpp +220 -0
  49. libstb-0.8.0/src/core/arabic.hpp +39 -0
  50. libstb-0.8.0/src/core/bidi.cpp +225 -0
  51. libstb-0.8.0/src/core/bidi.hpp +30 -0
  52. {libstb-0.7.0 → libstb-0.8.0}/src/core/font.cpp +133 -20
  53. libstb-0.8.0/src/core/gsub.cpp +544 -0
  54. libstb-0.8.0/src/core/gsub.hpp +148 -0
  55. {libstb-0.7.0 → libstb-0.8.0}/src/core/image_ops.cpp +8 -4
  56. libstb-0.8.0/src/core/otl.cpp +109 -0
  57. libstb-0.8.0/src/core/otl.hpp +130 -0
  58. libstb-0.8.0/src/core/shape.cpp +117 -0
  59. libstb-0.8.0/src/core/shaping.cpp +38 -0
  60. libstb-0.8.0/src/core/text_shaper.cpp +185 -0
  61. libstb-0.8.0/src/core/text_shaper.hpp +68 -0
  62. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/CMakeLists.txt +7 -0
  63. libstb-0.8.0/tests/cpp/test_color.cpp +384 -0
  64. libstb-0.8.0/tests/cpp/test_font.cpp +838 -0
  65. libstb-0.8.0/tests/cpp/test_gsub.cpp +456 -0
  66. libstb-0.8.0/tests/data/OFL-Vazirmatn.txt +93 -0
  67. libstb-0.8.0/tests/data/libstb-fa-gsub-test.ttf +0 -0
  68. libstb-0.8.0/tests/data/libstb-fa-test.ttf +0 -0
  69. libstb-0.8.0/tests/data/make_persian_font.py +67 -0
  70. {libstb-0.7.0 → libstb-0.8.0}/tests/genhtml.css +20 -20
  71. libstb-0.8.0/tests/python/test_font.py +652 -0
  72. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_memory.py +31 -0
  73. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_oop.py +24 -0
  74. libstb-0.8.0/tools/gen_arabic_shaping.py +91 -0
  75. libstb-0.7.0/benchmarks/outputs/index.html +0 -7726
  76. libstb-0.7.0/benchmarks/report/CMakeLists.txt +0 -94
  77. libstb-0.7.0/docs/python/index-install.txt +0 -2
  78. libstb-0.7.0/docs/python/source/_themes/libstb/static/libstb-docs.css +0 -418
  79. libstb-0.7.0/docs/python/source/font.rst +0 -40
  80. libstb-0.7.0/src/bindings/python/bind_font.cpp +0 -139
  81. libstb-0.7.0/src/bindings/python/binding.hpp +0 -33
  82. libstb-0.7.0/tests/cpp/test_font.cpp +0 -235
  83. libstb-0.7.0/tests/python/test_font.py +0 -197
  84. {libstb-0.7.0 → libstb-0.8.0}/.github/workflows/cmake.yml +0 -0
  85. {libstb-0.7.0 → libstb-0.8.0}/.github/workflows/orchestrator.yml +0 -0
  86. {libstb-0.7.0 → libstb-0.8.0}/.github/workflows/release_template.md +0 -0
  87. {libstb-0.7.0 → libstb-0.8.0}/.github/workflows/wheels.yml +0 -0
  88. {libstb-0.7.0 → libstb-0.8.0}/.gitignore +0 -0
  89. {libstb-0.7.0 → libstb-0.8.0}/LICENSE.txt +0 -0
  90. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/.gitignore +0 -0
  91. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/CMakeLists.txt +0 -0
  92. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/cmake/Download.cmake +0 -0
  93. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/cmake/FetchRealCorpus.cmake +0 -0
  94. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/corpus/.gitignore +0 -0
  95. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/fonts.json +0 -0
  96. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/scaling.json +0 -0
  97. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/system_info.json +0 -0
  98. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/throughput.json +0 -0
  99. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/throughput_memory.json +0 -0
  100. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/outputs/results/verify.json +0 -0
  101. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/CMakeLists.txt +0 -0
  102. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/bench_fonts.py +0 -0
  103. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/bench_op_memory_driver.py +0 -0
  104. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/bench_op_memory_one.py +0 -0
  105. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/bench_scaling.py +0 -0
  106. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/bench_throughput.py +0 -0
  107. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/corpus.py +0 -0
  108. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/real_corpus_manifest.py +0 -0
  109. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/requirements.txt +0 -0
  110. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/runners.py +0 -0
  111. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/system_info.py +0 -0
  112. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/python/verify.py +0 -0
  113. {libstb-0.7.0 → libstb-0.8.0}/benchmarks/report/gather.py +0 -0
  114. {libstb-0.7.0 → libstb-0.8.0}/cmake/DynamicVersion.cmake +0 -0
  115. {libstb-0.7.0 → libstb-0.8.0}/cmake/FixLCovPaths.cmake +0 -0
  116. {libstb-0.7.0 → libstb-0.8.0}/cmake/GenerateIframe.cmake +0 -0
  117. {libstb-0.7.0 → libstb-0.8.0}/cmake/Optimize.cmake +0 -0
  118. {libstb-0.7.0 → libstb-0.8.0}/cmake/Startup.cmake +0 -0
  119. {libstb-0.7.0 → libstb-0.8.0}/cmake/libstbConfig.cmake.in +0 -0
  120. {libstb-0.7.0 → libstb-0.8.0}/docs/InjectComment.cmake +0 -0
  121. {libstb-0.7.0 → libstb-0.8.0}/docs/assets/bench-teaser.js +0 -0
  122. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/index-docs.json +0 -0
  123. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/index-example.txt +0 -0
  124. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/index-install.txt +0 -0
  125. {libstb-0.7.0 → libstb-0.8.0}/docs/cpp/topbar.html.in +0 -0
  126. {libstb-0.7.0 → libstb-0.8.0}/docs/images/libstb-logo.png +0 -0
  127. {libstb-0.7.0 → libstb-0.8.0}/docs/images/libstb-sq.png +0 -0
  128. {libstb-0.7.0 → libstb-0.8.0}/docs/images/libstb-sq.svg +0 -0
  129. {libstb-0.7.0 → libstb-0.8.0}/docs/images/libstb-sq.txt +0 -0
  130. {libstb-0.7.0 → libstb-0.8.0}/docs/images/libstb-theme.svg +0 -0
  131. {libstb-0.7.0 → libstb-0.8.0}/docs/python/CreateDocs.cmake +0 -0
  132. {libstb-0.7.0 → libstb-0.8.0}/docs/python/index-docs.json +0 -0
  133. {libstb-0.7.0 → libstb-0.8.0}/docs/python/index-example.txt +0 -0
  134. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/_themes/libstb/libstb-nav.html +0 -0
  135. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/_themes/libstb/page.html +0 -0
  136. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/_themes/libstb/theme.toml +0 -0
  137. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/conf.py +0 -0
  138. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/errors.rst +0 -0
  139. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/image.rst +0 -0
  140. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/index.rst +0 -0
  141. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/resizer.rst +0 -0
  142. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/simd.rst +0 -0
  143. {libstb-0.7.0 → libstb-0.8.0}/docs/python/source/zlib.rst +0 -0
  144. {libstb-0.7.0 → libstb-0.8.0}/examples/cpp/.gitignore +0 -0
  145. {libstb-0.7.0 → libstb-0.8.0}/examples/notebooks/.gitignore +0 -0
  146. {libstb-0.7.0 → libstb-0.8.0}/examples/notebooks/01_getting_started.ipynb +0 -0
  147. {libstb-0.7.0 → libstb-0.8.0}/examples/notebooks/02_resize_filters.ipynb +0 -0
  148. {libstb-0.7.0 → libstb-0.8.0}/examples/notebooks/03_font_rendering.ipynb +0 -0
  149. {libstb-0.7.0 → libstb-0.8.0}/examples/notebooks/04_edit_and_orient.ipynb +0 -0
  150. {libstb-0.7.0 → libstb-0.8.0}/examples/notebooks/requirements.txt +0 -0
  151. {libstb-0.7.0 → libstb-0.8.0}/examples/python/.gitignore +0 -0
  152. {libstb-0.7.0 → libstb-0.8.0}/examples/python/01_open_and_inspect.py +0 -0
  153. {libstb-0.7.0 → libstb-0.8.0}/examples/python/02_encode_formats.py +0 -0
  154. {libstb-0.7.0 → libstb-0.8.0}/examples/python/03_resize_filters.py +0 -0
  155. {libstb-0.7.0 → libstb-0.8.0}/examples/python/04_numpy_interop.py +0 -0
  156. {libstb-0.7.0 → libstb-0.8.0}/examples/python/06_imread_imwrite.py +0 -0
  157. {libstb-0.7.0 → libstb-0.8.0}/examples/python/07_dlpack.py +0 -0
  158. {libstb-0.7.0 → libstb-0.8.0}/examples/python/08_geometry.py +0 -0
  159. {libstb-0.7.0 → libstb-0.8.0}/examples/python/09_channels_and_alpha.py +0 -0
  160. {libstb-0.7.0 → libstb-0.8.0}/examples/python/10_exif_orientation.py +0 -0
  161. {libstb-0.7.0 → libstb-0.8.0}/examples/python/11_pillow.py +0 -0
  162. {libstb-0.7.0 → libstb-0.8.0}/examples/python/requirements.txt +0 -0
  163. {libstb-0.7.0 → libstb-0.8.0}/include/stb/env.hpp +0 -0
  164. {libstb-0.7.0 → libstb-0.8.0}/include/stb/error.hpp +0 -0
  165. {libstb-0.7.0 → libstb-0.8.0}/include/stb/resizer.hpp +0 -0
  166. {libstb-0.7.0 → libstb-0.8.0}/include/stb/utf8.hpp +0 -0
  167. {libstb-0.7.0 → libstb-0.8.0}/include/stb/zlib.hpp +0 -0
  168. {libstb-0.7.0 → libstb-0.8.0}/requirements-dev.txt +0 -0
  169. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/CMakeLists.txt +0 -0
  170. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/bind_resizer.cpp +0 -0
  171. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/bind_zlib.cpp +0 -0
  172. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/binding.cpp +0 -0
  173. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/libstb/compress.py +0 -0
  174. {libstb-0.7.0 → libstb-0.8.0}/src/bindings/python/libstb/image.py +0 -0
  175. {libstb-0.7.0 → libstb-0.8.0}/src/core/exif.cpp +0 -0
  176. {libstb-0.7.0 → libstb-0.8.0}/src/core/file.hpp +0 -0
  177. {libstb-0.7.0 → libstb-0.8.0}/src/core/image.cpp +0 -0
  178. {libstb-0.7.0 → libstb-0.8.0}/src/core/image_kernels.hpp +0 -0
  179. {libstb-0.7.0 → libstb-0.8.0}/src/core/image_kernels_scalar.cpp +0 -0
  180. {libstb-0.7.0 → libstb-0.8.0}/src/core/image_kernels_sse2.cpp +0 -0
  181. {libstb-0.7.0 → libstb-0.8.0}/src/core/resizer.cpp +0 -0
  182. {libstb-0.7.0 → libstb-0.8.0}/src/core/simd.cpp +0 -0
  183. {libstb-0.7.0 → libstb-0.8.0}/src/core/simd.hpp +0 -0
  184. {libstb-0.7.0 → libstb-0.8.0}/src/core/utf8.cpp +0 -0
  185. {libstb-0.7.0 → libstb-0.8.0}/src/core/zlib.cpp +0 -0
  186. {libstb-0.7.0 → libstb-0.8.0}/src/core/zlib_bridge.hpp +0 -0
  187. {libstb-0.7.0 → libstb-0.8.0}/src/third_party/README.md +0 -0
  188. {libstb-0.7.0 → libstb-0.8.0}/src/third_party/stb/stb_image.h +0 -0
  189. {libstb-0.7.0 → libstb-0.8.0}/src/third_party/stb/stb_image_resize2.h +0 -0
  190. {libstb-0.7.0 → libstb-0.8.0}/src/third_party/stb/stb_image_write.h +0 -0
  191. {libstb-0.7.0 → libstb-0.8.0}/src/third_party/stb/stb_rect_pack.h +0 -0
  192. {libstb-0.7.0 → libstb-0.8.0}/src/third_party/stb/stb_truetype.h +0 -0
  193. {libstb-0.7.0 → libstb-0.8.0}/tests/CMakeLists.txt +0 -0
  194. {libstb-0.7.0 → libstb-0.8.0}/tests/cmake/CMakeLists.txt +0 -0
  195. {libstb-0.7.0 → libstb-0.8.0}/tests/cmake/consumer_project/CMakeLists.txt +0 -0
  196. {libstb-0.7.0 → libstb-0.8.0}/tests/cmake/consumer_project/main.cpp +0 -0
  197. {libstb-0.7.0 → libstb-0.8.0}/tests/cmake/run_consumer_test.cmake +0 -0
  198. {libstb-0.7.0 → libstb-0.8.0}/tests/coverage_dashboard.html.in +0 -0
  199. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_common.hpp +0 -0
  200. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_edit.cpp +0 -0
  201. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_encode.cpp +0 -0
  202. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_env.cpp +0 -0
  203. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_exif.cpp +0 -0
  204. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_image.cpp +0 -0
  205. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_resizer.cpp +0 -0
  206. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_utf8.cpp +0 -0
  207. {libstb-0.7.0 → libstb-0.8.0}/tests/cpp/test_zlib.cpp +0 -0
  208. {libstb-0.7.0 → libstb-0.8.0}/tests/data/libstb-test.ttf +0 -0
  209. {libstb-0.7.0 → libstb-0.8.0}/tests/data/make_test_font.py +0 -0
  210. {libstb-0.7.0 → libstb-0.8.0}/tests/python/CMakeLists.txt +0 -0
  211. {libstb-0.7.0 → libstb-0.8.0}/tests/python/conftest.py +0 -0
  212. {libstb-0.7.0 → libstb-0.8.0}/tests/python/pngbomb.py +0 -0
  213. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_array_interface.py +0 -0
  214. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_channels.py +0 -0
  215. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_dlpack.py +0 -0
  216. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_encode.py +0 -0
  217. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_errors.py +0 -0
  218. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_exif.py +0 -0
  219. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_functional.py +0 -0
  220. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_gc.py +0 -0
  221. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_geometry.py +0 -0
  222. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_image.py +0 -0
  223. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_lossless_exact.py +0 -0
  224. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_lossy_tolerance.py +0 -0
  225. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_no_numpy.py +0 -0
  226. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_pillow_convert.py +0 -0
  227. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_pillow_parity.py +0 -0
  228. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_png_bomb.py +0 -0
  229. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_resizer.py +0 -0
  230. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_simd.py +0 -0
  231. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_torch.py +0 -0
  232. {libstb-0.7.0 → libstb-0.8.0}/tests/python/test_zlib.py +0 -0
  233. {libstb-0.7.0 → libstb-0.8.0}/tests/python/tolerances.py +0 -0
  234. {libstb-0.7.0 → libstb-0.8.0}/tests/tools/jpeg_vs_upstream.py +0 -0
  235. {libstb-0.7.0 → libstb-0.8.0}/tests/tools/zlib_fuzz.py +0 -0
  236. {libstb-0.7.0 → libstb-0.8.0}/tests/utest/utest.h +0 -0
  237. {libstb-0.7.0 → libstb-0.8.0}/tests/utest/utest_main.cxx +0 -0
  238. {libstb-0.7.0 → libstb-0.8.0}/tools/gen_font_metrics.py +0 -0
  239. {libstb-0.7.0 → libstb-0.8.0}/version.py +0 -0
@@ -3,7 +3,69 @@
3
3
  All notable changes to libstb are listed here, newest first. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Dates are commit dates.
5
5
 
6
- This file was generated from the git history (61 commits, tags `v0.3.0`, `v0.4.0`, `v0.5.0`, `v0.6.0`, `v0.7.0`).
6
+ This file was generated from the git history (61 commits, tags `v0.3.0`, `v0.4.0`, `v0.5.0`, `v0.6.0`, `v0.7.0`); 0.8.0 was written by hand from the 26 commits after `v0.7.0`.
7
+
8
+ ## [0.8.0] - 2026-10-22
9
+
10
+ ### Added
11
+ - Drawing text (`4ab53e3`, `15ad30c`): `stb::font::draw_text` and `Image.draw_text` write multi-line
12
+ UTF-8 text onto a 1 to 4 channel image with alpha blending. `text_align` (`left`, `center`,
13
+ `right`) aligns every line to the x you give.
14
+ - `stb::color` (`<stb/color.hpp>`, `ededbef`): colours from names, `#hex`, `{r, g, b[, a]}` and
15
+ string literals, and `color::from_value(0xRRGGBB)`. Used by `draw_text` and the canvas.
16
+ - Canvas (`stb::canvas`, `Image.canvas`, `1fc491a`, `4201852`, `bcc2e39`): collect texts and
17
+ shapes, drawn together by `finish()`. `add_text` returns an item with its own `.font()`,
18
+ `.size()`, `.color()`, `.align()`, `.bg_color()` and `.padding()`. `add_rect` (with `.radius()`),
19
+ `add_ellipse` and `add_line` return a shape with `.fill()`, `.no_fill()` and `.stroke()`, with
20
+ smooth edges (`6243481`). The API is the same in C++ and Python, and golden-hash tests keep
21
+ their output byte-identical.
22
+ - Right-to-left text (Persian, Arabic, Urdu, Hebrew) in `draw_text`, `measure`, `render` and the
23
+ canvas: pass the text as typed, with no `arabic-reshaper` or `python-bidi`. The line is
24
+ ordered with the Unicode bidirectional algorithm (UAX #9, without explicit embeddings and
25
+ isolates), ZWNJ and ZWJ are honoured and brackets are mirrored.
26
+ - Letter shapes and ligatures come from the font's GSUB table for Arabic script: `isol`,
27
+ `init`, `medi`, `fina`, `ccmp`, `rlig` (lam-alef), `calt` and `liga` (so "الله" is the one
28
+ glyph the font draws for it). Lookup types 1 to 7 are read (single, multiple, alternate,
29
+ ligature, context, chaining context in all three formats, extension), with lookup flags and
30
+ GDEF. A font without GSUB but with the Arabic Presentation Forms in its `cmap` is shaped
31
+ through those, and a form it lacks falls back to the plain letter (`cea22ba`, `79fce16`).
32
+ - Marks (harakat) sit over or under their letter by a simple rule, with no room of their own
33
+ (`7c301be`).
34
+ - Checked against HarfBuzz: identical glyph ids on 3,000 random strings, with and without
35
+ marks, on each of Vazirmatn, Noto Naskh Arabic and Noto Sans Arabic. About 0.2 microseconds
36
+ per character, 2.4 times faster than Pillow with raqm for the layout of a 438-character
37
+ paragraph. The GSUB table is parsed the first time right-to-left text is drawn with a font
38
+ (about 0.1 ms); opening a font is as fast as before.
39
+ - The font is untrusted input. Every read is range-checked, the growth of the glyph run and
40
+ the work of the lookups are limited in proportion to the text, and 50,000 damaged fonts
41
+ shaped under AddressSanitizer and UBSan without a crash.
42
+ - Not done: GPOS (kerning is the `kern` table only, marks are not placed by the font's
43
+ anchors, so fonts that depend on GPOS for their shapes, some Nastaliq fonts, look wrong),
44
+ GSUB lookup type 8, `locl` per language, and the Syriac features. Not checked: Hebrew,
45
+ Urdu-specific letters, OpenType-CFF (`.otf`) fonts and B Nazanin.
46
+ - `stb::font::shape_glyphs` / `Font.shape_glyphs(text)`: the glyph indices shaping chose, in
47
+ visual order, for diagnostics and tests.
48
+ - `<stb/shaping.hpp>`: `stb::shape_for_display`, `stb::has_rtl`, `stb::is_arabic_mark` and
49
+ `stb::is_arabic_mark_below`, the code-point level steps behind the above.
50
+ - Tests: white-box tests of the GSUB engine with hand-made tables (every lookup type and
51
+ format, a stage mask, truncated and damaged tables), HarfBuzz reference glyph ids in C++ and
52
+ Python, a live HarfBuzz comparison in Python when `uharfbuzz` is installed (now in the `test`
53
+ extra), a Persian golden hash shared by C++ and Python, and two Vazirmatn subsets under the
54
+ SIL OFL 1.1 in `tests/data` (`make_persian_font.py` rebuilds them).
55
+
56
+ ### Changed
57
+ - `Image.canvas` and `Image.draw_text` are nanobind methods, and a font argument of the wrong
58
+ type raises `TypeError` (`fc3aaff`, `402153d`).
59
+ - `stb::color` converts implicitly from string literals and brace lists.
60
+ - Benchmark report and docs: Chart.js and KaTeX load from cdnjs, brand colours, download buttons
61
+ for the benchmark data, and zero Doxygen and Sphinx warnings (`641561c`, `054ea1f`, `ee3af4f`).
62
+
63
+ ### Fixed
64
+ - Windows: a test variable named `small` collided with an `rpcndr.h` macro, and the canvas box
65
+ arithmetic is 64-bit with parenthesized `min`/`max` (`3145a8a`).
66
+ - Windows (MSVC): the C++ tests are built with `/utf-8`, so Persian and Arabic text written as
67
+ `"\u0633"` in a narrow string literal stays UTF-8 instead of becoming `?` in the ANSI code page,
68
+ and the shaping tests parenthesize `std::min`/`std::max` against the `windows.h` macros.
7
69
 
8
70
  ## [0.7.0] - 2026-10-17
9
71
 
@@ -80,6 +80,15 @@ function(libstb_apply_core_build_settings target)
80
80
  )
81
81
  apply_optimization_flags(${target})
82
82
 
83
+ # shape.cpp draws with floating point and the result must be the same on every platform
84
+ # (the C++ and Python canvas tests compare against one fixed hash), so no fused multiply-add
85
+ # contraction: GCC and Clang would otherwise use FMA on ARM and give last-bit differences.
86
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
87
+ set_source_files_properties(${PROJECT_SOURCE_DIR}/src/core/shape.cpp
88
+ TARGET_DIRECTORY ${target}
89
+ PROPERTIES COMPILE_OPTIONS "-ffp-contract=off")
90
+ endif()
91
+
83
92
  # image_kernels_scalar.cpp is the "scalar" SIMD backend: the same pixel loops with the
84
93
  # compiler's auto-vectoriser off. (MSVC has no such switch: there it may still vectorise,
85
94
  # with identical results.) TARGET_DIRECTORY: source file properties are per directory scope.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: libstb
3
- Version: 0.7.0
4
- Summary: Python bindings for the stb single-header libraries (image io, resize, fonts). Zero system dependencies.
3
+ Version: 0.8.0
4
+ Summary: Images, fonts and zlib on top of the stb single-header libraries: decode, encode, resize, edit, draw text and compress. Zero system dependencies.
5
5
  Author-Email: Mohammad Raziei <mohammadraziei1375@gmail.com>
6
6
  License: MIT
7
7
  Classifier: Development Status :: 3 - Alpha
@@ -24,6 +24,7 @@ Provides-Extra: pillow
24
24
  Requires-Dist: pillow; extra == "pillow"
25
25
  Provides-Extra: test
26
26
  Requires-Dist: pytest; extra == "test"
27
+ Requires-Dist: uharfbuzz; extra == "test"
27
28
  Requires-Dist: numpy; (sys_platform != "win32" or platform_machine != "ARM64" or python_version >= "3.11") and extra == "test"
28
29
  Requires-Dist: pillow; extra == "test"
29
30
  Requires-Dist: pytest-memray; sys_platform != "win32" and (platform_machine == "x86_64" or platform_machine == "arm64") and extra == "test"
@@ -31,8 +32,8 @@ Description-Content-Type: text/markdown
31
32
 
32
33
  # libstb
33
34
 
34
- Fast image and font processing for **Python and C++**, with no system dependencies and no
35
- Python dependencies: decode, encode, resize, edit and draw text with one small library.
35
+ Fast image, font and zlib processing for **Python and C++**, with no system dependencies and no
36
+ Python dependencies: decode, encode, resize, edit, draw text and compress with one small library.
36
37
 
37
38
  libstb is highly powered by [stb](https://github.com/nothings/stb), and that is where the name
38
39
  comes from. It is not a thin wrapper, though. The API is our own (typed, with explicit
@@ -63,7 +64,10 @@ pixels = img.numpy() # zero-copy view (needs numpy)
63
64
  photo = stb.Image.open("IMG_0001.jpg", orient=True) # apply the EXIF rotation while decoding
64
65
 
65
66
  font = stb.Font.open("font.ttf") # trusted fonts only
67
+ labeled = img.draw_text("Hello", font, 32, 10, 10, color=(255, 255, 255)) # text onto a copy
68
+ centred = img.draw_text("Hello", font, 32, img.width // 2, 10, align="center") # x is the centre of the line
66
69
  font.render("Hello", 32).bitmap.write("hello.png")
70
+ # Persian / Arabic text works as typed: the font's GSUB shapes and ligates it, the line is reordered (no GPOS, see docs/guide.md)
67
71
  stb.estimate_text("Hello", 16) # text size with no font file at all
68
72
 
69
73
  packed = stb.zlib_compress(data) # zlib streams: the compressor that writes PNG
@@ -93,6 +97,8 @@ small.write_jpg("small.jpg", 80);
93
97
  std::vector<std::uint8_t> bytes = small.to_png(9);
94
98
 
95
99
  stb::font f = stb::font::open("font.ttf"); // cheap to copy, thread-safe
100
+ stb::image labeled = f.draw_text(img, "Hello", 32, 10, 10, stb::color("white"));
101
+ stb::image centred = f.draw_text(img, "Hello", 32, img.width() / 2, 10, stb::color(), stb::text_align::center);
96
102
  stb::text_bitmap t = f.render("Hello", 32);
97
103
  stb::text_size est = stb::estimate_text("Hello", 16); // no font file needed
98
104
 
@@ -1,7 +1,7 @@
1
1
  # libstb
2
2
 
3
- Fast image and font processing for **Python and C++**, with no system dependencies and no
4
- Python dependencies: decode, encode, resize, edit and draw text with one small library.
3
+ Fast image, font and zlib processing for **Python and C++**, with no system dependencies and no
4
+ Python dependencies: decode, encode, resize, edit, draw text and compress with one small library.
5
5
 
6
6
  libstb is highly powered by [stb](https://github.com/nothings/stb), and that is where the name
7
7
  comes from. It is not a thin wrapper, though. The API is our own (typed, with explicit
@@ -32,7 +32,10 @@ pixels = img.numpy() # zero-copy view (needs numpy)
32
32
  photo = stb.Image.open("IMG_0001.jpg", orient=True) # apply the EXIF rotation while decoding
33
33
 
34
34
  font = stb.Font.open("font.ttf") # trusted fonts only
35
+ labeled = img.draw_text("Hello", font, 32, 10, 10, color=(255, 255, 255)) # text onto a copy
36
+ centred = img.draw_text("Hello", font, 32, img.width // 2, 10, align="center") # x is the centre of the line
35
37
  font.render("Hello", 32).bitmap.write("hello.png")
38
+ # Persian / Arabic text works as typed: the font's GSUB shapes and ligates it, the line is reordered (no GPOS, see docs/guide.md)
36
39
  stb.estimate_text("Hello", 16) # text size with no font file at all
37
40
 
38
41
  packed = stb.zlib_compress(data) # zlib streams: the compressor that writes PNG
@@ -62,6 +65,8 @@ small.write_jpg("small.jpg", 80);
62
65
  std::vector<std::uint8_t> bytes = small.to_png(9);
63
66
 
64
67
  stb::font f = stb::font::open("font.ttf"); // cheap to copy, thread-safe
68
+ stb::image labeled = f.draw_text(img, "Hello", 32, 10, 10, stb::color("white"));
69
+ stb::image centred = f.draw_text(img, "Hello", 32, img.width() / 2, 10, stb::color(), stb::text_align::center);
65
70
  stb::text_bitmap t = f.render("Hello", 32);
66
71
  stb::text_size est = stb::estimate_text("Hello", 16); // no font file needed
67
72
 
@@ -20,10 +20,10 @@ cmake --build build --target stb_benchmark
20
20
 
21
21
  That's the one target you need: it pulls in every benchmark, in the
22
22
  right dependency order, and finishes by writing
23
- **`outputs/index.html`**: a single, standalone HTML file (Chart.js
24
- and every raw JSON result are embedded in it) with a "download JSON"
25
- button per dataset. Open it in a browser; nothing else is required:
26
- no server, no network, no sibling files.
23
+ **`outputs/index.html`**: a single HTML file (every raw JSON result
24
+ is embedded in it) with a "download JSON" button per dataset. Chart.js
25
+ and KaTeX load from cdnjs at fixed versions, so open it in a browser
26
+ with network access; no server and no sibling files are needed.
27
27
 
28
28
  Two folders, nothing else is ever written (the same layout as
29
29
  [novasvg's benchmarks](https://github.com/MohammadRaziei/novasvg/tree/master/benchmarks)):
@@ -244,8 +244,8 @@ operation.
244
244
  pre-installed into your system Python)
245
245
  - A C++17 compiler (libstb is built from source into the venv)
246
246
  - Internet access (competitors + libstb from PyPI/GitHub, the real
247
- photographs, a real TrueType font, and Chart.js are all fetched at
248
- build time: nothing is vendored in this repository). Every download
247
+ photographs and a real TrueType font are all fetched at build time:
248
+ nothing is vendored in this repository). Every download
249
249
  of a corpus file is best-effort: if one fails, the suite continues on
250
250
  what it has, and without the font it skips the font benchmark.
251
251
 
@@ -262,9 +262,9 @@ averaged across entries, ratio-then-average and not
262
262
  average-then-ratio.
263
263
 
264
264
  The report writes these definitions as LaTeX formulas (inline, between `\(` and `\)`) and renders
265
- them in the browser with KaTeX. KaTeX is fetched from the npm registry at build time, like Chart.js,
266
- and inlined together with the eight fonts it needs, so `index.html` is still one self-contained
267
- file. Without KaTeX the formulas show as their LaTeX source.
265
+ them in the browser with KaTeX. KaTeX and Chart.js are linked from cdnjs (the versions are
266
+ `CHARTJS_URL` and `KATEX_BASE` in `report/generate_report.py`), so `index.html` stays small. Offline,
267
+ the charts do not draw and the formulas show as their LaTeX source.
268
268
 
269
269
  ```
270
270
  E[time_x / time_ref] = mean( time_x_i / time_ref_i for each corpus entry i )