texlive[75046] Build/source/libs: harfbuzz 11.2.0
commits+kakuto at tug.org
commits+kakuto at tug.org
Tue Apr 29 01:16:31 CEST 2025
Revision: 75046
https://tug.org/svn/texlive?view=revision&revision=75046
Author: kakuto
Date: 2025-04-29 01:16:31 +0200 (Tue, 29 Apr 2025)
Log Message:
-----------
harfbuzz 11.2.0
Modified Paths:
--------------
trunk/Build/source/libs/README
trunk/Build/source/libs/harfbuzz/ChangeLog
trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog
trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes
trunk/Build/source/libs/harfbuzz/configure
trunk/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt
trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/CBDT/CBDT.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/COLR/COLR.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/sbix/sbix.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/svg/svg.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/GPOS.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/fontations/lib.rs
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-subset.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo-utils.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext-font.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite-font.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.h
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft-colr.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shaper-arabic.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-extents.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.h
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.hh
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/meson.build
trunk/Build/source/libs/harfbuzz/version.ac
Added Paths:
-----------
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.cc
trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.hh
Modified: trunk/Build/source/libs/README
===================================================================
--- trunk/Build/source/libs/README 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/README 2025-04-28 23:16:31 UTC (rev 75046)
@@ -28,7 +28,7 @@
https://sourceforge.net/projects/silgraphite/files/graphite2/
(requires C++11)
-harfbuzz 11.1.0 - checked 17apr25
+harfbuzz 11.2.0 - checked 29apr25
https://github.com/harfbuzz/harfbuzz/releases/latest
icu 76.1 - checked 27oct24 (requires C++17, e.g., g++13)
Modified: trunk/Build/source/libs/harfbuzz/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/ChangeLog 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/ChangeLog 2025-04-28 23:16:31 UTC (rev 75046)
@@ -1,3 +1,8 @@
+2025-04-29 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import harfbuzz-11.2.0.
+ * version.ac: Adjusted.
+
2025-04-17 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Import harfbuzz-11.1.0.
Modified: trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog 2025-04-28 23:16:31 UTC (rev 75046)
@@ -1,3 +1,8 @@
+2025-04-29 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Imported harfbuzz-11.2.0 source tree from:
+ https://github.com/harfbuzz/harfbuzz/releases/download/11.2.0/
+
2025-04-17 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Imported harfbuzz-11.1.0 source tree from:
Modified: trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes
===================================================================
--- trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes 2025-04-28 23:16:31 UTC (rev 75046)
@@ -1,5 +1,5 @@
-Changes applied to the harfbuzz-11.1.0/ tree as obtained from:
- https://github.com/harfbuzz/harfbuzz/releases/download/11.1.0/
+Changes applied to the harfbuzz-11.2.0/ tree as obtained from:
+ https://github.com/harfbuzz/harfbuzz/releases/download/11.2.0/
Removed:
.clang-format
Modified: trunk/Build/source/libs/harfbuzz/configure
===================================================================
--- trunk/Build/source/libs/harfbuzz/configure 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/configure 2025-04-28 23:16:31 UTC (rev 75046)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for harfbuzz (TeX Live) 11.1.0.
+# Generated by GNU Autoconf 2.72 for harfbuzz (TeX Live) 11.2.0.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -604,8 +604,8 @@
# Identity of this package.
PACKAGE_NAME='harfbuzz (TeX Live)'
PACKAGE_TARNAME='harfbuzz--tex-live-'
-PACKAGE_VERSION='11.1.0'
-PACKAGE_STRING='harfbuzz (TeX Live) 11.1.0'
+PACKAGE_VERSION='11.2.0'
+PACKAGE_STRING='harfbuzz (TeX Live) 11.2.0'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1341,7 +1341,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures harfbuzz (TeX Live) 11.1.0 to adapt to many kinds of systems.
+'configure' configures harfbuzz (TeX Live) 11.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1413,7 +1413,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of harfbuzz (TeX Live) 11.1.0:";;
+ short | recursive ) echo "Configuration of harfbuzz (TeX Live) 11.2.0:";;
esac
cat <<\_ACEOF
@@ -1518,7 +1518,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-harfbuzz (TeX Live) configure 11.1.0
+harfbuzz (TeX Live) configure 11.2.0
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2075,7 +2075,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by harfbuzz (TeX Live) $as_me 11.1.0, which was
+It was created by harfbuzz (TeX Live) $as_me 11.2.0, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -5252,7 +5252,7 @@
# Define the identity of the package.
PACKAGE='harfbuzz--tex-live-'
- VERSION='11.1.0'
+ VERSION='11.2.0'
# Some tools Automake needs.
@@ -5441,9 +5441,9 @@
HB_VERSION_MAJOR=11
-HB_VERSION_MINOR=1
+HB_VERSION_MINOR=2
HB_VERSION_MICRO=0
-HB_VERSION=11.1.0
+HB_VERSION=11.2.0
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -9292,7 +9292,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by harfbuzz (TeX Live) $as_me 11.1.0, which was
+This file was extended by harfbuzz (TeX Live) $as_me 11.2.0, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9360,7 +9360,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-harfbuzz (TeX Live) config.status 11.1.0
+harfbuzz (TeX Live) config.status 11.2.0
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/CMakeLists.txt 2025-04-28 23:16:31 UTC (rev 75046)
@@ -161,7 +161,9 @@
${PROJECT_SOURCE_DIR}/src/hb-subset-accelerator.hh
${PROJECT_SOURCE_DIR}/src/hb-subset-plan.cc
${PROJECT_SOURCE_DIR}/src/hb-subset-plan.hh
+ ${PROJECT_SOURCE_DIR}/src/hb-subset-plan-layout.cc
${PROJECT_SOURCE_DIR}/src/hb-subset-plan-member-list.hh
+ ${PROJECT_SOURCE_DIR}/src/hb-subset-plan-var.cc
${PROJECT_SOURCE_DIR}/src/hb-subset-serialize.cc
${PROJECT_SOURCE_DIR}/src/hb-subset.cc
${PROJECT_SOURCE_DIR}/src/hb-subset.hh
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS 2025-04-28 23:16:31 UTC (rev 75046)
@@ -1,5 +1,28 @@
+Overview of changes leading to 11.2.0
+Monday, April 28, 2025
+====================================
+- Painting of COLRv1 fonts without clip boxes is now about 10 times faster.
+- Synthetic bold/slant of a sub font is now respected, instead of using the parent’s.
+- Glyph extents for fonts synthetic bold/slant are now accurately calculated.
+- Various build fixes
+
+- New API:
+ +hb_font_is_synthetic()
+ +hb_font_draw_glyph_or_fail_func_t
+ +hb_font_paint_glyph_or_fail_func_t
+ +hb_font_funcs_set_draw_glyph_or_fail_func()
+ +hb_font_funcs_set_paint_glyph_or_fail_func()
+ +hb_font_draw_glyph_or_fail()
+ +hb_font_paint_glyph_or_fail()
+
+- Deprecated API:
+ -hb_font_draw_glyph_func_t
+ -hb_font_paint_glyph_func_t
+ -hb_font_funcs_set_draw_glyph_func()
+ -hb_font_funcs_set_paint_glyph_func()
+
Overview of changes leading to 11.1.0
-Wednesdat, April 16, 2025
+Wednesday, April 16, 2025
====================================
- Include bidi mirroring variants of the requested codepoints when subsetting.
The new HB_SUBSET_FLAGS_NO_BIDI_CLOSURE can be used to disable this
@@ -8,8 +31,8 @@
- Various build fixes and improvements.
- Various test suite improvements.
-New API:
-+HB_SUBSET_FLAGS_NO_BIDI_CLOSURE
+- New API:
+ +HB_SUBSET_FLAGS_NO_BIDI_CLOSURE
Overview of changes leading to 11.0.1
@@ -76,32 +99,32 @@
- Various bug fixes and other improvements.
- New API:
-+hb_malloc
-+hb_calloc
-+hb_realloc
-+hb_free
-+hb_face_list_loaders
-+hb_face_create_or_fail_using
-+hb_face_create_from_file_or_fail_using
-+hb_font_list_funcs
-+hb_font_set_funcs_using
-+hb_coretext_face_create_from_blob_or_fail
-+hb_directwrite_face_create_from_file_or_fail
-+hb_directwrite_face_create_from_blob_or_fail
-+hb_directwrite_font_create
-+hb_directwrite_font_get_dw_font_face
-+hb_directwrite_font_set_funcs
-+hb_fontations_font_set_funcs
-+hb_ft_face_create_from_blob_or_fail
-+hb_paint_push_font_transform
-+hb_paint_push_inverse_font_transform
-+HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES
-+HB_BUFFER_CLUSTER_LEVEL_IS_MONOTONE
-+HB_BUFFER_CLUSTER_LEVEL_IS_GRAPHEMES
-+HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS
+ +hb_malloc()
+ +hb_calloc()
+ +hb_realloc()
+ +hb_free()
+ +hb_face_list_loaders()
+ +hb_face_create_or_fail_using()
+ +hb_face_create_from_file_or_fail_using()
+ +hb_font_list_funcs()
+ +hb_font_set_funcs_using()
+ +hb_coretext_face_create_from_blob_or_fail()
+ +hb_directwrite_face_create_from_file_or_fail()
+ +hb_directwrite_face_create_from_blob_or_fail()
+ +hb_directwrite_font_create()
+ +hb_directwrite_font_get_dw_font_face()
+ +hb_directwrite_font_set_funcs()
+ +hb_fontations_font_set_funcs()
+ +hb_ft_face_create_from_blob_or_fail()
+ +hb_paint_push_font_transform()
+ +hb_paint_push_inverse_font_transform()
+ +HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES
+ +HB_BUFFER_CLUSTER_LEVEL_IS_MONOTONE
+ +HB_BUFFER_CLUSTER_LEVEL_IS_GRAPHEMES
+ +HB_BUFFER_CLUSTER_LEVEL_IS_CHARACTERS
- Deprecated API:
-+hb_directwrite_font_get_dw_font
+ -hb_directwrite_font_get_dw_font()
Overview of changes leading to 10.4.0
@@ -116,12 +139,12 @@
- Various build and fuzzing fixes.
- New API:
-+hb_directwrite_face_get_dw_font_face()
-+hb_ft_font_get_ft_face()
+ +hb_directwrite_face_get_dw_font_face()
+ +hb_ft_font_get_ft_face()
- Deprecated API:
-+hb_directwrite_face_get_font_face()
-+hb_ft_font_get_face()
+ -hb_directwrite_face_get_font_face()
+ -hb_ft_font_get_face()
Overview of changes leading to 10.3.0
@@ -161,9 +184,9 @@
variations.
- New API:
-+hb_directwrite_font_create()
-+hb_directwrite_font_get_dw_font()
-+hb_ot_shape_plan_get_feature_tags()
+ +hb_directwrite_font_create()
+ +hb_directwrite_font_get_dw_font()
+ +hb_ot_shape_plan_get_feature_tags()
Overview of changes leading to 10.2.0
@@ -188,11 +211,11 @@
- Various subsetter and instancer fixes.
- New API:
-+hb_subset_serialize_link_t
-+hb_subset_serialize_object_t
-+hb_subset_serialize_or_fail()
-+hb_subset_axis_range_from_string()
-+hb_subset_axis_range_to_string()
+ +hb_subset_serialize_link_t
+ +hb_subset_serialize_object_t
+ +hb_subset_serialize_or_fail()
+ +hb_subset_axis_range_from_string()
+ +hb_subset_axis_range_to_string()
Overview of changes leading to 10.1.0
@@ -212,11 +235,11 @@
- Various subsetter fixes.
- New API:
-+hb_face_create_or_fail()
-+hb_face_create_from_file_or_fail()
-+hb_coretext_face_create_from_file_or_fail()
-+hb_coretext_font_set_funcs()
-+hb_ft_face_create_from_file_or_fail()
+ +hb_face_create_or_fail()
+ +hb_face_create_from_file_or_fail()
+ +hb_coretext_face_create_from_file_or_fail()
+ +hb_coretext_font_set_funcs()
+ +hb_ft_face_create_from_file_or_fail()
Overview of changes leading to 10.0.1
Tuesday, September 24, 2024
@@ -259,17 +282,17 @@
- New API:
-+HB_SCRIPT_GARAY
-+HB_SCRIPT_GURUNG_KHEMA
-+HB_SCRIPT_KIRAT_RAI
-+HB_SCRIPT_OL_ONAL
-+HB_SCRIPT_SUNUWAR
-+HB_SCRIPT_TODHRI
-+HB_SCRIPT_TULU_TIGALARI
-+hb_buffer_set_not_found_variation_selector_glyph()
-+hb_buffer_get_not_found_variation_selector_glyph()
-+hb_get_table_tags_func_t
-+hb_face_set_get_table_tags_func()
+ +HB_SCRIPT_GARAY
+ +HB_SCRIPT_GURUNG_KHEMA
+ +HB_SCRIPT_KIRAT_RAI
+ +HB_SCRIPT_OL_ONAL
+ +HB_SCRIPT_SUNUWAR
+ +HB_SCRIPT_TODHRI
+ +HB_SCRIPT_TULU_TIGALARI
+ +hb_buffer_set_not_found_variation_selector_glyph()
+ +hb_buffer_get_not_found_variation_selector_glyph()
+ +hb_get_table_tags_func_t
+ +hb_face_set_get_table_tags_func()
Overview of changes leading to 9.0.0
@@ -302,9 +325,9 @@
- Various subsetter and instancer fixes.
- New API:
-+HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS
-+hb_subset_input_get_axis_range()
-+hb_subset_input_pin_axis_location()
+ +HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS
+ +hb_subset_input_get_axis_range()
+ +hb_subset_input_pin_axis_location()
Overview of changes leading to 8.4.0
Saturday, March 29, 2024
@@ -351,10 +374,10 @@
tools. Old option is kept as an alias.
- New API:
-+HB_AAT_LAYOUT_FEATURE_TYPE_CURSIVE_CONNECTION
+ +HB_AAT_LAYOUT_FEATURE_TYPE_CURSIVE_CONNECTION
- Deprecated API:
-+HB_AAT_LAYOUT_FEATURE_TYPE_CURISVE_CONNECTION
+ -HB_AAT_LAYOUT_FEATURE_TYPE_CURISVE_CONNECTION
Overview of changes leading to 8.2.2
Wednesday, October 18, 2023
@@ -407,7 +430,7 @@
- 5% speed up in loading Roboto.
- New API:
-+hb_ot_layout_collect_features_map()
+ +hb_ot_layout_collect_features_map()
Overview of changes leading to 8.0.1
@@ -455,12 +478,12 @@
this feature define the macro to just inline.
- New API:
-+HB_CODEPOINT_INVALID
-+hb_ot_layout_get_baseline2()
-+hb_ot_layout_get_baseline_with_fallback2()
-+hb_ot_layout_get_font_extents()
-+hb_ot_layout_get_font_extents2()
-+hb_subset_input_set_axis_range()
+ +HB_CODEPOINT_INVALID
+ +hb_ot_layout_get_baseline2()
+ +hb_ot_layout_get_baseline_with_fallback2()
+ +hb_ot_layout_get_font_extents()
+ +hb_ot_layout_get_font_extents2()
+ +hb_subset_input_set_axis_range()
Overview of changes leading to 7.3.0
@@ -505,11 +528,11 @@
- Various documentation improvements. (Behdad Esfahbod, Josef Friedrich)
- New API:
-+HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE
-+HB_UNICODE_COMBINING_CLASS_CCC132
+ +HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE
+ +HB_UNICODE_COMBINING_CLASS_CCC132
- Deprecated API:
-+HB_UNICODE_COMBINING_CLASS_CCC133
+ -HB_UNICODE_COMBINING_CLASS_CCC133
Overview of changes leading to 7.1.0
@@ -559,104 +582,104 @@
Nirbheek Chauhan, Pedro J. Estébanez, Qunxin Liu, Sergei Trofimovich)
- New API:
-+HB_FONT_NO_VAR_NAMED_INSTANCE
-+HB_PAINT_IMAGE_FORMAT_BGRA
-+HB_PAINT_IMAGE_FORMAT_PNG
-+HB_PAINT_IMAGE_FORMAT_SVG
-+hb_cairo_font_face_create_for_face
-+hb_cairo_font_face_create_for_font
-+hb_cairo_font_face_get_face
-+hb_cairo_font_face_get_font
-+hb_cairo_font_face_get_scale_factor
-+hb_cairo_font_face_set_font_init_func
-+hb_cairo_font_face_set_scale_factor
-+hb_cairo_font_init_func_t
-+hb_cairo_glyphs_from_buffer
-+hb_cairo_scaled_font_get_font
-+hb_color_line_get_color_stops
-+hb_color_line_get_color_stops_func_t
-+hb_color_line_get_extend
-+hb_color_line_get_extend_func_t
-+hb_color_line_t
-+hb_color_stop_t
-+hb_draw_funcs_get_empty
-+hb_draw_funcs_get_user_data
-+hb_draw_funcs_set_user_data
-+hb_face_collect_nominal_glyph_mapping
-+hb_font_draw_glyph
-+hb_font_draw_glyph_func_t
-+hb_font_funcs_set_draw_glyph_func
-+hb_font_funcs_set_paint_glyph_func
-+hb_font_get_synthetic_bold
-+hb_font_get_var_named_instance
-+hb_font_paint_glyph
-+hb_font_paint_glyph_func_t
-+hb_font_set_synthetic_bold
-+hb_map_keys
-+hb_map_next
-+hb_map_update
-+hb_map_values
-+hb_ot_color_glyph_has_paint
-+hb_ot_color_has_paint
-+hb_ot_layout_script_select_language2
-+hb_ot_name_id_predefined_t
-+hb_paint_color
-+hb_paint_color_func_t
-+hb_paint_composite_mode_t
-+hb_paint_custom_palette_color
-+hb_paint_custom_palette_color_func_t
-+hb_paint_extend_t
-+hb_paint_funcs_create
-+hb_paint_funcs_destroy
-+hb_paint_funcs_get_empty
-+hb_paint_funcs_get_user_data
-+hb_paint_funcs_is_immutable
-+hb_paint_funcs_make_immutable
-+hb_paint_funcs_reference
-+hb_paint_funcs_set_color_func
-+hb_paint_funcs_set_custom_palette_color_func
-+hb_paint_funcs_set_image_func
-+hb_paint_funcs_set_linear_gradient_func
-+hb_paint_funcs_set_pop_clip_func
-+hb_paint_funcs_set_pop_group_func
-+hb_paint_funcs_set_pop_transform_func
-+hb_paint_funcs_set_push_clip_glyph_func
-+hb_paint_funcs_set_push_clip_rectangle_func
-+hb_paint_funcs_set_push_group_func
-+hb_paint_funcs_set_push_transform_func
-+hb_paint_funcs_set_radial_gradient_func
-+hb_paint_funcs_set_sweep_gradient_func
-+hb_paint_funcs_set_user_data
-+hb_paint_funcs_t
-+hb_paint_image
-+hb_paint_image_func_t
-+hb_paint_linear_gradient
-+hb_paint_linear_gradient_func_t
-+hb_paint_pop_clip
-+hb_paint_pop_clip_func_t
-+hb_paint_pop_group
-+hb_paint_pop_group_func_t
-+hb_paint_pop_transform
-+hb_paint_pop_transform_func_t
-+hb_paint_push_clip_glyph
-+hb_paint_push_clip_glyph_func_t
-+hb_paint_push_clip_rectangle
-+hb_paint_push_clip_rectangle_func_t
-+hb_paint_push_group
-+hb_paint_push_group_func_t
-+hb_paint_push_transform
-+hb_paint_push_transform_func_t
-+hb_paint_radial_gradient
-+hb_paint_radial_gradient_func_t
-+hb_paint_sweep_gradient
-+hb_paint_sweep_gradient_func_t
-+hb_set_is_inverted
-+hb_subset_input_keep_everything
+ +HB_FONT_NO_VAR_NAMED_INSTANCE
+ +HB_PAINT_IMAGE_FORMAT_BGRA
+ +HB_PAINT_IMAGE_FORMAT_PNG
+ +HB_PAINT_IMAGE_FORMAT_SVG
+ +hb_cairo_font_face_create_for_face
+ +hb_cairo_font_face_create_for_font
+ +hb_cairo_font_face_get_face
+ +hb_cairo_font_face_get_font
+ +hb_cairo_font_face_get_scale_factor
+ +hb_cairo_font_face_set_font_init_func
+ +hb_cairo_font_face_set_scale_factor
+ +hb_cairo_font_init_func_t
+ +hb_cairo_glyphs_from_buffer
+ +hb_cairo_scaled_font_get_font
+ +hb_color_line_get_color_stops
+ +hb_color_line_get_color_stops_func_t
+ +hb_color_line_get_extend
+ +hb_color_line_get_extend_func_t
+ +hb_color_line_t
+ +hb_color_stop_t
+ +hb_draw_funcs_get_empty
+ +hb_draw_funcs_get_user_data
+ +hb_draw_funcs_set_user_data
+ +hb_face_collect_nominal_glyph_mapping
+ +hb_font_draw_glyph
+ +hb_font_draw_glyph_func_t
+ +hb_font_funcs_set_draw_glyph_func
+ +hb_font_funcs_set_paint_glyph_func
+ +hb_font_get_synthetic_bold
+ +hb_font_get_var_named_instance
+ +hb_font_paint_glyph
+ +hb_font_paint_glyph_func_t
+ +hb_font_set_synthetic_bold
+ +hb_map_keys
+ +hb_map_next
+ +hb_map_update
+ +hb_map_values
+ +hb_ot_color_glyph_has_paint
+ +hb_ot_color_has_paint
+ +hb_ot_layout_script_select_language2
+ +hb_ot_name_id_predefined_t
+ +hb_paint_color
+ +hb_paint_color_func_t
+ +hb_paint_composite_mode_t
+ +hb_paint_custom_palette_color
+ +hb_paint_custom_palette_color_func_t
+ +hb_paint_extend_t
+ +hb_paint_funcs_create
+ +hb_paint_funcs_destroy
+ +hb_paint_funcs_get_empty
+ +hb_paint_funcs_get_user_data
+ +hb_paint_funcs_is_immutable
+ +hb_paint_funcs_make_immutable
+ +hb_paint_funcs_reference
+ +hb_paint_funcs_set_color_func
+ +hb_paint_funcs_set_custom_palette_color_func
+ +hb_paint_funcs_set_image_func
+ +hb_paint_funcs_set_linear_gradient_func
+ +hb_paint_funcs_set_pop_clip_func
+ +hb_paint_funcs_set_pop_group_func
+ +hb_paint_funcs_set_pop_transform_func
+ +hb_paint_funcs_set_push_clip_glyph_func
+ +hb_paint_funcs_set_push_clip_rectangle_func
+ +hb_paint_funcs_set_push_group_func
+ +hb_paint_funcs_set_push_transform_func
+ +hb_paint_funcs_set_radial_gradient_func
+ +hb_paint_funcs_set_sweep_gradient_func
+ +hb_paint_funcs_set_user_data
+ +hb_paint_funcs_t
+ +hb_paint_image
+ +hb_paint_image_func_t
+ +hb_paint_linear_gradient
+ +hb_paint_linear_gradient_func_t
+ +hb_paint_pop_clip
+ +hb_paint_pop_clip_func_t
+ +hb_paint_pop_group
+ +hb_paint_pop_group_func_t
+ +hb_paint_pop_transform
+ +hb_paint_pop_transform_func_t
+ +hb_paint_push_clip_glyph
+ +hb_paint_push_clip_glyph_func_t
+ +hb_paint_push_clip_rectangle
+ +hb_paint_push_clip_rectangle_func_t
+ +hb_paint_push_group
+ +hb_paint_push_group_func_t
+ +hb_paint_push_transform
+ +hb_paint_push_transform_func_t
+ +hb_paint_radial_gradient
+ +hb_paint_radial_gradient_func_t
+ +hb_paint_sweep_gradient
+ +hb_paint_sweep_gradient_func_t
+ +hb_set_is_inverted
+ +hb_subset_input_keep_everything
- Deprecated API:
-+hb_font_funcs_set_glyph_shape_func
-+hb_font_get_glyph_shape_func_t
-+hb_font_get_glyph_shape
+ -hb_font_funcs_set_glyph_shape_func
+ -hb_font_get_glyph_shape_func_t
+ -hb_font_get_glyph_shape
Overview of changes leading to 6.0.0
@@ -716,9 +739,9 @@
- New API
-+hb_subset_input_pin_axis_location()
-+hb_subset_input_pin_axis_to_default()
-+hb_subset_preprocess()
+ +hb_subset_input_pin_axis_location()
+ +hb_subset_input_pin_axis_to_default()
+ +hb_subset_preprocess()
Overview of changes leading to 5.3.1
@@ -764,8 +787,8 @@
- Fix FreeType and ICU dependency lookup with meson. (Xavier Claessens)
- New API:
-+HB_SCRIPT_KAWI
-+HB_SCRIPT_NAG_MUNDARI
+ +HB_SCRIPT_KAWI
+ +HB_SCRIPT_NAG_MUNDARI
Overview of changes leading to 5.1.0
@@ -780,8 +803,8 @@
- Add “--safe-to-insert-tatweel” to “hb-shape” tool. (Behdad Esfahbod)
- New API
-+HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL
-+HB_BUFFER_FLAG_PRODUCE_SAFE_TO_INSERT_TATWEEL
+ +HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL
+ +HB_BUFFER_FLAG_PRODUCE_SAFE_TO_INSERT_TATWEEL
Overview of changes leading to 5.0.1
@@ -827,8 +850,8 @@
of hb-subset library, similar to harfbuzz.cc. (Khaled Hosny)
- New API
-+HB_SUBSET_SETS_LAYOUT_SCRIPT_TAG
-+hb_language_matches()
+ +HB_SUBSET_SETS_LAYOUT_SCRIPT_TAG
+ +hb_language_matches()
Overview of changes leading to 4.4.1
@@ -862,14 +885,14 @@
- Add 32 bit var store support to the subsetter. (Garret Rieger)
- New API
-+HB_BUFFER_FLAG_DEFINED
-+HB_BUFFER_SERIALIZE_FLAG_DEFINED
-+hb_font_changed()
-+hb_font_get_serial()
-+hb_ft_hb_font_changed()
-+hb_set_hash()
-+hb_map_copy()
-+hb_map_hash()
+ +HB_BUFFER_FLAG_DEFINED
+ +HB_BUFFER_SERIALIZE_FLAG_DEFINED
+ +hb_font_changed()
+ +hb_font_get_serial()
+ +hb_ft_hb_font_changed()
+ +hb_set_hash()
+ +hb_map_copy()
+ +hb_map_hash()
Overview of changes leading to 4.3.0
@@ -886,7 +909,7 @@
- Fix subsetting CPAL table with partial palette overlaps. (Garret Rieger)
- New API
-+hb_map_is_equal() (Behdad Esfahbod)
+ +hb_map_is_equal() (Behdad Esfahbod)
Overview of changes leading to 4.2.1
@@ -917,7 +940,7 @@
- Various build fixes. (Chun-wei Fan, Khaled Hosny)
- New API
-+hb_set_next_many() (Andrew John)
+ +hb_set_next_many() (Andrew John)
Overview of changes leading to 4.1.0
@@ -932,7 +955,7 @@
- Various bug fixes.
- New API
-+hb_set_add_sorted_array() (Andrew John)
+ +hb_set_add_sorted_array() (Andrew John)
Overview of changes leading to 4.0.1
@@ -950,9 +973,9 @@
built with experimental APIs enabled. (Qunxin Liu)
- New experimental API
-+hb_link_t
-+hb_object_t
-+hb_subset_repack_or_fail()
+ +hb_link_t
+ +hb_object_t
+ +hb_subset_repack_or_fail()
Overview of changes leading to 4.0.0
@@ -1061,14 +1084,14 @@
pointer. (Behdad Esfahbod)
- New API:
-+HB_BUFFER_FLAG_VERIFY
-+HB_OT_TAG_MATH_SCRIPT
-+HB_SCRIPT_MATH
-+hb_ot_math_kern_entry_t
-+hb_ot_math_get_glyph_kernings()
+ +HB_BUFFER_FLAG_VERIFY
+ +HB_OT_TAG_MATH_SCRIPT
+ +HB_SCRIPT_MATH
+ +hb_ot_math_kern_entry_t
+ +hb_ot_math_get_glyph_kernings()
- Deprecated API
-+HB_OT_MATH_SCRIPT
+ -HB_OT_MATH_SCRIPT
Overview of changes leading to 3.3.2
@@ -1108,12 +1131,12 @@
tags. (David Corbett)
- New API:
-+HB_GLYPH_FLAG_UNSAFE_TO_CONCAT
-+hb_segment_properties_overlay()
-+hb_buffer_create_similar()
-+hb_font_set_synthetic_slant()
-+hb_font_get_synthetic_slant()
-+hb_font_get_var_coords_design()
+ +HB_GLYPH_FLAG_UNSAFE_TO_CONCAT
+ +hb_segment_properties_overlay()
+ +hb_buffer_create_similar()
+ +hb_font_set_synthetic_slant()
+ +hb_font_get_synthetic_slant()
+ +hb_font_get_var_coords_design()
Overview of changes leading to 3.2.0
@@ -1164,8 +1187,8 @@
- Build and documentation fixes.
- New API:
-+hb_buffer_set_not_found_glyph()
-+hb_buffer_get_not_found_glyph()
+ +hb_buffer_set_not_found_glyph()
+ +hb_buffer_get_not_found_glyph()
Overview of changes leading to 3.0.0
@@ -1179,44 +1202,44 @@
- The hb-style API is now stable and no longer experimental.
- New API:
-+hb_style_tag_t
-+hb_style_get_value()
-+hb_subset_input_t
-+hb_subset_flags_t
-+hb_subset_sets_t
-+hb_subset_input_create_or_fail()
-+hb_subset_input_reference()
-+hb_subset_input_destroy()
-+hb_subset_input_set_user_data()
-+hb_subset_input_get_user_data()
-+hb_subset_input_unicode_set()
-+hb_subset_input_glyph_set()
-+hb_subset_input_set()
-+hb_subset_input_get_flags()
-+hb_subset_input_set_flags()
-+hb_subset_or_fail()
+ +hb_style_tag_t
+ +hb_style_get_value()
+ +hb_subset_input_t
+ +hb_subset_flags_t
+ +hb_subset_sets_t
+ +hb_subset_input_create_or_fail()
+ +hb_subset_input_reference()
+ +hb_subset_input_destroy()
+ +hb_subset_input_set_user_data()
+ +hb_subset_input_get_user_data()
+ +hb_subset_input_unicode_set()
+ +hb_subset_input_glyph_set()
+ +hb_subset_input_set()
+ +hb_subset_input_get_flags()
+ +hb_subset_input_set_flags()
+ +hb_subset_or_fail()
- Removed old unstable harfbuzz-subset API:
--hb_subset_input_nameid_set()
--hb_subset_input_namelangid_set()
--hb_subset_input_layout_features_set()
--hb_subset_input_no_subset_tables_set()
--hb_subset_input_drop_tables_set()
--hb_subset_input_set_drop_hints()
--hb_subset_input_get_drop_hints()
--hb_subset_input_set_desubroutinize()
--hb_subset_input_get_desubroutinize()
--hb_subset_input_set_retain_gids()
--hb_subset_input_get_retain_gids()
--hb_subset_input_set_name_legacy()
--hb_subset_input_get_name_legacy()
--hb_subset_input_set_overlaps_flag()
--hb_subset_input_get_overlaps_flag()
--hb_subset_input_set_notdef_outline()
--hb_subset_input_get_notdef_outline()
--hb_subset_input_set_no_prune_unicode_ranges()
--hb_subset_input_get_no_prune_unicode_ranges()
--hb_subset()
+ -hb_subset_input_nameid_set()
+ -hb_subset_input_namelangid_set()
+ -hb_subset_input_layout_features_set()
+ -hb_subset_input_no_subset_tables_set()
+ -hb_subset_input_drop_tables_set()
+ -hb_subset_input_set_drop_hints()
+ -hb_subset_input_get_drop_hints()
+ -hb_subset_input_set_desubroutinize()
+ -hb_subset_input_get_desubroutinize()
+ -hb_subset_input_set_retain_gids()
+ -hb_subset_input_get_retain_gids()
+ -hb_subset_input_set_name_legacy()
+ -hb_subset_input_get_name_legacy()
+ -hb_subset_input_set_overlaps_flag()
+ -hb_subset_input_get_overlaps_flag()
+ -hb_subset_input_set_notdef_outline()
+ -hb_subset_input_get_notdef_outline()
+ -hb_subset_input_set_no_prune_unicode_ranges()
+ -hb_subset_input_get_no_prune_unicode_ranges()
+ -hb_subset()
Overview of changes leading to 2.9.1
@@ -1231,8 +1254,9 @@
- hb-view / hb-shape now accept following new arguments:
o --unicodes-before/after: takes a list of hex numbers that represent Unicode
codepoints.
+
- Undeprecated API:
- hb_set_invert()
+ +hb_set_invert()
Overview of changes leading to 2.9.0
@@ -1267,10 +1291,11 @@
- When applying morx table, mark glyph widths should not be zeroed. (Jonathan Kew)
- GPOS is preferred over kerx, if GSUB was applied. (Behdad)
- Regional_Indicator pairs are grouped together when clustering. (Behdad)
+
- New API:
-+hb_blob_create_or_fail()
-+hb_blob_create_from_file_or_fail()
-+hb_set_copy()
+ +hb_blob_create_or_fail()
+ +hb_blob_create_from_file_or_fail()
+ +hb_set_copy()
Overview of changes leading to 2.8.1
@@ -1282,6 +1307,7 @@
- hb-view supports iTerm2 and kitty inline image protocols (Khaled Hosny),
it can also use Chafa for terminal graphics if available (Hans Petter Jansson).
+
Overview of changes leading to 2.8.0
Tuesday, March 16, 2021
====================================
@@ -1321,11 +1347,12 @@
- More OOM fixes.
- Improved documentation.
- Build system improvements.
+
- New API:
-+hb_buffer_has_positions()
-+hb_buffer_serialize()
-+hb_buffer_serialize_unicode()
-+hb_buffer_deserialize_unicode()
+ +hb_buffer_has_positions()
+ +hb_buffer_serialize()
+ +hb_buffer_serialize_unicode()
+ +hb_buffer_deserialize_unicode()
Overview of changes leading to 2.7.2
@@ -1373,8 +1400,9 @@
it and give us feedback.
Autotools is still our main build system however please consider
experimenting with meson also for packaging the library.
+
- New API:
-+hb_ot_layout_lookup_get_glyph_alternates()
+ +hb_ot_layout_lookup_get_glyph_alternates()
Overview of changes leading to 2.6.7
@@ -1404,9 +1432,10 @@
- AAT is now always preferred for horizontal scripts when both AAT and OT
layout tables exist at the same time.
- Subsetter improvements.
+
- New API:
-+hb_ft_font_lock_face()
-+hb_ft_font_unlock_face()
+ +hb_ft_font_lock_face()
+ +hb_ft_font_unlock_face()
Overview of changes leading to 2.6.4
@@ -1420,8 +1449,9 @@
Monday, October 28, 2019
====================================
- Misc small fixes, mostly to build-related issues.
+
- New API:
-+hb_font_get_nominal_glyphs()
+ +hb_font_get_nominal_glyphs()
Overview of changes leading to 2.6.2
@@ -1449,19 +1479,20 @@
- New hb-gdi.h header and API for creating hb_face_t from HFONT.
- Amalgam: Provide a single-file harfbuzz.cc file for easier alternate building.
- More size-reduction configurable options, enabled by HB_TINY.
+
- New API:
-+hb_font_set_var_named_instance()
-+hb_gdi_face_create()
-+hb_ot_layout_baseline_tag_t
-+hb_ot_layout_get_baseline()
-+hb_ot_meta_tag_t
-+hb_ot_meta_get_entry_tags()
-+hb_ot_meta_reference_entry()
-+hb_ot_metrics_tag_t
-+hb_ot_metrics_get_position()
-+hb_ot_metrics_get_variation()
-+hb_ot_metrics_get_x_variation()
-+hb_ot_metrics_get_y_variation()
+ +hb_font_set_var_named_instance()
+ +hb_gdi_face_create()
+ +hb_ot_layout_baseline_tag_t
+ +hb_ot_layout_get_baseline()
+ +hb_ot_meta_tag_t
+ +hb_ot_meta_get_entry_tags()
+ +hb_ot_meta_reference_entry()
+ +hb_ot_metrics_tag_t
+ +hb_ot_metrics_get_position()
+ +hb_ot_metrics_get_variation()
+ +hb_ot_metrics_get_x_variation()
+ +hb_ot_metrics_get_y_variation()
Overview of changes leading to 2.5.3
@@ -1514,9 +1545,10 @@
- Unicode 12.
- Misc fixes.
- Subsetter improvements.
+
- New API:
-HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE
-hb_directwrite_face_create()
+ +HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE
+ +hb_directwrite_face_create()
Overview of changes leading to 2.3.1
@@ -1535,10 +1567,10 @@
- Merge CFF / CFF2 support contributed by Adobe. This mostly involves
the subsetter, but also get_glyph_extents on CFF fonts.
-New API in hb-aat.h:
-+hb_aat_layout_has_substitution()
-+hb_aat_layout_has_positioning()
-+hb_aat_layout_has_tracking()
+- New API in hb-aat.h:
+ +hb_aat_layout_has_substitution()
+ +hb_aat_layout_has_positioning()
+ +hb_aat_layout_has_tracking()
Overview of changes leading to 2.2.0
@@ -1552,28 +1584,28 @@
o Implement 'feat' table API for feature detection.
o Blacklist 'GSUB' table of fonts from 'MUTF' foundry that also have 'morx'.
-New API:
-+hb_aat_layout_feature_type_t
-+hb_aat_layout_feature_selector_t
-+hb_aat_layout_get_feature_types()
-+hb_aat_layout_feature_type_get_name_id
-+hb_aat_layout_feature_selector_info_t
-+HB_AAT_LAYOUT_NO_SELECTOR_INDEX
-+hb_aat_layout_feature_type_get_selector_infos()
-+hb_ot_var_axis_flags_t
-+hb_ot_var_axis_info_t
-+hb_ot_var_get_axis_infos()
-+hb_ot_var_find_axis_info()
-+hb_ot_var_get_named_instance_count()
-+hb_ot_var_named_instance_get_subfamily_name_id()
-+hb_ot_var_named_instance_get_postscript_name_id()
-+hb_ot_var_named_instance_get_design_coords()
+- New API:
+ +hb_aat_layout_feature_type_t
+ +hb_aat_layout_feature_selector_t
+ +hb_aat_layout_get_feature_types()
+ +hb_aat_layout_feature_type_get_name_id
+ +hb_aat_layout_feature_selector_info_t
+ +HB_AAT_LAYOUT_NO_SELECTOR_INDEX
+ +hb_aat_layout_feature_type_get_selector_infos()
+ +hb_ot_var_axis_flags_t
+ +hb_ot_var_axis_info_t
+ +hb_ot_var_get_axis_infos()
+ +hb_ot_var_find_axis_info()
+ +hb_ot_var_get_named_instance_count()
+ +hb_ot_var_named_instance_get_subfamily_name_id()
+ +hb_ot_var_named_instance_get_postscript_name_id()
+ +hb_ot_var_named_instance_get_design_coords()
-Deprecated API:
-+HB_OT_VAR_NO_AXIS_INDEX
-+hb_ot_var_axis_t
-+hb_ot_var_get_axes()
-+hb_ot_var_find_axis()
+- Deprecated API:
+ -HB_OT_VAR_NO_AXIS_INDEX
+ -hb_ot_var_axis_t
+ -hb_ot_var_get_axes()
+ -hb_ot_var_find_axis()
Overview of changes leading to 2.1.3
@@ -1618,70 +1650,68 @@
in vertical layout.
- Various fuzzer-found bug fixes.
-Changed API:
+- Changed API:
+ A type and a macro added in 2.0.0 were renamed:
-A type and a macro added in 2.0.0 were renamed:
+ hb_name_id_t -> hb_ot_name_id_t
+ HB_NAME_ID_INVALID -> HB_OT_NAME_ID_INVALID
-hb_name_id_t -> hb_ot_name_id_t
-HB_NAME_ID_INVALID -> HB_OT_NAME_ID_INVALID
+- New API:
+ +hb_color_t
+ +HB_COLOR
+ +hb_color_get_alpha()
+ +hb_color_get_red()
+ +hb_color_get_green()
+ +hb_color_get_blue()
+ +hb_ot_color_has_palettes()
+ +hb_ot_color_palette_get_count()
+ +hb_ot_color_palette_get_name_id()
+ +hb_ot_color_palette_color_get_name_id()
+ +hb_ot_color_palette_flags_t
+ +hb_ot_color_palette_get_flags()
+ +hb_ot_color_palette_get_colors()
+ +hb_ot_color_has_layers()
+ +hb_ot_color_layer_t
+ +hb_ot_color_glyph_get_layers()
+ +hb_ot_color_has_svg()
+ +hb_ot_color_glyph_reference_svg()
+ +hb_ot_color_has_png()
+ +hb_ot_color_glyph_reference_png()
-New API:
+ +hb_ot_name_id_t
+ +HB_OT_NAME_ID_INVALID
+ +HB_OT_NAME_ID_COPYRIGHT
+ +HB_OT_NAME_ID_FONT_FAMILY
+ +HB_OT_NAME_ID_FONT_SUBFAMILY
+ +HB_OT_NAME_ID_UNIQUE_ID
+ +HB_OT_NAME_ID_FULL_NAME
+ +HB_OT_NAME_ID_VERSION_STRING
+ +HB_OT_NAME_ID_POSTSCRIPT_NAME
+ +HB_OT_NAME_ID_TRADEMARK
+ +HB_OT_NAME_ID_MANUFACTURER
+ +HB_OT_NAME_ID_DESIGNER
+ +HB_OT_NAME_ID_DESCRIPTION
+ +HB_OT_NAME_ID_VENDOR_URL
+ +HB_OT_NAME_ID_DESIGNER_URL
+ +HB_OT_NAME_ID_LICENSE
+ +HB_OT_NAME_ID_LICENSE_URL
+ +HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY
+ +HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
+ +HB_OT_NAME_ID_MAC_FULL_NAME
+ +HB_OT_NAME_ID_SAMPLE_TEXT
+ +HB_OT_NAME_ID_CID_FINDFONT_NAME
+ +HB_OT_NAME_ID_WWS_FAMILY
+ +HB_OT_NAME_ID_WWS_SUBFAMILY
+ +HB_OT_NAME_ID_LIGHT_BACKGROUND
+ +HB_OT_NAME_ID_DARK_BACKGROUND
+ +HB_OT_NAME_ID_VARIATIONS_PS_PREFIX
+ +hb_ot_name_entry_t
+ +hb_ot_name_list_names()
+ +hb_ot_name_get_utf8()
+ +hb_ot_name_get_utf16()
+ +hb_ot_name_get_utf32()
-+hb_color_t
-+HB_COLOR
-+hb_color_get_alpha()
-+hb_color_get_red()
-+hb_color_get_green()
-+hb_color_get_blue()
-+hb_ot_color_has_palettes()
-+hb_ot_color_palette_get_count()
-+hb_ot_color_palette_get_name_id()
-+hb_ot_color_palette_color_get_name_id()
-+hb_ot_color_palette_flags_t
-+hb_ot_color_palette_get_flags()
-+hb_ot_color_palette_get_colors()
-+hb_ot_color_has_layers()
-+hb_ot_color_layer_t
-+hb_ot_color_glyph_get_layers()
-+hb_ot_color_has_svg()
-+hb_ot_color_glyph_reference_svg()
-+hb_ot_color_has_png()
-+hb_ot_color_glyph_reference_png()
-+hb_ot_name_id_t
-+HB_OT_NAME_ID_INVALID
-+HB_OT_NAME_ID_COPYRIGHT
-+HB_OT_NAME_ID_FONT_FAMILY
-+HB_OT_NAME_ID_FONT_SUBFAMILY
-+HB_OT_NAME_ID_UNIQUE_ID
-+HB_OT_NAME_ID_FULL_NAME
-+HB_OT_NAME_ID_VERSION_STRING
-+HB_OT_NAME_ID_POSTSCRIPT_NAME
-+HB_OT_NAME_ID_TRADEMARK
-+HB_OT_NAME_ID_MANUFACTURER
-+HB_OT_NAME_ID_DESIGNER
-+HB_OT_NAME_ID_DESCRIPTION
-+HB_OT_NAME_ID_VENDOR_URL
-+HB_OT_NAME_ID_DESIGNER_URL
-+HB_OT_NAME_ID_LICENSE
-+HB_OT_NAME_ID_LICENSE_URL
-+HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY
-+HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
-+HB_OT_NAME_ID_MAC_FULL_NAME
-+HB_OT_NAME_ID_SAMPLE_TEXT
-+HB_OT_NAME_ID_CID_FINDFONT_NAME
-+HB_OT_NAME_ID_WWS_FAMILY
-+HB_OT_NAME_ID_WWS_SUBFAMILY
-+HB_OT_NAME_ID_LIGHT_BACKGROUND
-+HB_OT_NAME_ID_DARK_BACKGROUND
-+HB_OT_NAME_ID_VARIATIONS_PS_PREFIX
-+hb_ot_name_entry_t
-+hb_ot_name_list_names()
-+hb_ot_name_get_utf8()
-+hb_ot_name_get_utf16()
-+hb_ot_name_get_utf32()
-
-
Overview of changes leading to 2.0.2
Saturday, October 20, 2018
====================================
@@ -1733,40 +1763,40 @@
- New hb_font_funcs_set_nominal_glyphs_func() allows speeding
up character to glyph mapping.
-New API:
-+HB_FEATURE_GLOBAL_START
-+HB_FEATURE_GLOBAL_END
-+hb_buffer_set_invisible_glyph()
-+hb_buffer_get_invisible_glyph()
-+hb_font_funcs_set_nominal_glyphs_func()
-+hb_ot_layout_table_select_script()
-+hb_ot_layout_script_select_language()
-+hb_ot_layout_feature_get_name_ids()
-+hb_ot_layout_feature_get_characters()
-+hb_name_id_t
-+HB_NAME_ID_INVALID
-+HB_OT_MAX_TAGS_PER_SCRIPT
-+hb_ot_tags_from_script_and_language()
-+hb_ot_tags_to_script_and_language()
+- New API:
+ +HB_FEATURE_GLOBAL_START
+ +HB_FEATURE_GLOBAL_END
+ +hb_buffer_set_invisible_glyph()
+ +hb_buffer_get_invisible_glyph()
+ +hb_font_funcs_set_nominal_glyphs_func()
+ +hb_ot_layout_table_select_script()
+ +hb_ot_layout_script_select_language()
+ +hb_ot_layout_feature_get_name_ids()
+ +hb_ot_layout_feature_get_characters()
+ +hb_name_id_t
+ +HB_NAME_ID_INVALID
+ +HB_OT_MAX_TAGS_PER_SCRIPT
+ +hb_ot_tags_from_script_and_language()
+ +hb_ot_tags_to_script_and_language()
-Deprecated API:
--hb_font_funcs_set_glyph_func()
--hb_unicode_eastasian_width_func_t
--hb_unicode_funcs_set_eastasian_width_func()
--hb_unicode_eastasian_width()
--hb_unicode_decompose_compatibility_func_t
--HB_UNICODE_MAX_DECOMPOSITION_LEN
--hb_unicode_funcs_set_decompose_compatibility_func()
--hb_unicode_decompose_compatibility()
--hb_font_funcs_set_glyph_h_kerning_func()
--hb_font_funcs_set_glyph_v_kerning_func()
--hb_font_get_glyph_h_kerning()
--hb_font_get_glyph_v_kerning()
--hb_font_get_glyph_kerning_for_direction()
--hb_ot_layout_table_choose_script()
--hb_ot_layout_script_find_language()
--hb_ot_tags_from_script()
--hb_ot_tag_from_language()
+- Deprecated API:
+ -hb_font_funcs_set_glyph_func()
+ -hb_unicode_eastasian_width_func_t
+ -hb_unicode_funcs_set_eastasian_width_func()
+ -hb_unicode_eastasian_width()
+ -hb_unicode_decompose_compatibility_func_t
+ -HB_UNICODE_MAX_DECOMPOSITION_LEN
+ -hb_unicode_funcs_set_decompose_compatibility_func()
+ -hb_unicode_decompose_compatibility()
+ -hb_font_funcs_set_glyph_h_kerning_func()
+ -hb_font_funcs_set_glyph_v_kerning_func()
+ -hb_font_get_glyph_h_kerning()
+ -hb_font_get_glyph_v_kerning()
+ -hb_font_get_glyph_kerning_for_direction()
+ -hb_ot_layout_table_choose_script()
+ -hb_ot_layout_script_find_language()
+ -hb_ot_tags_from_script()
+ -hb_ot_tag_from_language()
Overview of changes leading to 1.9.0
@@ -1779,13 +1809,13 @@
- Internal source header file name changes:
hb-*-private.hh is renamed to hb-*.hh.
-New API:
-+HB_UNICODE_MAX
-+hb_face_collect_unicodes()
-+hb_face_collect_variation_selectors()
-+hb_face_collect_variation_unicodes()
-+hb_face_builder_create()
-+hb_face_builder_add_table()
+- New API:
+ +HB_UNICODE_MAX
+ +hb_face_collect_unicodes()
+ +hb_face_collect_variation_selectors()
+ +hb_face_collect_variation_unicodes()
+ +hb_face_builder_create()
+ +hb_face_builder_add_table()
Overview of changes leading to 1.8.8
@@ -1816,15 +1846,16 @@
Tuesday, August 7, 2018
====================================
- Internal code shuffling.
+
- New API to speed up getting advance widths for implementations
that have heavy overhead in get_h_advance callback:
-+hb_font_funcs_set_glyph_h_advances_func
-+hb_font_funcs_set_glyph_v_advances_func
-+hb_font_get_glyph_advances_for_direction
-+hb_font_get_glyph_h_advances
-+hb_font_get_glyph_h_advances_func_t
-+hb_font_get_glyph_v_advances
-+hb_font_get_glyph_v_advances_func_t
+ +hb_font_funcs_set_glyph_h_advances_func
+ +hb_font_funcs_set_glyph_v_advances_func
+ +hb_font_get_glyph_advances_for_direction
+ +hb_font_get_glyph_h_advances
+ +hb_font_get_glyph_h_advances_func_t
+ +hb_font_get_glyph_v_advances
+ +hb_font_get_glyph_v_advances_func_t
Overview of changes leading to 1.8.5
@@ -1883,50 +1914,49 @@
o New cpp macro HB_NO_ATEXIT
o New cpp macro HB_SUBSET_BUILTIN
- Significant libharfbuzz-subset changes. API subject to change.
+
- New API in libharfbuzz:
-+hb_blob_create_from_file()
-+hb_face_count()
+ +hb_blob_create_from_file()
+ +hb_face_count()
-A hashmap implementation:
-+hb-map.h
-+HB_MAP_VALUE_INVALID
-+hb_map_t
-+hb_map_create()
-+hb_map_get_empty()
-+hb_map_reference()
-+hb_map_destroy()
-+hb_map_set_user_data()
-+hb_map_get_user_data()
-+hb_map_allocation_successful()
-+hb_map_clear()
-+hb_map_is_empty()
-+hb_map_get_population()
-+hb_map_set()
-+hb_map_get()
-+hb_map_del()
-+hb_map_has()
+ A hashmap implementation:
+ +hb-map.h
+ +HB_MAP_VALUE_INVALID
+ +hb_map_t
+ +hb_map_create()
+ +hb_map_get_empty()
+ +hb_map_reference()
+ +hb_map_destroy()
+ +hb_map_set_user_data()
+ +hb_map_get_user_data()
+ +hb_map_allocation_successful()
+ +hb_map_clear()
+ +hb_map_is_empty()
+ +hb_map_get_population()
+ +hb_map_set()
+ +hb_map_get()
+ +hb_map_del()
+ +hb_map_has()
Overview of changes leading to 1.7.6
Wednesday, March 7, 2018
====================================
-
- Fix to hb_set_t binary operations. Ouch.
- New experimental harfbuzz-subset library. All of hb-subset.h
is experimental right now and API WILL change.
- New API:
-hb_blob_copy_writable_or_fail()
-HB_OT_TAG_BASE
-hb_set_previous()
-hb_set_previous_range()
+ +hb_blob_copy_writable_or_fail()
+ +HB_OT_TAG_BASE
+ +hb_set_previous()
+ +hb_set_previous_range()
Overview of changes leading to 1.7.5
Tuesday, January 30, 2018
====================================
-
- Separate Khmer shaper from Indic.
- First stab at AAT morx. Not hooked up.
- Misc bug fixes.
@@ -1935,7 +1965,6 @@
Overview of changes leading to 1.7.4
Wednesday, December 20, 2017
====================================
-
- Fix collect_glyphs() regression caused by hb_set_t changes.
@@ -1942,7 +1971,6 @@
Overview of changes leading to 1.7.3
Monday, December 18, 2017
====================================
-
- hb_set_t performance tuning and optimizations.
- Speed up collect_glyphs() and reject garbage data.
- In hb_coretext_font_create() set font point-size (ptem).
@@ -1952,17 +1980,16 @@
Overview of changes leading to 1.7.2
Monday, December 4, 2017
====================================
-
- Optimize hb_set_add_range().
- Misc fixes.
+
- New API:
-hb_coretext_font_create()
+ +hb_coretext_font_create()
Overview of changes leading to 1.7.1
Tuesday, November 14, 2017
====================================
-
- Fix atexit object destruction regression.
- Fix minor integer-overflow.
@@ -1970,7 +1997,6 @@
Overview of changes leading to 1.7.0
Monday, November 13, 2017
====================================
-
- Minor Indic fixes.
- Implement kerning and glyph names in hb-ot-font.
- Various DSO optimization re .data and .bss sizes.
@@ -1982,7 +2008,6 @@
Overview of changes leading to 1.6.3
Thursday, October 26th, 2017
====================================
-
- Fix hb_set_t some more. Should be solid now.
- Implement get_glyph_name() for hb-ot-font.
- Misc fixes.
@@ -2001,20 +2026,19 @@
Overview of changes leading to 1.6.1
Sunday, October 22nd, 2017
====================================
-
- Don't skip over COMBINING GRAPHEME JOINER when ligating, etc.
To be refined: https://github.com/harfbuzz/harfbuzz/issues/554
- Faster hb_set_t implementation.
- Don't use deprecated ICU API.
- Fix undefined-behavior in Myanmar shaper, introduced in 1.6.0
+
- Deprecated API:
- hb_set_invert()
+ -hb_set_invert()
Overview of changes leading to 1.6.0
Friday, October the 13th, 2017
====================================
-
- Update to Unicode 10.
- Various Indic and Universal Shaping Engine fixes as a result of
@@ -2039,17 +2063,16 @@
o --unicodes: takes a list of hex numbers that represent Unicode
codepoints.
-New API:
-+hb_face_get_table_tags()
-+hb_font_set_ptem()
-+hb_font_get_ptem()
-+hb_ft_font_changed()
+- New API:
+ +hb_face_get_table_tags()
+ +hb_font_set_ptem()
+ +hb_font_get_ptem()
+ +hb_ft_font_changed()
Overview of changes leading to 1.5.1
Tuesday, September 5, 2017
====================================
-
- Fix "unsafe-to-break" in fallback shaping and other corner cases.
All our tests pass with --verify now, meaning unsafe-to-break API
works as expected.
@@ -2062,7 +2085,6 @@
Overview of changes leading to 1.5.0
Wednesday, August 23, 2017
====================================
-
- Misc new API, for appending a buffer to another, and for comparing
contents of two buffers for types of differences.
@@ -2081,32 +2103,31 @@
- New API:
-hb_buffer_append()
+ +hb_buffer_append()
-hb_glyph_flags_t
-HB_GLYPH_FLAG_UNSAFE_TO_BREAK
-HB_GLYPH_FLAG_DEFINED
-hb_glyph_info_get_glyph_flags()
+ +hb_glyph_flags_t
+ +HB_GLYPH_FLAG_UNSAFE_TO_BREAK
+ +HB_GLYPH_FLAG_DEFINED
+ +hb_glyph_info_get_glyph_flags()
-HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS
+ +HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS
-hb_buffer_diff_flags_t
-HB_BUFFER_DIFF_FLAG_EQUAL
-HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH
-HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH
-HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT
-HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT
-HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH
-HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH
-HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH
-HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH
-hb_buffer_diff
+ +hb_buffer_diff_flags_t
+ +HB_BUFFER_DIFF_FLAG_EQUAL
+ +HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH
+ +HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH
+ +HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT
+ +HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT
+ +HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH
+ +HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH
+ +HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH
+ +HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH
+ +hb_buffer_diff
Overview of changes leading to 1.4.8
Tuesday, August 8, 2017
====================================
-
- Major fix to avar table handling.
- Rename hb-shape --show-message to --trace.
- Build fixes.
@@ -2115,7 +2136,6 @@
Overview of changes leading to 1.4.7
Tuesday, July 18, 2017
====================================
-
- Multiple Indic, Tibetan, and Cham fixes.
- CoreText: Allow disabling kerning.
- Adjust Arabic feature order again.
@@ -2125,7 +2145,6 @@
Overview of changes leading to 1.4.6
Sunday, April 23, 2017
====================================
-
- Graphite2: Fix RTL positioning issue.
- Backlist GDEF of more versions of Padauk and Tahoma.
- New, experimental, cmake alternative build system.
@@ -2134,7 +2153,6 @@
Overview of changes leading to 1.4.5
Friday, March 10, 2017
====================================
-
- Revert "Fix Context lookup application when moving back after a glyph..."
This introduced memory access problems. To be fixed properly soon.
@@ -2142,7 +2160,6 @@
Overview of changes leading to 1.4.4
Sunday, March 5, 2017
====================================
-
- Fix Context lookup application when moving back after a glyph deletion.
- Fix buffer-overrun in Bengali.
@@ -2150,40 +2167,40 @@
Overview of changes leading to 1.4.3
Saturday, February 25, 2017
====================================
-
- Route Adlam script to Arabic shaper.
- Misc fixes.
+
- New API:
- hb_font_set_face()
+ +hb_font_set_face()
+
- Deprecate API:
- hb_graphite2_font_get_gr_font()
+ -hb_graphite2_font_get_gr_font()
Overview of changes leading to 1.4.2
Monday, January 23, 2017
====================================
-
- Implement OpenType Font Variation tables avar/fvar/HVAR/VVAR.
- hb-shape and hb-view now accept --variations.
+
- New API:
+ +hb_variation_t
+ +hb_variation_from_string()
+ +hb_variation_to_string()
-hb_variation_t
-hb_variation_from_string()
-hb_variation_to_string()
+ +hb_font_set_variations()
+ +hb_font_set_var_coords_design()
+ +hb_font_get_var_coords_normalized()
-hb_font_set_variations()
-hb_font_set_var_coords_design()
-hb_font_get_var_coords_normalized()
+ +hb-ot-var.h:
+ +hb_ot_var_axis_t
+ +hb_ot_var_has_data()
+ +hb_ot_var_get_axis_count()
+ +hb_ot_var_get_axes()
+ +hb_ot_var_find_axis()
+ +hb_ot_var_normalize_variations()
+ +hb_ot_var_normalize_coords()
-hb-ot-var.h:
-hb_ot_var_axis_t
-hb_ot_var_has_data()
-hb_ot_var_get_axis_count()
-hb_ot_var_get_axes()
-hb_ot_var_find_axis()
-hb_ot_var_normalize_variations()
-hb_ot_var_normalize_coords()
-
- MVAR to be implemented later. Access to named instances to be
implemented later as well.
@@ -2193,7 +2210,6 @@
Overview of changes leading to 1.4.1
Thursday, January 5, 2017
====================================
-
- Always build and use UCDN for Unicode data by default.
Reduces dependence on version of Unicode data in glib,
specially in the Windows bundles we are shipping, which
@@ -2203,22 +2219,21 @@
Overview of changes leading to 1.4.0
Thursday, January 5, 2017
====================================
-
- Merged "OpenType GX" branch which adds core of support for
OpenType 1.8 Font Variations. To that extent, the relevant
new API is:
-New API:
-hb_font_set_var_coords_normalized()
+- New API:
+ +hb_font_set_var_coords_normalized()
with supporting API:
-New API:
-HB_OT_LAYOUT_NO_VARIATIONS_INDEX
-hb_ot_layout_table_find_feature_variations()
-hb_ot_layout_feature_with_variations_get_lookups()
-hb_shape_plan_create2()
-hb_shape_plan_create_cached2()
+- New API:
+ +HB_OT_LAYOUT_NO_VARIATIONS_INDEX
+ +hb_ot_layout_table_find_feature_variations()
+ +hb_ot_layout_feature_with_variations_get_lookups()
+ +hb_shape_plan_create2()
+ +hb_shape_plan_create_cached2()
Currently variations in GSUB/GPOS/GDEF are fully supported,
and no other tables are supported. In particular, fvar/avar
@@ -2245,31 +2260,30 @@
Overview of changes leading to 1.3.3
Wednesday, September 28, 2016
====================================
-
- Implement parsing of OpenType MATH table.
-New API:
-HB_OT_TAG_MATH
-HB_OT_MATH_SCRIPT
-hb_ot_math_constant_t
-hb_ot_math_kern_t
-hb_ot_math_glyph_variant_t
-hb_ot_math_glyph_part_flags_t
-hb_ot_math_glyph_part_t
-hb_ot_math_has_data
-hb_ot_math_get_constant
-hb_ot_math_get_glyph_italics_correction
-hb_ot_math_get_glyph_top_accent_attachment
-hb_ot_math_get_glyph_kerning
-hb_ot_math_is_glyph_extended_shape
-hb_ot_math_get_glyph_variants
-hb_ot_math_get_min_connector_overlap
-hb_ot_math_get_glyph_assembly
+- New API:
+ +HB_OT_TAG_MATH
+ +HB_OT_MATH_SCRIPT
+ +hb_ot_math_constant_t
+ +hb_ot_math_kern_t
+ +hb_ot_math_glyph_variant_t
+ +hb_ot_math_glyph_part_flags_t
+ +hb_ot_math_glyph_part_t
+ +hb_ot_math_has_data()
+ +hb_ot_math_get_constant()
+ +hb_ot_math_get_glyph_italics_correction()
+ +hb_ot_math_get_glyph_top_accent_attachment()
+ +hb_ot_math_get_glyph_kerning()
+ +hb_ot_math_is_glyph_extended_shape()
+ +hb_ot_math_get_glyph_variants()
+ +hb_ot_math_get_min_connector_overlap()
+ +hb_ot_math_get_glyph_assembly()
+
Overview of changes leading to 1.3.2
Wednesday, September 27, 2016
====================================
-
- Fix build of hb-coretext on older OS X versions.
@@ -2276,7 +2290,6 @@
Overview of changes leading to 1.3.1
Wednesday, September 7, 2016
====================================
-
- Blacklist bad GDEF of more fonts (Padauk).
- More CoreText backend crash fixes with OS X 10.9.5.
- Misc fixes.
@@ -2285,7 +2298,6 @@
Overview of changes leading to 1.3.0
Thursday, July 21, 2016
====================================
-
- Update to Unicode 9.0.0
- Move Javanese from Indic shaper to Universal Shaping Engine.
- Allow MultipleSubst to delete a glyph (matching Windows engine).
@@ -2300,7 +2312,6 @@
Overview of changes leading to 1.2.7
Monday, May 2, 2016
====================================
-
- Blacklist another version of Times New Roman (Bold) Italic from Windows 7.
- Fix Mongolian Free Variation Selectors shaping with certain fonts.
- Fix Tibetan shorthand contractions shaping.
@@ -2312,7 +2323,6 @@
Overview of changes leading to 1.2.6
Friday, April 8, 2016
====================================
-
- Blacklist GDEF table of another set of Times New Roman (Bold) Italic.
- DirectWrite backend improvements. Note: DirectWrite backend is
exclusively for our internal testing and should NOT be used in any
@@ -2322,7 +2332,6 @@
Overview of changes leading to 1.2.5
Monday, April 4, 2016
====================================
-
- Fix GDEF mark-filtering-set, which was broken in 1.2.3.
@@ -2329,7 +2338,6 @@
Overview of changes leading to 1.2.4
Thursday, March 17, 2016
====================================
-
- Synthesize GDEF glyph class for any glyph that does not have one in GDEF.
I really hope we don't discover broken fonts that shape badly with this
change.
@@ -2344,7 +2352,6 @@
Overview of changes leading to 1.2.3
Thursday, February 25, 2016
====================================
-
- Blacklist GDEF table of certain versions of Times New Roman (Bold) Italic,
due to bug in glyph class of ASCII double-quote character. This should
address "regression" introduced in 1.2.0 when we switched mark zeroing
@@ -2363,17 +2370,17 @@
Added get_nominal_glyph() and get_variation_glyph() instead of get_glyph()
-New API:
-- hb_font_get_nominal_glyph_func_t
-- hb_font_get_variation_glyph_func_t
-- hb_font_funcs_set_nominal_glyph_func()
-- hb_font_funcs_set_variation_glyph_func()
-- hb_font_get_nominal_glyph()
-- hb_font_get_variation_glyph()
+- New API:
+ +hb_font_get_nominal_glyph_func_t
+ +hb_font_get_variation_glyph_func_t
+ +hb_font_funcs_set_nominal_glyph_func()
+ +hb_font_funcs_set_variation_glyph_func()
+ +hb_font_get_nominal_glyph()
+ +hb_font_get_variation_glyph()
-Deprecated API:
-- hb_font_get_glyph_func_t
-- hb_font_funcs_set_glyph_func()
+- Deprecated API:
+ -hb_font_get_glyph_func_t
+ -hb_font_funcs_set_glyph_func()
Clients that implement their own font-funcs are encouraged to replace
their get_glyph() implementation with a get_nominal_glyph() and
@@ -2386,7 +2393,6 @@
Overview of changes leading to 1.2.2
Wednesday, February 24, 2016
====================================
-
- Fix regression with mark positioning with fonts that have
non-zero mark advances. This was introduced in 1.2.0 while
trying to make mark and cursive attachments to work together.
@@ -2398,7 +2404,6 @@
Overview of changes leading to 1.2.1
Tuesday, February 23, 2016
====================================
-
- CoreText: Fix bug with wrong scale if font scale was changed later.
https://github.com/libass/libass/issues/212
- CoreText: Drastically speed up font initialization.
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build 2025-04-28 23:16:31 UTC (rev 75046)
@@ -1,6 +1,6 @@
project('harfbuzz', ['c', 'cpp'],
meson_version: '>= 0.60.0',
- version: '11.1.0',
+ version: '11.2.0',
default_options: [
'cpp_eh=none', # Just to support msvc, we are passing -fno-exceptions also anyway
# 'cpp_rtti=false', # Do NOT enable, wraps inherit it and ICU needs RTTI
@@ -467,6 +467,7 @@
'Font callbacks (the more the merrier)':
{'Builtin' : true,
'FreeType': conf.get('HAVE_FREETYPE', 0) == 1,
+ 'Fontations': conf.get('HAVE_FONTATIONS', 0) == 1,
},
'Dependencies used for command-line utilities':
{'Cairo': conf.get('HAVE_CAIRO', 0) == 1,
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/CBDT/CBDT.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/CBDT/CBDT.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/CBDT/CBDT.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -949,15 +949,14 @@
hb_glyph_extents_t extents;
hb_glyph_extents_t pixel_extents;
- hb_blob_t *blob = reference_png (font, glyph);
-
- if (unlikely (blob == hb_blob_get_empty ()))
+ if (unlikely (!font->get_glyph_extents (glyph, &extents, false)))
return false;
- if (unlikely (!hb_font_get_glyph_extents (font, glyph, &extents)))
+ if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
return false;
- if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
+ hb_blob_t *blob = reference_png (font, glyph);
+ if (unlikely (hb_blob_is_immutable (blob)))
return false;
bool ret = funcs->image (data,
@@ -964,10 +963,11 @@
blob,
pixel_extents.width, -pixel_extents.height,
HB_PAINT_IMAGE_FORMAT_PNG,
- font->slant_xy,
+ 0.f,
&extents);
hb_blob_destroy (blob);
+
return ret;
}
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/COLR/COLR.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/COLR/COLR.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/COLR/COLR.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -33,6 +33,7 @@
#include "../../../hb-open-type.hh"
#include "../../../hb-ot-var-common.hh"
#include "../../../hb-paint.hh"
+#include "../../../hb-paint-bounded.hh"
#include "../../../hb-paint-extents.hh"
#include "../CPAL/CPAL.hh"
@@ -49,6 +50,7 @@
struct hb_colr_scratch_t
{
+ hb_paint_bounded_context_t paint_bounded;
hb_paint_extents_context_t paint_extents;
};
@@ -101,8 +103,22 @@
),
foreground (foreground_),
instancer (instancer_)
- { }
+ {
+ if (font->is_synthetic ())
+ {
+ font = hb_font_create_sub_font (font);
+ hb_font_set_synthetic_bold (font, 0, 0, true);
+ hb_font_set_synthetic_slant (font, 0);
+ }
+ else
+ hb_font_reference (font);
+ }
+ ~hb_paint_context_t ()
+ {
+ hb_font_destroy (font);
+ }
+
hb_color_t get_color (unsigned int color_index, float alpha, hb_bool_t *is_foreground)
{
hb_color_t color = foreground;
@@ -1620,7 +1636,7 @@
void closurev1 (hb_colrv1_closure_context_t* c) const
{
switch (u.format) {
- case 2: u.format2.closurev1 (c);
+ case 2: u.format2.closurev1 (c); return;
default:return;
}
}
@@ -2230,7 +2246,7 @@
public:
hb_blob_ptr_t<COLR> colr;
private:
- hb_atomic_t<hb_colr_scratch_t *> cached_scratch;
+ mutable hb_atomic_t<hb_colr_scratch_t *> cached_scratch;
};
void closure_glyphs (hb_codepoint_t glyph,
@@ -2632,7 +2648,6 @@
}
else
{
- // Ugh. We need to undo the synthetic slant here. Leave it for now. :-(.
extents->x_bearing = e.xmin;
extents->y_bearing = e.ymax;
extents->width = e.xmax - e.xmin;
@@ -2700,7 +2715,6 @@
if (get_clip (glyph, &extents, instancer))
{
font->scale_glyph_extents (&extents);
- font->synthetic_glyph_extents (&extents);
c.funcs->push_clip_rectangle (c.data,
extents.x_bearing,
extents.y_bearing + extents.height,
@@ -2709,23 +2723,22 @@
}
else
{
- auto *extents_funcs = hb_paint_extents_get_funcs ();
- scratch.paint_extents.clear ();
+ clip = false;
+ is_bounded = false;
+ }
+ if (!is_bounded)
+ {
+ auto *bounded_funcs = hb_paint_bounded_get_funcs ();
+ scratch.paint_bounded.clear ();
+
paint_glyph (font, glyph,
- extents_funcs, &scratch.paint_extents,
+ bounded_funcs, &scratch.paint_bounded,
palette_index, foreground,
false,
scratch);
- auto extents = scratch.paint_extents.get_extents ();
- is_bounded = scratch.paint_extents.is_bounded ();
-
- c.funcs->push_clip_rectangle (c.data,
- extents.xmin,
- extents.ymin,
- extents.xmax,
- extents.ymax);
+ is_bounded = scratch.paint_bounded.is_bounded ();
}
}
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/sbix/sbix.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/sbix/sbix.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/sbix/sbix.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -237,17 +237,17 @@
int x_offset = 0, y_offset = 0;
unsigned int strike_ppem = 0;
- hb_blob_t *blob = reference_png (font, glyph, &x_offset, &y_offset, &strike_ppem);
hb_glyph_extents_t extents;
hb_glyph_extents_t pixel_extents;
- if (blob == hb_blob_get_empty ())
+ if (!font->get_glyph_extents (glyph, &extents, false))
return false;
- if (!hb_font_get_glyph_extents (font, glyph, &extents))
+ if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
return false;
- if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
+ hb_blob_t *blob = reference_png (font, glyph, &x_offset, &y_offset, &strike_ppem);
+ if (hb_blob_is_immutable (blob))
return false;
bool ret = funcs->image (data,
@@ -254,10 +254,11 @@
blob,
pixel_extents.width, -pixel_extents.height,
HB_PAINT_IMAGE_FORMAT_PNG,
- font->slant_xy,
+ 0.f,
&extents);
hb_blob_destroy (blob);
+
return ret;
}
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/svg/svg.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/svg/svg.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Color/svg/svg.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -104,15 +104,16 @@
if (blob == hb_blob_get_empty ())
return false;
- funcs->image (data,
- blob,
- 0, 0,
- HB_PAINT_IMAGE_FORMAT_SVG,
- font->slant_xy,
- nullptr);
+ bool ret = funcs->image (data,
+ blob,
+ 0, 0,
+ HB_PAINT_IMAGE_FORMAT_SVG,
+ 0.f,
+ nullptr);
hb_blob_destroy (blob);
- return true;
+
+ return ret;
}
private:
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/GPOS.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/GPOS.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/GPOS.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -152,8 +152,11 @@
for (unsigned i = 0; i < len; i++)
propagate_attachment_offsets (pos, len, i, direction);
- if (unlikely (font->slant))
+ if (unlikely (font->slant_xy) &&
+ HB_DIRECTION_IS_HORIZONTAL (direction))
{
+ /* Slanting shaping results is only supported for horizontal text,
+ * as it gets weird otherwise. */
for (unsigned i = 0; i < len; i++)
if (unlikely (pos[i].y_offset))
pos[i].x_offset += roundf (font->slant_xy * pos[i].y_offset);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -355,12 +355,12 @@
hb_draw_session_t transformer_session {transformer_funcs, &context};
hb_draw_session_t &shape_draw_session = transform.is_identity () ? *c.draw_session : transformer_session;
- if (!c.font->face->table.glyf->get_path_at (c.font, glyph, shape_draw_session, coords, c.scratch.glyf_scratch))
+ if (c.font->face->table.glyf->get_path_at (c.font, glyph, shape_draw_session, coords, c.scratch.glyf_scratch)) return true;
#ifndef HB_NO_CFF
- if (!c.font->face->table.cff2->get_path_at (c.font, glyph, shape_draw_session, coords))
- if (!c.font->face->table.cff1->get_path (c.font, glyph, shape_draw_session)) // Doesn't have variations
+ if (c.font->face->table.cff2->get_path_at (c.font, glyph, shape_draw_session, coords)) return true;
+ if (c.font->face->table.cff1->get_path (c.font, glyph, shape_draw_session)) return true; // Doesn't have variations
#endif
- return false;
+ return false;
}
else if (c.extents)
{
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Var/VARC/VARC.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -235,7 +235,7 @@
private:
hb_blob_ptr_t<VARC> table;
- hb_atomic_t<hb_varc_scratch_t *> cached_scratch;
+ mutable hb_atomic_t<hb_varc_scratch_t *> cached_scratch;
};
bool has_data () const { return version.major != 0; }
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/glyf/glyf.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -543,7 +543,7 @@
unsigned int num_glyphs;
hb_blob_ptr_t<loca> loca_table;
hb_blob_ptr_t<glyf> glyf_table;
- hb_atomic_t<hb_glyf_scratch_t *> cached_scratch;
+ mutable hb_atomic_t<hb_glyf_scratch_t *> cached_scratch;
};
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/check-symbols.py 2025-04-28 23:16:31 UTC (rev 75046)
@@ -18,7 +18,7 @@
'_ZN3std9panicking11EMPTY_PANIC.*', # 'std::panicking::EMPTY_PANIC::.*'
'_ZN3std3sys3pal4unix4args3imp15ARGV_INIT_ARRAY.*', # 'std::sys::pal::unix::args::imp::ARGV_INIT_ARRAY::.*'
'_ZN3std3sys4args4unix3imp15ARGV_INIT_ARRAY.*', # std::sys::args::unix::imp::ARGV_INIT_ARRAY::.*
- '_ZN17compiler_builtins4math4libm7generic4sqrt9RSQRT_TAB.*', # 'compiler_builtins::math::libm::generic::sqrt::RSQRT_TAB::.*'
+ '_ZN17compiler_builtins.*', # 'compiler_builtins::.*'
]
IGNORED_SYMBOLS = '|'.join (IGNORED_SYMBOLS)
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/fontations/lib.rs
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/fontations/lib.rs 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/fontations/lib.rs 2025-04-28 23:16:31 UTC (rev 75046)
@@ -409,9 +409,15 @@
let data = unsafe { &mut *(font_data as *mut FontationsData) };
data.check_for_updates();
+ let glyph_id = GlyphId::new(glyph);
+
+ // COLRv1 color glyphs are not supported by glyph_metrics.
+ let color_glyphs = &data.color_glyphs;
+ if color_glyphs.get(glyph_id).is_some() {
+ return false as hb_bool_t;
+ };
+
let glyph_metrics = &data.glyph_metrics.as_ref().unwrap();
-
- let glyph_id = GlyphId::new(glyph);
let Some(glyph_extents) = glyph_metrics.bounds(glyph_id) else {
return false as hb_bool_t;
};
@@ -522,14 +528,14 @@
}
}
-extern "C" fn _hb_fontations_draw_glyph(
- font: *mut hb_font_t,
+extern "C" fn _hb_fontations_draw_glyph_or_fail(
+ _font: *mut hb_font_t,
font_data: *mut ::std::os::raw::c_void,
glyph: hb_codepoint_t,
draw_funcs: *mut hb_draw_funcs_t,
draw_data: *mut ::std::os::raw::c_void,
_user_data: *mut ::std::os::raw::c_void,
-) {
+) -> hb_bool_t {
let data = unsafe { &mut *(font_data as *mut FontationsData) };
data.check_for_updates();
@@ -539,25 +545,11 @@
let glyph_id = GlyphId::new(glyph);
let Some(outline_glyph) = outline_glyphs.get(glyph_id) else {
- return;
+ return false as hb_bool_t;
};
let draw_settings = DrawSettings::unhinted(*size, location);
- let slant = unsafe { hb_font_get_synthetic_slant(font) };
- let mut x_scale: i32 = 0;
- let mut y_scale: i32 = 0;
- unsafe {
- hb_font_get_scale(font, &mut x_scale, &mut y_scale);
- }
- let slant = if y_scale != 0 {
- slant as f32 * x_scale as f32 / y_scale as f32
- } else {
- 0.
- };
- let mut draw_state = hb_draw_state_t {
- slant_xy: slant,
- ..unsafe { std::mem::zeroed() }
- };
+ let mut draw_state = unsafe { std::mem::zeroed::<hb_draw_state_t>() };
let mut pen = HbPen {
x_mult: data.x_mult,
@@ -568,6 +560,7 @@
};
let _ = outline_glyph.draw(draw_settings, &mut pen);
+ true as hb_bool_t
}
struct HbColorPainter<'a> {
@@ -910,7 +903,7 @@
}
}
-extern "C" fn _hb_fontations_paint_glyph(
+extern "C" fn _hb_fontations_paint_glyph_or_fail(
font: *mut hb_font_t,
font_data: *mut ::std::os::raw::c_void,
glyph: hb_codepoint_t,
@@ -919,7 +912,7 @@
palette_index: ::std::os::raw::c_uint,
foreground: hb_color_t,
_user_data: *mut ::std::os::raw::c_void,
-) {
+) -> hb_bool_t {
let data = unsafe { &mut *(font_data as *mut FontationsData) };
data.check_for_updates();
@@ -929,7 +922,7 @@
let glyph_id = GlyphId::new(glyph);
let Some(color_glyph) = color_glyphs.get(glyph_id) else {
- return;
+ return false as hb_bool_t;
};
let cpal = font_ref.cpal();
@@ -956,6 +949,17 @@
}
};
+ let font = if (unsafe { hb_font_is_synthetic(font) } != false as hb_bool_t) {
+ unsafe {
+ let sub_font = hb_font_create_sub_font(font);
+ hb_font_set_synthetic_bold(sub_font, 0.0, 0.0, true as hb_bool_t);
+ hb_font_set_synthetic_slant(sub_font, 0.0);
+ sub_font
+ }
+ } else {
+ unsafe { hb_font_reference(font) }
+ };
+
let mut painter = HbColorPainter {
font,
paint_funcs,
@@ -969,6 +973,11 @@
hb_paint_push_font_transform(paint_funcs, paint_data, font);
}
let _ = color_glyph.paint(location, &mut painter);
+ unsafe {
+ hb_paint_pop_transform(paint_funcs, paint_data);
+ hb_font_destroy(font);
+ }
+ true as hb_bool_t
}
extern "C" fn _hb_fontations_glyph_name(
@@ -1080,15 +1089,15 @@
null_mut(),
None,
);
- hb_font_funcs_set_draw_glyph_func(
+ hb_font_funcs_set_draw_glyph_or_fail_func(
ffuncs,
- Some(_hb_fontations_draw_glyph),
+ Some(_hb_fontations_draw_glyph_or_fail),
null_mut(),
None,
);
- hb_font_funcs_set_paint_glyph_func(
+ hb_font_funcs_set_paint_glyph_or_fail_func(
ffuncs,
- Some(_hb_fontations_paint_glyph),
+ Some(_hb_fontations_paint_glyph_or_fail),
null_mut(),
None,
);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-subset.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-subset.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz-subset.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -43,6 +43,7 @@
#include "hb-ot-tag.cc"
#include "hb-ot-var.cc"
#include "hb-outline.cc"
+#include "hb-paint-bounded.cc"
#include "hb-paint-extents.cc"
#include "hb-paint.cc"
#include "hb-set.cc"
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/harfbuzz.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -52,6 +52,7 @@
#include "hb-ot-tag.cc"
#include "hb-ot-var.cc"
#include "hb-outline.cc"
+#include "hb-paint-bounded.cc"
#include "hb-paint-extents.cc"
#include "hb-paint.cc"
#include "hb-set.cc"
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-atomic.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -194,7 +194,7 @@
void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); }
T *get_relaxed () const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); }
T *get_acquire () const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); }
- bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); }
+ bool cmpexch (const T *old, T *new_) { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); }
operator bool () const { return get_acquire () != nullptr; }
T * operator -> () const { return get_acquire (); }
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -412,6 +412,9 @@
{
end = hb_min (end, len);
+ if (unlikely (end - start > 255))
+ return;
+
if (interior && !from_out_buffer && end - start < 2)
return;
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo-utils.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo-utils.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo-utils.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -31,8 +31,6 @@
#include "hb-cairo-utils.hh"
-#include <cairo.h>
-
/* Some routines in this file were ported from BlackRenderer by Black Foundry.
* Used by permission to relicense to HarfBuzz license.
*
@@ -101,7 +99,7 @@
unsigned width,
unsigned height,
hb_tag_t format,
- float slant,
+ HB_UNUSED float slant_deprecated,
hb_glyph_extents_t *extents)
{
cairo_t *cr = c->cr;
@@ -186,12 +184,6 @@
cairo_matrix_t matrix = {(double) width, 0, 0, (double) height, 0, 0};
cairo_pattern_set_matrix (pattern, &matrix);
- /* Undo slant in the extents and apply it in the context. */
- extents->width -= extents->height * slant;
- extents->x_bearing -= extents->y_bearing * slant;
- cairo_matrix_t cairo_matrix = {1., 0., (double) slant, 1., 0., 0.};
- cairo_transform (cr, &cairo_matrix);
-
cairo_translate (cr, extents->x_bearing, extents->y_bearing);
cairo_scale (cr, extents->width, extents->height);
cairo_set_source (cr, pattern);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-cairo.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -204,7 +204,9 @@
cairo_save (cr);
cairo_new_path (cr);
+
hb_font_draw_glyph (font, glyph, hb_cairo_draw_get_funcs (), cr);
+
cairo_close_path (cr);
cairo_clip (cr);
}
@@ -572,9 +574,12 @@
hb_buffer_guess_segment_properties (buffer);
hb_shape (font, buffer, nullptr, 0);
+ int x_scale, y_scale;
+ hb_font_get_scale (font, &x_scale, &y_scale);
+
hb_cairo_glyphs_from_buffer (buffer,
true,
- font->x_scale, font->y_scale,
+ x_scale, y_scale,
0., 0.,
utf8, utf8_len,
glyphs, (unsigned *) num_glyphs,
@@ -601,10 +606,11 @@
+1. / (x_scale ? x_scale : 1),
-1. / (y_scale ? y_scale : 1));
- hb_font_draw_glyph (font, glyph, hb_cairo_draw_get_funcs (), cr);
+ if (hb_font_draw_glyph_or_fail (font, glyph, hb_cairo_draw_get_funcs (), cr))
+ cairo_fill (cr);
- cairo_fill (cr);
-
+ // If draw fails, we still return SUCCESS, as we want empty drawing, not
+ // setting the cairo object into error.
return CAIRO_STATUS_SUCCESS;
}
@@ -639,9 +645,9 @@
c.cr = cr;
c.color_cache = (hb_map_t *) cairo_scaled_font_get_user_data (scaled_font, &color_cache_key);
- hb_font_paint_glyph (font, glyph, hb_cairo_paint_get_funcs (), &c, palette, color);
+ if (!hb_font_paint_glyph_or_fail (font, glyph, hb_cairo_paint_get_funcs (), &c, palette, color))
+ return CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED;
-
return CAIRO_STATUS_SUCCESS;
}
@@ -657,8 +663,7 @@
cairo_user_font_face_set_text_to_glyphs_func (cairo_face, hb_cairo_text_to_glyphs);
cairo_user_font_face_set_render_glyph_func (cairo_face, hb_cairo_render_glyph);
#ifdef HAVE_CAIRO_USER_FONT_FACE_SET_RENDER_COLOR_GLYPH_FUNC
- if (hb_ot_color_has_png (face) || hb_ot_color_has_layers (face) || hb_ot_color_has_paint (face))
- cairo_user_font_face_set_render_color_glyph_func (cairo_face, hb_cairo_render_color_glyph);
+ cairo_user_font_face_set_render_color_glyph_func (cairo_face, hb_cairo_render_color_glyph);
#endif
if (unlikely (CAIRO_STATUS_SUCCESS != cairo_font_face_set_user_data (cairo_face,
@@ -689,7 +694,8 @@
{
hb_font_make_immutable (font);
- auto *cairo_face = user_font_face_create (font->face);
+ auto *hb_face = hb_font_get_face (font);
+ auto *cairo_face = user_font_face_create (hb_face);
if (unlikely (CAIRO_STATUS_SUCCESS != cairo_font_face_set_user_data (cairo_face,
&hb_cairo_font_user_data_key,
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext-font.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext-font.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext-font.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -365,12 +365,12 @@
}
}
-static void
-hb_coretext_draw_glyph (hb_font_t *font,
- void *font_data HB_UNUSED,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs, void *draw_data,
- void *user_data)
+static hb_bool_t
+hb_coretext_draw_glyph_or_fail (hb_font_t *font,
+ void *font_data HB_UNUSED,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ void *user_data)
{
CTFontRef ct_font = (CTFontRef) (const void *) font->data.coretext;
@@ -383,13 +383,15 @@
CGPathRef path = CTFontCreatePathForGlyph (ct_font, glyph, &transform);
if (!path)
- return;
+ return false;
- hb_draw_session_t drawing = {draw_funcs, draw_data, font->slant};
+ hb_draw_session_t drawing {draw_funcs, draw_data};
CGPathApply (path, &drawing, ct_apply_func);
CFRelease (path);
+
+ return true;
}
#endif
@@ -469,7 +471,7 @@
#endif
#ifndef HB_NO_DRAW
- hb_font_funcs_set_draw_glyph_func (funcs, hb_coretext_draw_glyph, nullptr, nullptr);
+ hb_font_funcs_set_draw_glyph_or_fail_func (funcs, hb_coretext_draw_glyph_or_fail, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_coretext_get_glyph_extents, nullptr, nullptr);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-coretext.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -205,10 +205,18 @@
if (unlikely (named_instance_index != 0))
{
+ // https://github.com/harfbuzz/harfbuzz/issues/5300
+#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || \
+ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || \
+ (defined(__TV_OS_VERSION_MIN_REQUIRED) && __TV_OS_VERSION_MIN_REQUIRED >= 110000) || \
+ (defined(__WATCH_OS_VERSION_MIN_REQUIRED) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40000) || \
+ (defined(__MACCATALYST_VERSION_MIN_REQUIRED) && __MACCATALYST_VERSION_MIN_REQUIRED >= 130100) || \
+ (defined(__VISION_OS_VERSION_MIN_REQUIRED) && __VISION_OS_VERSION_MIN_REQUIRED >= 10000)
auto ct_font_desc_array = CTFontManagerCreateFontDescriptorsFromData (CFDataCreate (kCFAllocatorDefault, (const UInt8 *) blob_data, blob_length));
- if (unlikely (!ct_font_desc_array))
- return nullptr;
- return create_cg_font (ct_font_desc_array, named_instance_index);
+ if (likely (ct_font_desc_array))
+ return create_cg_font (ct_font_desc_array, named_instance_index);
+#endif
+ return nullptr;
}
hb_blob_reference (blob);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-deprecated.h 2025-04-28 23:16:31 UTC (rev 75046)
@@ -276,6 +276,48 @@
void *user_data);
/**
+ * hb_font_draw_glyph_func_t:
+ * @font: #hb_font_t to work upon
+ * @font_data: @font user data pointer
+ * @glyph: The glyph ID to query
+ * @draw_funcs: The draw functions to send the shape data to
+ * @draw_data: The data accompanying the draw functions
+ * @user_data: User data pointer passed by the caller
+ *
+ * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
+ *
+ * Since: 7.0.0
+ * XDeprecated: REPLACEME: Use hb_font_draw_glyph_func_or_fail_t instead.
+ **/
+typedef void (*hb_font_draw_glyph_func_t) (hb_font_t *font, void *font_data,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ void *user_data);
+
+/**
+ * hb_font_paint_glyph_func_t:
+ * @font: #hb_font_t to work upon
+ * @font_data: @font user data pointer
+ * @glyph: The glyph ID to query
+ * @paint_funcs: The paint functions to use
+ * @paint_data: The data accompanying the paint functions
+ * @palette_index: The color palette to use
+ * @foreground: The foreground color
+ * @user_data: User data pointer passed by the caller
+ *
+ * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
+ *
+ * Since: 7.0.0
+ * XDeprecated: REPLACEME: Use hb_font_paint_glyph_or_fail_func_t instead.
+ */
+typedef hb_bool_t (*hb_font_paint_glyph_func_t) (hb_font_t *font, void *font_data,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette_index,
+ hb_color_t foreground,
+ void *user_data);
+
+/**
* hb_font_funcs_set_glyph_shape_func:
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
@@ -288,14 +330,50 @@
* Since: 4.0.0
* Deprecated: 7.0.0: Use hb_font_funcs_set_draw_glyph_func() instead
**/
-HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_func)
+HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_or_fail_func)
HB_EXTERN void
hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
hb_font_get_glyph_shape_func_t func,
void *user_data, hb_destroy_func_t destroy);
-HB_DEPRECATED_FOR (hb_font_draw_glyph)
+/**
+ * hb_font_funcs_set_draw_glyph_func:
+ * @ffuncs: A font-function structure
+ * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
+ * @user_data: Data to pass to @func
+ * @destroy: (nullable): The function to call when @user_data is not needed anymore
+ *
+ * Sets the implementation function for #hb_font_draw_glyph_func_t.
+ *
+ * Since: 7.0.0
+ * XDeprecated: REPLACEME: Use hb_font_funcs_set_draw_glyph_or_fail_func instead.
+ **/
+HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_or_fail_func)
HB_EXTERN void
+hb_font_funcs_set_draw_glyph_func (hb_font_funcs_t *ffuncs,
+ hb_font_draw_glyph_func_t func,
+ void *user_data, hb_destroy_func_t destroy);
+
+/**
+ * hb_font_funcs_set_paint_glyph_func:
+ * @ffuncs: A font-function structure
+ * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
+ * @user_data: Data to pass to @func
+ * @destroy: (nullable): The function to call when @user_data is no longer needed
+ *
+ * Sets the implementation function for #hb_font_paint_glyph_func_t.
+ *
+ * Since: 7.0.0
+ * XDeprecated: REPLACEME: Use hb_font_funcs_set_paint_glyph_or_fail_func() instead.
+ */
+HB_DEPRECATED_FOR (hb_font_funcs_set_paint_glyph_or_fail_func)
+HB_EXTERN void
+hb_font_funcs_set_paint_glyph_func (hb_font_funcs_t *ffuncs,
+ hb_font_paint_glyph_func_t func,
+ void *user_data, hb_destroy_func_t destroy);
+
+HB_DEPRECATED_FOR (hb_font_draw_glyph_or_fail)
+HB_EXTERN void
hb_font_get_glyph_shape (hb_font_t *font,
hb_codepoint_t glyph,
hb_draw_funcs_t *dfuncs, void *draw_data);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite-font.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite-font.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-directwrite-font.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -238,7 +238,7 @@
GeometrySink(hb_font_t *font,
hb_draw_funcs_t *draw_funcs,
void *draw_data)
- : font (font), drawing ({draw_funcs, draw_data, font->slant}) {}
+ : font (font), drawing ({draw_funcs, draw_data}) {}
virtual ~GeometrySink() {}
@@ -275,12 +275,12 @@
}
};
-static void
-hb_directwrite_draw_glyph (hb_font_t *font,
- void *font_data HB_UNUSED,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs, void *draw_data,
- void *user_data)
+static hb_bool_t
+hb_directwrite_draw_glyph_or_fail (hb_font_t *font,
+ void *font_data HB_UNUSED,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ void *user_data)
{
IDWriteFontFace *dw_face = (IDWriteFontFace *) (const void *) font->data.directwrite;
@@ -288,11 +288,11 @@
UINT16 gid = static_cast<UINT16>(glyph);
unsigned upem = font->face->get_upem();
- (void) dw_face->GetGlyphRunOutline (upem,
- &gid, nullptr, nullptr,
- 1,
- false, false,
- &sink);
+ return S_OK == dw_face->GetGlyphRunOutline (upem,
+ &gid, nullptr, nullptr,
+ 1,
+ false, false,
+ &sink);
}
#endif
@@ -317,7 +317,7 @@
#endif
#ifndef HB_NO_DRAW
- hb_font_funcs_set_draw_glyph_func (funcs, hb_directwrite_draw_glyph, nullptr, nullptr);
+ hb_font_funcs_set_draw_glyph_or_fail_func (funcs, hb_directwrite_draw_glyph_or_fail, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_directwrite_get_glyph_extents, nullptr, nullptr);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -28,6 +28,11 @@
#include "hb-draw.hh"
+#include "hb-geometry.hh"
+
+#include "hb-machinery.hh"
+
+
/**
* SECTION:hb-draw
* @title: hb-draw
@@ -455,4 +460,92 @@
}
+static void
+hb_draw_extents_move_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
+ void *data,
+ hb_draw_state_t *st,
+ float to_x, float to_y,
+ void *user_data HB_UNUSED)
+{
+ hb_extents_t *extents = (hb_extents_t *) data;
+
+ extents->add_point (to_x, to_y);
+}
+
+static void
+hb_draw_extents_line_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
+ void *data,
+ hb_draw_state_t *st,
+ float to_x, float to_y,
+ void *user_data HB_UNUSED)
+{
+ hb_extents_t *extents = (hb_extents_t *) data;
+
+ extents->add_point (to_x, to_y);
+}
+
+static void
+hb_draw_extents_quadratic_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
+ void *data,
+ hb_draw_state_t *st,
+ float control_x, float control_y,
+ float to_x, float to_y,
+ void *user_data HB_UNUSED)
+{
+ hb_extents_t *extents = (hb_extents_t *) data;
+
+ extents->add_point (control_x, control_y);
+ extents->add_point (to_x, to_y);
+}
+
+static void
+hb_draw_extents_cubic_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
+ void *data,
+ hb_draw_state_t *st,
+ float control1_x, float control1_y,
+ float control2_x, float control2_y,
+ float to_x, float to_y,
+ void *user_data HB_UNUSED)
+{
+ hb_extents_t *extents = (hb_extents_t *) data;
+
+ extents->add_point (control1_x, control1_y);
+ extents->add_point (control2_x, control2_y);
+ extents->add_point (to_x, to_y);
+}
+
+static inline void free_static_draw_extents_funcs ();
+
+static struct hb_draw_extents_funcs_lazy_loader_t : hb_draw_funcs_lazy_loader_t<hb_draw_extents_funcs_lazy_loader_t>
+{
+ static hb_draw_funcs_t *create ()
+ {
+ hb_draw_funcs_t *funcs = hb_draw_funcs_create ();
+
+ hb_draw_funcs_set_move_to_func (funcs, hb_draw_extents_move_to, nullptr, nullptr);
+ hb_draw_funcs_set_line_to_func (funcs, hb_draw_extents_line_to, nullptr, nullptr);
+ hb_draw_funcs_set_quadratic_to_func (funcs, hb_draw_extents_quadratic_to, nullptr, nullptr);
+ hb_draw_funcs_set_cubic_to_func (funcs, hb_draw_extents_cubic_to, nullptr, nullptr);
+
+ hb_draw_funcs_make_immutable (funcs);
+
+ hb_atexit (free_static_draw_extents_funcs);
+
+ return funcs;
+ }
+} static_draw_extents_funcs;
+
+static inline
+void free_static_draw_extents_funcs ()
+{
+ static_draw_extents_funcs.free_instance ();
+}
+
+hb_draw_funcs_t *
+hb_draw_extents_get_funcs ()
+{
+ return static_draw_extents_funcs.get_unconst ();
+}
+
+
#endif
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.h
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.h 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.h 2025-04-28 23:16:31 UTC (rev 75046)
@@ -41,16 +41,9 @@
* @path_start_y: Y component of the start of current path
* @current_x: X component of current point
* @current_y: Y component of current point
- * @slant_xy: Slanting factor for synthetic oblique, Since: 11.0.0
*
* Current drawing state.
*
- * The @slant_xy is a slanting factor for synthetic oblique. If the font's
- * oblique angle is not 0, this factor is used to slant the drawing. For
- * fonts with uniform x and y scales, this factor is calculated as
- * tan(oblique_angle). For fonts with non-uniform scales, this factor is
- * calculated as tan(oblique_angle) * x_scale / y_scale, or 0 if y_scale is 0.
- *
* Since: 4.0.0
**/
typedef struct hb_draw_state_t {
@@ -62,8 +55,6 @@
float current_x;
float current_y;
- float slant_xy;
-
/*< private >*/
hb_var_num_t reserved1;
hb_var_num_t reserved2;
@@ -71,6 +62,7 @@
hb_var_num_t reserved4;
hb_var_num_t reserved5;
hb_var_num_t reserved6;
+ hb_var_num_t reserved7;
} hb_draw_state_t;
/**
@@ -78,7 +70,7 @@
*
* The default #hb_draw_state_t at the start of glyph drawing.
*/
-#define HB_DRAW_STATE_DEFAULT {0, 0.f, 0.f, 0.f, 0.f, 0.f, {0.}, {0.}, {0.}, {0.}, {0.}, {0.}}
+#define HB_DRAW_STATE_DEFAULT {0, 0.f, 0.f, 0.f, 0.f, {0}, {0}, {0}, {0}, {0}, {0}, {0}}
/**
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-draw.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -100,9 +100,6 @@
{
if (unlikely (st.path_open)) close_path (draw_data, st);
- if (st.slant_xy)
- to_x += to_y * st.slant_xy;
-
st.current_x = to_x;
st.current_y = to_y;
}
@@ -114,9 +111,6 @@
{
if (unlikely (!st.path_open)) start_path (draw_data, st);
- if (st.slant_xy)
- to_x += to_y * st.slant_xy;
-
emit_line_to (draw_data, st, to_x, to_y);
st.current_x = to_x;
@@ -131,12 +125,6 @@
{
if (unlikely (!st.path_open)) start_path (draw_data, st);
- if (st.slant_xy)
- {
- control_x += control_y * st.slant_xy;
- to_x += to_y * st.slant_xy;
- }
-
emit_quadratic_to (draw_data, st, control_x, control_y, to_x, to_y);
st.current_x = to_x;
@@ -152,13 +140,6 @@
{
if (unlikely (!st.path_open)) start_path (draw_data, st);
- if (st.slant_xy)
- {
- control1_x += control1_y * st.slant_xy;
- control2_x += control2_y * st.slant_xy;
- to_x += to_y * st.slant_xy;
- }
-
emit_cubic_to (draw_data, st, control1_x, control1_y, control2_x, control2_y, to_x, to_y);
st.current_x = to_x;
@@ -194,9 +175,9 @@
struct hb_draw_session_t
{
- hb_draw_session_t (hb_draw_funcs_t *funcs_, void *draw_data_, float slant_xy = 0.f)
+ hb_draw_session_t (hb_draw_funcs_t *funcs_, void *draw_data_)
: funcs {funcs_}, draw_data {draw_data_}, st HB_DRAW_STATE_DEFAULT
- { st.slant_xy = slant_xy; }
+ {}
~hb_draw_session_t () { close_path (); }
@@ -244,4 +225,9 @@
hb_draw_state_t st;
};
+
+HB_INTERNAL hb_draw_funcs_t *
+hb_draw_extents_get_funcs ();
+
+
#endif /* HB_DRAW_HH */
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -103,7 +103,7 @@
hb_font_extents_t *extents,
void *user_data HB_UNUSED)
{
- hb_bool_t ret = font->parent->get_font_h_extents (extents);
+ hb_bool_t ret = font->parent->get_font_h_extents (extents, false);
if (ret) {
extents->ascender = font->parent_scale_y_distance (extents->ascender);
extents->descender = font->parent_scale_y_distance (extents->descender);
@@ -128,7 +128,7 @@
hb_font_extents_t *extents,
void *user_data HB_UNUSED)
{
- hb_bool_t ret = font->parent->get_font_v_extents (extents);
+ hb_bool_t ret = font->parent->get_font_v_extents (extents, false);
if (ret) {
extents->ascender = font->parent_scale_x_distance (extents->ascender);
extents->descender = font->parent_scale_x_distance (extents->descender);
@@ -234,10 +234,10 @@
if (font->has_glyph_h_advances_func_set ())
{
hb_position_t ret;
- font->get_glyph_h_advances (1, &glyph, 0, &ret, 0);
+ font->get_glyph_h_advances (1, &glyph, 0, &ret, 0, false);
return ret;
}
- return font->parent_scale_x_distance (font->parent->get_glyph_h_advance (glyph));
+ return font->parent_scale_x_distance (font->parent->get_glyph_h_advance (glyph, false));
}
static hb_position_t
@@ -259,10 +259,10 @@
if (font->has_glyph_v_advances_func_set ())
{
hb_position_t ret;
- font->get_glyph_v_advances (1, &glyph, 0, &ret, 0);
+ font->get_glyph_v_advances (1, &glyph, 0, &ret, 0, false);
return ret;
}
- return font->parent_scale_y_distance (font->parent->get_glyph_v_advance (glyph));
+ return font->parent_scale_y_distance (font->parent->get_glyph_v_advance (glyph, false));
}
#define hb_font_get_glyph_h_advances_nil hb_font_get_glyph_h_advances_default
@@ -281,7 +281,7 @@
{
for (unsigned int i = 0; i < count; i++)
{
- *first_advance = font->get_glyph_h_advance (*first_glyph);
+ *first_advance = font->get_glyph_h_advance (*first_glyph, false);
first_glyph = &StructAtOffsetUnaligned<hb_codepoint_t> (first_glyph, glyph_stride);
first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride);
}
@@ -290,7 +290,8 @@
font->parent->get_glyph_h_advances (count,
first_glyph, glyph_stride,
- first_advance, advance_stride);
+ first_advance, advance_stride,
+ false);
for (unsigned int i = 0; i < count; i++)
{
*first_advance = font->parent_scale_x_distance (*first_advance);
@@ -313,7 +314,7 @@
{
for (unsigned int i = 0; i < count; i++)
{
- *first_advance = font->get_glyph_v_advance (*first_glyph);
+ *first_advance = font->get_glyph_v_advance (*first_glyph, false);
first_glyph = &StructAtOffsetUnaligned<hb_codepoint_t> (first_glyph, glyph_stride);
first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride);
}
@@ -322,7 +323,8 @@
font->parent->get_glyph_v_advances (count,
first_glyph, glyph_stride,
- first_advance, advance_stride);
+ first_advance, advance_stride,
+ false);
for (unsigned int i = 0; i < count; i++)
{
*first_advance = font->parent_scale_y_distance (*first_advance);
@@ -442,7 +444,7 @@
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
- hb_bool_t ret = font->parent->get_glyph_extents (glyph, extents);
+ hb_bool_t ret = font->parent->get_glyph_extents (glyph, extents, false);
if (ret) {
font->parent_scale_position (&extents->x_bearing, &extents->y_bearing);
font->parent_scale_distance (&extents->width, &extents->height);
@@ -472,7 +474,7 @@
hb_position_t *y,
void *user_data HB_UNUSED)
{
- hb_bool_t ret = font->parent->get_glyph_contour_point (glyph, point_index, x, y);
+ hb_bool_t ret = font->parent->get_glyph_contour_point (glyph, point_index, x, y, false);
if (ret)
font->parent_scale_position (x, y);
return ret;
@@ -524,26 +526,28 @@
return font->parent->get_glyph_from_name (name, len, glyph);
}
-static void
-hb_font_draw_glyph_nil (hb_font_t *font HB_UNUSED,
- void *font_data HB_UNUSED,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs,
- void *draw_data,
- void *user_data HB_UNUSED)
+static hb_bool_t
+hb_font_draw_glyph_or_fail_nil (hb_font_t *font HB_UNUSED,
+ void *font_data HB_UNUSED,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs,
+ void *draw_data,
+ void *user_data HB_UNUSED)
{
+ return false;
}
-static void
-hb_font_paint_glyph_nil (hb_font_t *font HB_UNUSED,
- void *font_data HB_UNUSED,
- hb_codepoint_t glyph HB_UNUSED,
- hb_paint_funcs_t *paint_funcs HB_UNUSED,
- void *paint_data HB_UNUSED,
- unsigned int palette HB_UNUSED,
- hb_color_t foreground HB_UNUSED,
- void *user_data HB_UNUSED)
+static hb_bool_t
+hb_font_paint_glyph_or_fail_nil (hb_font_t *font HB_UNUSED,
+ void *font_data HB_UNUSED,
+ hb_codepoint_t glyph HB_UNUSED,
+ hb_paint_funcs_t *paint_funcs HB_UNUSED,
+ void *paint_data HB_UNUSED,
+ unsigned int palette HB_UNUSED,
+ hb_color_t foreground HB_UNUSED,
+ void *user_data HB_UNUSED)
{
+ return false;
}
typedef struct hb_font_draw_glyph_default_adaptor_t {
@@ -551,7 +555,6 @@
void *draw_data;
float x_scale;
float y_scale;
- float slant;
} hb_font_draw_glyph_default_adaptor_t;
static void
@@ -564,10 +567,9 @@
hb_font_draw_glyph_default_adaptor_t *adaptor = (hb_font_draw_glyph_default_adaptor_t *) draw_data;
float x_scale = adaptor->x_scale;
float y_scale = adaptor->y_scale;
- float slant = adaptor->slant;
adaptor->draw_funcs->emit_move_to (adaptor->draw_data, *st,
- x_scale * to_x + slant * to_y, y_scale * to_y);
+ x_scale * to_x, y_scale * to_y);
}
static void
@@ -579,13 +581,12 @@
hb_font_draw_glyph_default_adaptor_t *adaptor = (hb_font_draw_glyph_default_adaptor_t *) draw_data;
float x_scale = adaptor->x_scale;
float y_scale = adaptor->y_scale;
- float slant = adaptor->slant;
- st->current_x = st->current_x * x_scale + st->current_y * slant;
+ st->current_x = st->current_x * x_scale;
st->current_y = st->current_y * y_scale;
adaptor->draw_funcs->emit_line_to (adaptor->draw_data, *st,
- x_scale * to_x + slant * to_y, y_scale * to_y);
+ x_scale * to_x, y_scale * to_y);
}
static void
@@ -598,14 +599,13 @@
hb_font_draw_glyph_default_adaptor_t *adaptor = (hb_font_draw_glyph_default_adaptor_t *) draw_data;
float x_scale = adaptor->x_scale;
float y_scale = adaptor->y_scale;
- float slant = adaptor->slant;
- st->current_x = st->current_x * x_scale + st->current_y * slant;
+ st->current_x = st->current_x * x_scale;
st->current_y = st->current_y * y_scale;
adaptor->draw_funcs->emit_quadratic_to (adaptor->draw_data, *st,
- x_scale * control_x + slant * control_y, y_scale * control_y,
- x_scale * to_x + slant * to_y, y_scale * to_y);
+ x_scale * control_x, y_scale * control_y,
+ x_scale * to_x, y_scale * to_y);
}
static void
@@ -619,15 +619,14 @@
hb_font_draw_glyph_default_adaptor_t *adaptor = (hb_font_draw_glyph_default_adaptor_t *) draw_data;
float x_scale = adaptor->x_scale;
float y_scale = adaptor->y_scale;
- float slant = adaptor->slant;
- st->current_x = st->current_x * x_scale + st->current_y * slant;
+ st->current_x = st->current_x * x_scale;
st->current_y = st->current_y * y_scale;
adaptor->draw_funcs->emit_cubic_to (adaptor->draw_data, *st,
- x_scale * control1_x + slant * control1_y, y_scale * control1_y,
- x_scale * control2_x + slant * control2_y, y_scale * control2_y,
- x_scale * to_x + slant * to_y, y_scale * to_y);
+ x_scale * control1_x, y_scale * control1_y,
+ x_scale * control2_x, y_scale * control2_y,
+ x_scale * to_x, y_scale * to_y);
}
static void
@@ -650,49 +649,47 @@
}
};
-static void
-hb_font_draw_glyph_default (hb_font_t *font,
- void *font_data HB_UNUSED,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs,
- void *draw_data,
- void *user_data HB_UNUSED)
+static hb_bool_t
+hb_font_draw_glyph_or_fail_default (hb_font_t *font,
+ void *font_data HB_UNUSED,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs,
+ void *draw_data,
+ void *user_data HB_UNUSED)
{
hb_font_draw_glyph_default_adaptor_t adaptor = {
draw_funcs,
draw_data,
font->parent->x_scale ? (float) font->x_scale / (float) font->parent->x_scale : 0.f,
- font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0.f,
- font->parent->y_scale ? (font->slant - font->parent->slant) *
- (float) font->x_scale / (float) font->parent->y_scale : 0.f
+ font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0.f
};
- font->parent->draw_glyph (glyph,
- const_cast<hb_draw_funcs_t *> (&_hb_draw_funcs_default),
- &adaptor);
+ return font->parent->draw_glyph_or_fail (glyph,
+ const_cast<hb_draw_funcs_t *> (&_hb_draw_funcs_default),
+ &adaptor,
+ false);
}
-static void
-hb_font_paint_glyph_default (hb_font_t *font,
- void *font_data,
- hb_codepoint_t glyph,
- hb_paint_funcs_t *paint_funcs,
- void *paint_data,
- unsigned int palette,
- hb_color_t foreground,
- void *user_data)
+static hb_bool_t
+hb_font_paint_glyph_or_fail_default (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs,
+ void *paint_data,
+ unsigned int palette,
+ hb_color_t foreground,
+ void *user_data)
{
paint_funcs->push_transform (paint_data,
- font->parent->x_scale ? (float) font->x_scale / (float) font->parent->x_scale : 0.f,
- font->parent->y_scale ? (font->slant - font->parent->slant) *
- (float) font->x_scale / (float) font->parent->y_scale : 0.f,
- 0.f,
- font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0.f,
- 0.f, 0.f);
+ font->parent->x_scale ? (float) font->x_scale / (float) font->parent->x_scale : 0, 0,
+ 0, font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0,
+ 0, 0);
- font->parent->paint_glyph (glyph, paint_funcs, paint_data, palette, foreground);
+ bool ret = font->parent->paint_glyph_or_fail (glyph, paint_funcs, paint_data, palette, foreground);
paint_funcs->pop_transform (paint_data);
+
+ return ret;
}
DEFINE_NULL_INSTANCE (hb_font_funcs_t) =
@@ -1430,6 +1427,92 @@
#endif
/**
+ * hb_font_draw_glyph_or_fail:
+ * @font: #hb_font_t to work upon
+ * @glyph: The glyph ID
+ * @dfuncs: #hb_draw_funcs_t to draw to
+ * @draw_data: User data to pass to draw callbacks
+ *
+ * Draws the outline that corresponds to a glyph in the specified @font.
+ *
+ * This is a newer name for hb_font_draw_glyph(), that returns `false`
+ * if the font has no outlines for the glyph.
+ *
+ * The outline is returned by way of calls to the callbacks of the @dfuncs
+ * objects, with @draw_data passed to them.
+ *
+ * Return value: `true` if glyph was drawn, `false` otherwise
+ *
+ * XSince: REPLACEME
+ **/
+hb_bool_t
+hb_font_draw_glyph_or_fail (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *dfuncs, void *draw_data)
+{
+ return font->draw_glyph_or_fail (glyph, dfuncs, draw_data);
+}
+
+/**
+ * hb_font_paint_glyph_or_fail:
+ * @font: #hb_font_t to work upon
+ * @glyph: The glyph ID
+ * @pfuncs: #hb_paint_funcs_t to paint with
+ * @paint_data: User data to pass to paint callbacks
+ * @palette_index: The index of the font's color palette to use
+ * @foreground: The foreground color, unpremultipled
+ *
+ * Paints a color glyph.
+ *
+ * This function is similar to, but lower-level than,
+ * hb_font_paint_glyph(). It is suitable for clients that
+ * need more control. If there are no color glyphs available,
+ * it will return `false`. The client can then fall back to
+ * hb_font_draw_glyph_or_fail() for the monochrome outline glyph.
+ *
+ * The painting instructions are returned by way of calls to
+ * the callbacks of the @funcs object, with @paint_data passed
+ * to them.
+ *
+ * If the font has color palettes (see hb_ot_color_has_palettes()),
+ * then @palette_index selects the palette to use. If the font only
+ * has one palette, this will be 0.
+ *
+ * Return value: `true` if glyph was painted, `false` otherwise
+ *
+ * XSince: REPLACEME
+ */
+hb_bool_t
+hb_font_paint_glyph_or_fail (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *pfuncs, void *paint_data,
+ unsigned int palette_index,
+ hb_color_t foreground)
+{
+ return font->paint_glyph_or_fail (glyph, pfuncs, paint_data, palette_index, foreground);
+}
+
+/* A bit higher-level, and with fallback */
+
+void
+hb_font_t::paint_glyph (hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette,
+ hb_color_t foreground)
+{
+ if (paint_glyph_or_fail (glyph,
+ paint_funcs, paint_data,
+ palette, foreground))
+ return;
+
+ /* Fallback for outline glyph. */
+ paint_funcs->push_clip_glyph (paint_data, glyph, this);
+ paint_funcs->color (paint_data, true, foreground);
+ paint_funcs->pop_clip (paint_data);
+}
+
+
+/**
* hb_font_draw_glyph:
* @font: #hb_font_t to work upon
* @glyph: The glyph ID
@@ -1438,6 +1521,9 @@
*
* Draws the outline that corresponds to a glyph in the specified @font.
*
+ * This is an older name for hb_font_draw_glyph_or_fail(), with no
+ * return value.
+ *
* The outline is returned by way of calls to the callbacks of the @dfuncs
* objects, with @draw_data passed to them.
*
@@ -1445,10 +1531,10 @@
**/
void
hb_font_draw_glyph (hb_font_t *font,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *dfuncs, void *draw_data)
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *dfuncs, void *draw_data)
{
- font->draw_glyph (glyph, dfuncs, draw_data);
+ (void) hb_font_draw_glyph_or_fail (font, glyph, dfuncs, draw_data);
}
/**
@@ -1460,7 +1546,10 @@
* @palette_index: The index of the font's color palette to use
* @foreground: The foreground color, unpremultipled
*
- * Paints the glyph.
+ * Paints the glyph. This function is similar to
+ * hb_font_paint_glyph_or_fail(), but if painting a color glyph
+ * failed, it will fall back to painting an outline monochrome
+ * glyph.
*
* The painting instructions are returned by way of calls to
* the callbacks of the @funcs object, with @paint_data passed
@@ -1482,8 +1571,6 @@
font->paint_glyph (glyph, pfuncs, paint_data, palette_index, foreground);
}
-/* A bit higher-level, and with fallback */
-
/**
* hb_font_get_extents_for_direction:
* @font: #hb_font_t to work upon
@@ -2609,6 +2696,23 @@
}
/**
+ * hb_font_is_synthetic:
+ * @font: #hb_font_t to work upon
+ *
+ * Tests whether a font is synthetic. A synthetic font is one
+ * that has either synthetic slant or synthetic bold set on it.
+ *
+ * Return value: `true` if the font is synthetic, `false` otherwise.
+ *
+ * XSince: REPLACEME
+ */
+hb_bool_t
+hb_font_is_synthetic (hb_font_t *font)
+{
+ return font->is_synthetic ();
+}
+
+/**
* hb_font_set_synthetic_bold:
* @font: #hb_font_t to work upon
* @x_embolden: the amount to embolden horizontally
@@ -2625,7 +2729,7 @@
* points of the glyph shape.
*
* Synthetic boldness is applied when rendering a glyph via
- * hb_font_draw_glyph().
+ * hb_font_draw_glyph_or_fail().
*
* If @in_place is `false`, then glyph advance-widths are also
* adjusted, otherwise they are not. The in-place mode is
@@ -2689,7 +2793,7 @@
* HarfBuzz needs to know this value to adjust shaping results,
* metrics, and style values to match the slanted rendering.
*
- * <note>Note: The glyph shape fetched via the hb_font_draw_glyph()
+ * <note>Note: The glyph shape fetched via the hb_font_draw_glyph_or_fail()
* function is slanted to reflect this value as well.</note>
*
* <note>Note: The slant value is a ratio. For example, a
@@ -3195,12 +3299,134 @@
#ifndef HB_DISABLE_DEPRECATED
+
+struct hb_draw_glyph_closure_t
+{
+ hb_font_draw_glyph_func_t func;
+ void *user_data;
+ hb_destroy_func_t destroy;
+};
+static hb_bool_t
+hb_font_draw_glyph_trampoline (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs,
+ void *draw_data,
+ void *user_data)
+{
+ hb_draw_glyph_closure_t *closure = (hb_draw_glyph_closure_t *) user_data;
+ closure->func (font, font_data, glyph, draw_funcs, draw_data, closure->user_data);
+ return true;
+}
+static void
+hb_font_draw_glyph_closure_destroy (void *user_data)
+{
+ hb_draw_glyph_closure_t *closure = (hb_draw_glyph_closure_t *) user_data;
+
+ if (closure->destroy)
+ closure->destroy (closure->user_data);
+ hb_free (closure);
+}
+static void
+_hb_font_funcs_set_draw_glyph_func (hb_font_funcs_t *ffuncs,
+ hb_font_draw_glyph_func_t func,
+ void *user_data,
+ hb_destroy_func_t destroy /* May be NULL. */)
+{
+ if (hb_object_is_immutable (ffuncs))
+ {
+ if (destroy)
+ destroy (user_data);
+ return;
+ }
+ hb_draw_glyph_closure_t *closure = (hb_draw_glyph_closure_t *) hb_calloc (1, sizeof (hb_draw_glyph_closure_t));
+ if (unlikely (!closure))
+ {
+ if (destroy)
+ destroy (user_data);
+ return;
+ }
+ closure->func = func;
+ closure->user_data = user_data;
+ closure->destroy = destroy;
+
+ hb_font_funcs_set_draw_glyph_or_fail_func (ffuncs,
+ hb_font_draw_glyph_trampoline,
+ closure,
+ hb_font_draw_glyph_closure_destroy);
+}
void
+hb_font_funcs_set_draw_glyph_func (hb_font_funcs_t *ffuncs,
+ hb_font_draw_glyph_func_t func,
+ void *user_data,
+ hb_destroy_func_t destroy /* May be NULL. */)
+{
+ _hb_font_funcs_set_draw_glyph_func (ffuncs, func, user_data, destroy);
+}
+void
hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
hb_font_get_glyph_shape_func_t func,
void *user_data,
hb_destroy_func_t destroy /* May be NULL. */)
{
- hb_font_funcs_set_draw_glyph_func (ffuncs, func, user_data, destroy);
+ _hb_font_funcs_set_draw_glyph_func (ffuncs, func, user_data, destroy);
}
+
+struct hb_paint_glyph_closure_t
+{
+ hb_font_paint_glyph_func_t func;
+ void *user_data;
+ hb_destroy_func_t destroy;
+};
+static hb_bool_t
+hb_font_paint_glyph_trampoline (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs,
+ void *paint_data,
+ unsigned int palette,
+ hb_color_t foreground,
+ void *user_data)
+{
+ hb_paint_glyph_closure_t *closure = (hb_paint_glyph_closure_t *) user_data;
+ closure->func (font, font_data, glyph, paint_funcs, paint_data, palette, foreground, closure->user_data);
+ return true;
+}
+static void
+hb_font_paint_glyph_closure_destroy (void *user_data)
+{
+ hb_paint_glyph_closure_t *closure = (hb_paint_glyph_closure_t *) user_data;
+
+ if (closure->destroy)
+ closure->destroy (closure->user_data);
+ hb_free (closure);
+}
+void
+hb_font_funcs_set_paint_glyph_func (hb_font_funcs_t *ffuncs,
+ hb_font_paint_glyph_func_t func,
+ void *user_data,
+ hb_destroy_func_t destroy /* May be NULL. */)
+{
+ if (hb_object_is_immutable (ffuncs))
+ {
+ if (destroy)
+ destroy (user_data);
+ return;
+ }
+ hb_paint_glyph_closure_t *closure = (hb_paint_glyph_closure_t *) hb_calloc (1, sizeof (hb_paint_glyph_closure_t));
+ if (unlikely (!closure))
+ {
+ if (destroy)
+ destroy (user_data);
+ return;
+ }
+ closure->func = func;
+ closure->user_data = user_data;
+ closure->destroy = destroy;
+
+ hb_font_funcs_set_paint_glyph_or_fail_func (ffuncs,
+ hb_font_paint_glyph_trampoline,
+ closure,
+ hb_font_paint_glyph_closure_destroy);
+}
#endif
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.h 2025-04-28 23:16:31 UTC (rev 75046)
@@ -486,7 +486,7 @@
void *user_data);
/**
- * hb_font_draw_glyph_func_t:
+ * hb_font_draw_glyph_or_fail_func_t:
* @font: #hb_font_t to work upon
* @font_data: @font user data pointer
* @glyph: The glyph ID to query
@@ -496,16 +496,17 @@
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
- * Since: 7.0.0
+ * Return value: `true` if glyph was drawn, `false` otherwise
*
+ * XSince: REPLACEME
**/
-typedef void (*hb_font_draw_glyph_func_t) (hb_font_t *font, void *font_data,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs, void *draw_data,
- void *user_data);
+typedef hb_bool_t (*hb_font_draw_glyph_or_fail_func_t) (hb_font_t *font, void *font_data,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ void *user_data);
/**
- * hb_font_paint_glyph_func_t:
+ * hb_font_paint_glyph_or_fail_func_t:
* @font: #hb_font_t to work upon
* @font_data: @font user data pointer
* @glyph: The glyph ID to query
@@ -517,14 +518,16 @@
*
* A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
*
- * Since: 7.0.0
+ * Return value: `true` if glyph was painted, `false` otherwise
+ *
+ * XSince: REPLACEME
*/
-typedef void (*hb_font_paint_glyph_func_t) (hb_font_t *font, void *font_data,
- hb_codepoint_t glyph,
- hb_paint_funcs_t *paint_funcs, void *paint_data,
- unsigned int palette_index,
- hb_color_t foreground,
- void *user_data);
+typedef hb_bool_t (*hb_font_paint_glyph_or_fail_func_t) (hb_font_t *font, void *font_data,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette_index,
+ hb_color_t foreground,
+ void *user_data);
/* func setters */
@@ -785,36 +788,36 @@
void *user_data, hb_destroy_func_t destroy);
/**
- * hb_font_funcs_set_draw_glyph_func:
+ * hb_font_funcs_set_draw_glyph_or_fail_func:
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (nullable): The function to call when @user_data is not needed anymore
*
- * Sets the implementation function for #hb_font_draw_glyph_func_t.
+ * Sets the implementation function for #hb_font_draw_glyph_or_fail_func_t.
*
- * Since: 7.0.0
+ * XSince: REPLACEME
**/
HB_EXTERN void
-hb_font_funcs_set_draw_glyph_func (hb_font_funcs_t *ffuncs,
- hb_font_draw_glyph_func_t func,
- void *user_data, hb_destroy_func_t destroy);
+hb_font_funcs_set_draw_glyph_or_fail_func (hb_font_funcs_t *ffuncs,
+ hb_font_draw_glyph_or_fail_func_t func,
+ void *user_data, hb_destroy_func_t destroy);
/**
- * hb_font_funcs_set_paint_glyph_func:
+ * hb_font_funcs_set_paint_glyph_or_fail_func:
* @ffuncs: A font-function structure
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
* @user_data: Data to pass to @func
* @destroy: (nullable): The function to call when @user_data is no longer needed
*
- * Sets the implementation function for #hb_font_paint_glyph_func_t.
+ * Sets the implementation function for #hb_font_paint_glyph_or_fail_func_t.
*
- * Since: 7.0.0
+ * XSince: REPLACEME
*/
HB_EXTERN void
-hb_font_funcs_set_paint_glyph_func (hb_font_funcs_t *ffuncs,
- hb_font_paint_glyph_func_t func,
- void *user_data, hb_destroy_func_t destroy);
+hb_font_funcs_set_paint_glyph_or_fail_func (hb_font_funcs_t *ffuncs,
+ hb_font_paint_glyph_or_fail_func_t func,
+ void *user_data, hb_destroy_func_t destroy);
/* func dispatch */
@@ -896,17 +899,17 @@
const char *name, int len, /* -1 means nul-terminated */
hb_codepoint_t *glyph);
-HB_EXTERN void
-hb_font_draw_glyph (hb_font_t *font,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *dfuncs, void *draw_data);
+HB_EXTERN hb_bool_t
+hb_font_draw_glyph_or_fail (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *dfuncs, void *draw_data);
-HB_EXTERN void
-hb_font_paint_glyph (hb_font_t *font,
- hb_codepoint_t glyph,
- hb_paint_funcs_t *pfuncs, void *paint_data,
- unsigned int palette_index,
- hb_color_t foreground);
+HB_EXTERN hb_bool_t
+hb_font_paint_glyph_or_fail (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *pfuncs, void *paint_data,
+ unsigned int palette_index,
+ hb_color_t foreground);
/* high-level funcs, with fallback */
@@ -979,7 +982,20 @@
const char *s, int len, /* -1 means nul-terminated */
hb_codepoint_t *glyph);
+/* Older alias for hb_font_draw_glyph_or_fail() with no return value. */
+HB_EXTERN void
+hb_font_draw_glyph (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *dfuncs, void *draw_data);
+/* Paints color glyph; if failed, draws outline glyph. */
+HB_EXTERN void
+hb_font_paint_glyph (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *pfuncs, void *paint_data,
+ unsigned int palette_index,
+ hb_color_t foreground);
+
/*
* hb_font_t
*/
@@ -1092,6 +1108,9 @@
HB_EXTERN float
hb_font_get_ptem (hb_font_t *font);
+HB_EXTERN hb_bool_t
+hb_font_is_synthetic (hb_font_t *font);
+
HB_EXTERN void
hb_font_set_synthetic_bold (hb_font_t *font,
float x_embolden, float y_embolden,
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -33,6 +33,8 @@
#include "hb-face.hh"
#include "hb-atomic.hh"
+#include "hb-draw.hh"
+#include "hb-paint-extents.hh"
#include "hb-shaper.hh"
#include "hb-outline.hh"
@@ -59,8 +61,8 @@
HB_FONT_FUNC_IMPLEMENT (get_,glyph_contour_point) \
HB_FONT_FUNC_IMPLEMENT (get_,glyph_name) \
HB_FONT_FUNC_IMPLEMENT (get_,glyph_from_name) \
- HB_FONT_FUNC_IMPLEMENT (,draw_glyph) \
- HB_FONT_FUNC_IMPLEMENT (,paint_glyph) \
+ HB_FONT_FUNC_IMPLEMENT (,draw_glyph_or_fail) \
+ HB_FONT_FUNC_IMPLEMENT (,paint_glyph_or_fail) \
/* ^--- Add new callbacks here */
struct hb_font_funcs_t
@@ -206,7 +208,7 @@
void synthetic_glyph_extents (hb_glyph_extents_t *extents)
{
- /* Apply slant. */
+ /* Slant. */
if (slant_xy)
{
hb_position_t x1 = extents->x_bearing;
@@ -221,6 +223,7 @@
extents->width = x2 - extents->x_bearing;
}
+ /* Embolden. */
if (x_strength || y_strength)
{
/* Y */
@@ -263,19 +266,45 @@
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_FONT_FUNC_IMPLEMENT
- hb_bool_t get_font_h_extents (hb_font_extents_t *extents)
+ hb_bool_t get_font_h_extents (hb_font_extents_t *extents,
+ bool synthetic = true)
{
hb_memset (extents, 0, sizeof (*extents));
- return klass->get.f.font_h_extents (this, user_data,
- extents,
- !klass->user_data ? nullptr : klass->user_data->font_h_extents);
+ bool ret = klass->get.f.font_h_extents (this, user_data,
+ extents,
+ !klass->user_data ? nullptr : klass->user_data->font_h_extents);
+
+ if (synthetic && ret)
+ {
+ /* Embolden */
+ int y_shift = y_scale < 0 ? -y_strength : y_strength;
+ extents->ascender += y_shift;
+ }
+
+ return ret;
}
- hb_bool_t get_font_v_extents (hb_font_extents_t *extents)
+ hb_bool_t get_font_v_extents (hb_font_extents_t *extents,
+ bool synthetic = true)
{
hb_memset (extents, 0, sizeof (*extents));
- return klass->get.f.font_v_extents (this, user_data,
- extents,
- !klass->user_data ? nullptr : klass->user_data->font_v_extents);
+ bool ret = klass->get.f.font_v_extents (this, user_data,
+ extents,
+ !klass->user_data ? nullptr : klass->user_data->font_v_extents);
+
+ if (synthetic && ret)
+ {
+ /* Embolden */
+ int x_shift = x_scale < 0 ? -x_strength : x_strength;
+ if (embolden_in_place)
+ {
+ extents->ascender += x_shift / 2;
+ extents->descender -= x_shift - x_shift / 2;
+ }
+ else
+ extents->ascender += x_shift;
+ }
+
+ return ret;
}
bool has_glyph (hb_codepoint_t unicode)
@@ -316,15 +345,16 @@
!klass->user_data ? nullptr : klass->user_data->variation_glyph);
}
- hb_position_t get_glyph_h_advance (hb_codepoint_t glyph)
+ hb_position_t get_glyph_h_advance (hb_codepoint_t glyph,
+ bool synthetic = true)
{
hb_position_t advance = klass->get.f.glyph_h_advance (this, user_data,
glyph,
!klass->user_data ? nullptr : klass->user_data->glyph_h_advance);
- if (x_strength && !embolden_in_place)
+ if (synthetic && x_strength && !embolden_in_place)
{
- /* Emboldening. */
+ /* Embolden */
hb_position_t strength = x_scale >= 0 ? x_strength : -x_strength;
advance += advance ? strength : 0;
}
@@ -332,15 +362,16 @@
return advance;
}
- hb_position_t get_glyph_v_advance (hb_codepoint_t glyph)
+ hb_position_t get_glyph_v_advance (hb_codepoint_t glyph,
+ bool synthetic = true)
{
hb_position_t advance = klass->get.f.glyph_v_advance (this, user_data,
glyph,
!klass->user_data ? nullptr : klass->user_data->glyph_v_advance);
- if (y_strength && !embolden_in_place)
+ if (synthetic && y_strength && !embolden_in_place)
{
- /* Emboldening. */
+ /* Embolden */
hb_position_t strength = y_scale >= 0 ? y_strength : -y_strength;
advance += advance ? strength : 0;
}
@@ -352,7 +383,8 @@
const hb_codepoint_t *first_glyph,
unsigned int glyph_stride,
hb_position_t *first_advance,
- unsigned int advance_stride)
+ unsigned int advance_stride,
+ bool synthetic = true)
{
klass->get.f.glyph_h_advances (this, user_data,
count,
@@ -360,9 +392,9 @@
first_advance, advance_stride,
!klass->user_data ? nullptr : klass->user_data->glyph_h_advances);
- if (x_strength && !embolden_in_place)
+ if (synthetic && x_strength && !embolden_in_place)
{
- /* Emboldening. */
+ /* Embolden */
hb_position_t strength = x_scale >= 0 ? x_strength : -x_strength;
for (unsigned int i = 0; i < count; i++)
{
@@ -376,7 +408,8 @@
const hb_codepoint_t *first_glyph,
unsigned int glyph_stride,
hb_position_t *first_advance,
- unsigned int advance_stride)
+ unsigned int advance_stride,
+ bool synthetic = true)
{
klass->get.f.glyph_v_advances (this, user_data,
count,
@@ -384,9 +417,9 @@
first_advance, advance_stride,
!klass->user_data ? nullptr : klass->user_data->glyph_v_advances);
- if (y_strength && !embolden_in_place)
+ if (synthetic && y_strength && !embolden_in_place)
{
- /* Emboldening. */
+ /* Embolden */
hb_position_t strength = y_scale >= 0 ? y_strength : -y_strength;
for (unsigned int i = 0; i < count; i++)
{
@@ -439,9 +472,47 @@
}
hb_bool_t get_glyph_extents (hb_codepoint_t glyph,
- hb_glyph_extents_t *extents)
+ hb_glyph_extents_t *extents,
+ bool synthetic = true)
{
hb_memset (extents, 0, sizeof (*extents));
+
+ /* This is rather messy, but necessary. */
+
+ if (!synthetic)
+ {
+ return klass->get.f.glyph_extents (this, user_data,
+ glyph,
+ extents,
+ !klass->user_data ? nullptr : klass->user_data->glyph_extents);
+ }
+ if (!is_synthetic () &&
+ klass->get.f.glyph_extents (this, user_data,
+ glyph,
+ extents,
+ !klass->user_data ? nullptr : klass->user_data->glyph_extents))
+ return true;
+
+ /* Try getting extents from paint(), then draw(), *then* get_extents()
+ * and apply synthetic settings in the last case. */
+
+ hb_paint_extents_context_t paint_extents;
+ if (paint_glyph_or_fail (glyph,
+ hb_paint_extents_get_funcs (), &paint_extents,
+ 0, 0))
+ {
+ *extents = paint_extents.get_extents ().to_glyph_extents ();
+ return true;
+ }
+
+ hb_extents_t draw_extents;
+ if (draw_glyph_or_fail (glyph,
+ hb_draw_extents_get_funcs (), &draw_extents))
+ {
+ *extents = draw_extents.to_glyph_extents ();
+ return true;
+ }
+
bool ret = klass->get.f.glyph_extents (this, user_data,
glyph,
extents,
@@ -453,13 +524,30 @@
}
hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index,
- hb_position_t *x, hb_position_t *y)
+ hb_position_t *x, hb_position_t *y,
+ bool synthetic = true)
{
*x = *y = 0;
- return klass->get.f.glyph_contour_point (this, user_data,
- glyph, point_index,
- x, y,
- !klass->user_data ? nullptr : klass->user_data->glyph_contour_point);
+ bool ret = klass->get.f.glyph_contour_point (this, user_data,
+ glyph, point_index,
+ x, y,
+ !klass->user_data ? nullptr : klass->user_data->glyph_contour_point);
+
+ if (synthetic && ret)
+ {
+ /* Slant */
+ if (slant_xy)
+ *x += roundf (*y * slant_xy);
+
+ /* Embolden */
+ if (!embolden_in_place)
+ {
+ int x_shift = x_scale < 0 ? -x_strength : x_strength;
+ *x += x_shift;
+ }
+ }
+
+ return ret;
}
hb_bool_t get_glyph_name (hb_codepoint_t glyph,
@@ -483,56 +571,88 @@
!klass->user_data ? nullptr : klass->user_data->glyph_from_name);
}
- void draw_glyph (hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs, void *draw_data)
+ bool draw_glyph_or_fail (hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ bool synthetic = true)
{
#ifndef HB_NO_OUTLINE
bool embolden = x_strength || y_strength;
+ bool slanted = slant_xy;
+ synthetic = synthetic && (embolden || slanted);
#else
- constexpr bool embolden = false;
+ synthetic = false;
#endif
- if (!embolden)
+ if (!synthetic)
{
- klass->get.f.draw_glyph (this, user_data,
- glyph,
- draw_funcs, draw_data,
- !klass->user_data ? nullptr : klass->user_data->draw_glyph);
- return;
+ return klass->get.f.draw_glyph_or_fail (this, user_data,
+ glyph,
+ draw_funcs, draw_data,
+ !klass->user_data ? nullptr : klass->user_data->draw_glyph_or_fail);
}
#ifndef HB_NO_OUTLINE
- /* Emboldening. */
+
hb_outline_t outline;
- klass->get.f.draw_glyph (this, user_data,
- glyph,
- hb_outline_recording_pen_get_funcs (), &outline,
- !klass->user_data ? nullptr : klass->user_data->draw_glyph);
+ if (!klass->get.f.draw_glyph_or_fail (this, user_data,
+ glyph,
+ hb_outline_recording_pen_get_funcs (), &outline,
+ !klass->user_data ? nullptr : klass->user_data->draw_glyph_or_fail))
+ return false;
- float x_shift = embolden_in_place ? 0 : (float) x_strength / 2;
- float y_shift = (float) y_strength / 2;
- if (x_scale < 0) x_shift = -x_shift;
- if (y_scale < 0) y_shift = -y_shift;
- outline.embolden (x_strength, y_strength, x_shift, y_shift);
+ // Slant before embolden; produces nicer results.
+ if (slanted)
+ outline.slant (slant_xy);
+
+ if (embolden)
+ {
+ float x_shift = embolden_in_place ? 0 : (float) x_strength / 2;
+ float y_shift = (float) y_strength / 2;
+ if (x_scale < 0) x_shift = -x_shift;
+ if (y_scale < 0) y_shift = -y_shift;
+ outline.embolden (x_strength, y_strength, x_shift, y_shift);
+ }
+
outline.replay (draw_funcs, draw_data);
+
+ return true;
#endif
}
- void paint_glyph (hb_codepoint_t glyph,
- hb_paint_funcs_t *paint_funcs, void *paint_data,
- unsigned int palette,
- hb_color_t foreground)
+ bool paint_glyph_or_fail (hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette,
+ hb_color_t foreground,
+ bool synthetic = true)
{
- klass->get.f.paint_glyph (this, user_data,
- glyph,
- paint_funcs, paint_data,
- palette, foreground,
- !klass->user_data ? nullptr : klass->user_data->paint_glyph);
+ /* Slant */
+ if (synthetic && slant_xy)
+ hb_paint_push_transform (paint_funcs, paint_data,
+ 1.f, 0.f,
+ slant_xy, 1.f,
+ 0.f, 0.f);
+
+ bool ret = klass->get.f.paint_glyph_or_fail (this, user_data,
+ glyph,
+ paint_funcs, paint_data,
+ palette, foreground,
+ !klass->user_data ? nullptr : klass->user_data->paint_glyph_or_fail);
+
+ if (synthetic && slant_xy)
+ hb_paint_pop_transform (paint_funcs, paint_data);
+
+ return ret;
}
/* A bit higher-level, and with fallback */
+ HB_INTERNAL
+ void paint_glyph (hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette,
+ hb_color_t foreground);
+
void get_h_extents_with_fallback (hb_font_extents_t *extents)
{
if (!get_font_h_extents (extents))
@@ -770,6 +890,11 @@
return false;
}
+ bool is_synthetic () const
+ {
+ return x_embolden || y_embolden || slant;
+ }
+
void changed ()
{
float upem = face->get_upem ();
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft-colr.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft-colr.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft-colr.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -28,7 +28,7 @@
#include "hb.hh"
#include "hb-decycler.hh"
-#include "hb-paint-extents.hh"
+#include "hb-paint-bounded.hh"
#include FT_COLOR_H
@@ -80,16 +80,31 @@
struct hb_ft_paint_context_t
{
- hb_ft_paint_context_t (const hb_ft_font_t *ft_font,
- hb_font_t *font,
+ hb_ft_paint_context_t (const hb_ft_font_t *ft_font_,
+ hb_font_t *font_,
hb_paint_funcs_t *paint_funcs, void *paint_data,
hb_array_t<const FT_Color> palette,
unsigned palette_index,
hb_color_t foreground) :
- ft_font (ft_font), font(font),
+ ft_font (ft_font_), font (font_),
funcs (paint_funcs), data (paint_data),
- palette (palette), palette_index (palette_index), foreground (foreground) {}
+ palette (palette), palette_index (palette_index), foreground (foreground)
+ {
+ if (font->is_synthetic ())
+ {
+ font = hb_font_create_sub_font (font);
+ hb_font_set_synthetic_bold (font, 0, 0, true);
+ hb_font_set_synthetic_slant (font, 0);
+ }
+ else
+ hb_font_reference (font);
+ }
+ ~hb_ft_paint_context_t ()
+ {
+ hb_font_destroy (font);
+ }
+
void recurse (FT_OpaquePaint paint)
{
if (unlikely (depth_left <= 0 || edge_count <= 0)) return;
@@ -512,53 +527,42 @@
hb_decycler_node_t node (c.glyphs_decycler);
node.visit (gid);
- bool is_bounded = true;
+ bool clip = false;
+ bool is_bounded = false;
FT_ClipBox clip_box;
if (FT_Get_Color_Glyph_ClipBox (ft_face, gid, &clip_box))
{
c.funcs->push_clip_rectangle (c.data,
- clip_box.bottom_left.x +
- roundf (hb_min (font->slant_xy * clip_box.bottom_left.y,
- font->slant_xy * clip_box.top_left.y)),
+ clip_box.bottom_left.x,
clip_box.bottom_left.y,
- clip_box.top_right.x +
- roundf (hb_max (font->slant_xy * clip_box.bottom_right.y,
- font->slant_xy * clip_box.top_right.y)),
+ clip_box.top_right.x,
clip_box.top_right.y);
+ clip = true;
+ is_bounded = true;
}
- else
+ if (!is_bounded)
{
-
- auto *extents_funcs = hb_paint_extents_get_funcs ();
- hb_paint_extents_context_t extents_data;
+ auto *bounded_funcs = hb_paint_bounded_get_funcs ();
+ hb_paint_bounded_context_t bounded_data;
hb_ft_paint_context_t ce (ft_font, font,
- extents_funcs, &extents_data,
+ bounded_funcs, &bounded_data,
palette_array, palette_index, foreground);
hb_decycler_node_t node2 (ce.glyphs_decycler);
node2.visit (gid);
- ce.funcs->push_font_transform (ce.data, font);
ce.recurse (paint);
- ce.funcs->pop_transform (ce.data);
- hb_extents_t extents = extents_data.get_extents ();
- is_bounded = extents_data.is_bounded ();
-
- c.funcs->push_clip_rectangle (c.data,
- extents.xmin,
- extents.ymin,
- extents.xmax,
- extents.ymax);
+ is_bounded = bounded_data.is_bounded ();
}
c.funcs->push_font_transform (c.data, font);
if (is_bounded)
- {
c.recurse (paint);
- }
c.funcs->pop_transform (c.data);
- c.funcs->pop_clip (c.data);
+ if (clip)
+ c.funcs->pop_clip (c.data);
+
return true;
}
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -626,6 +626,41 @@
}
#endif
+static bool
+hb_ft_is_colr_glyph (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t gid)
+{
+#ifndef HB_NO_PAINT
+#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300
+ const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
+ FT_Face ft_face = ft_font->ft_face;
+
+
+ /* COLRv1 */
+ FT_OpaquePaint paint = {0};
+ if (FT_Get_Color_Glyph_Paint (ft_face, gid,
+ FT_COLOR_NO_ROOT_TRANSFORM,
+ &paint))
+ return true;
+
+ /* COLRv0 */
+ FT_LayerIterator iterator;
+ FT_UInt layer_glyph_index;
+ FT_UInt layer_color_index;
+ iterator.p = NULL;
+ if (FT_Get_Color_Glyph_Layer (ft_face,
+ gid,
+ &layer_glyph_index,
+ &layer_color_index,
+ &iterator))
+ return true;
+#endif
+#endif
+
+ return false;
+}
+
static hb_bool_t
hb_ft_get_glyph_extents (hb_font_t *font,
void *font_data,
@@ -633,6 +668,10 @@
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
+ // FreeType doesn't return COLR glyph extents.
+ if (hb_ft_is_colr_glyph (font, font_data, glyph))
+ return false;
+
const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
_hb_ft_hb_font_check_changed (font, ft_font);
@@ -797,7 +836,7 @@
metrics->line_gap = ft_face->size->metrics.height - (metrics->ascender - metrics->descender);
}
- metrics->ascender = (hb_position_t) (y_mult * (metrics->ascender + font->y_strength));
+ metrics->ascender = (hb_position_t) (y_mult * metrics->ascender);
metrics->descender = (hb_position_t) (y_mult * metrics->descender);
metrics->line_gap = (hb_position_t) (y_mult * metrics->line_gap);
@@ -848,12 +887,12 @@
return FT_Err_Ok;
}
-static void
-hb_ft_draw_glyph (hb_font_t *font,
- void *font_data,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs, void *draw_data,
- void *user_data HB_UNUSED)
+static hb_bool_t
+hb_ft_draw_glyph_or_fail (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ void *user_data HB_UNUSED)
{
const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
_hb_ft_hb_font_check_changed (font, ft_font);
@@ -863,10 +902,10 @@
if (unlikely (FT_Load_Glyph (ft_face, glyph,
FT_LOAD_NO_BITMAP | ft_font->load_flags)))
- return;
+ return false;
if (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
- return;
+ return false;
const FT_Outline_Funcs outline_funcs = {
_hb_ft_move_to,
@@ -877,11 +916,13 @@
0, /* delta */
};
- hb_draw_session_t draw_session (draw_funcs, draw_data, font->slant_xy);
+ hb_draw_session_t draw_session {draw_funcs, draw_data};
FT_Outline_Decompose (&ft_face->glyph->outline,
&outline_funcs,
&draw_session);
+
+ return true;
}
#endif
@@ -890,14 +931,14 @@
#include "hb-ft-colr.hh"
-static void
-hb_ft_paint_glyph (hb_font_t *font,
- void *font_data,
- hb_codepoint_t gid,
- hb_paint_funcs_t *paint_funcs, void *paint_data,
- unsigned int palette_index,
- hb_color_t foreground,
- void *user_data)
+static hb_bool_t
+hb_ft_paint_glyph_or_fail (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t gid,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette_index,
+ hb_color_t foreground,
+ void *user_data)
{
const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
_hb_ft_hb_font_check_changed (font, ft_font);
@@ -905,7 +946,7 @@
hb_lock_t lock (ft_font->lock);
FT_Face ft_face = ft_font->ft_face;
- FT_Long load_flags = ft_font->load_flags | FT_LOAD_NO_BITMAP | FT_LOAD_COLOR;
+ FT_Long load_flags = ft_font->load_flags | FT_LOAD_COLOR;
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21301
load_flags |= FT_LOAD_NO_SVG;
#endif
@@ -914,7 +955,7 @@
* eg. draw API can call back into the face.*/
if (unlikely (FT_Load_Glyph (ft_face, gid, load_flags)))
- return;
+ return false;
if (ft_face->glyph->format == FT_GLYPH_FORMAT_OUTLINE)
{
@@ -922,26 +963,21 @@
paint_funcs, paint_data,
palette_index, foreground,
user_data))
- return;
+ return true;
- /* Simple outline. */
- ft_font->lock.unlock ();
- paint_funcs->push_clip_glyph (paint_data, gid, font);
- ft_font->lock.lock ();
- paint_funcs->color (paint_data, true, foreground);
- paint_funcs->pop_clip (paint_data);
-
- return;
+ // Outline glyph
+ return false;
}
auto *glyph = ft_face->glyph;
if (glyph->format == FT_GLYPH_FORMAT_BITMAP)
{
+ bool ret = false;
auto &bitmap = glyph->bitmap;
if (bitmap.pixel_mode == FT_PIXEL_MODE_BGRA)
{
if (bitmap.pitch != (signed) bitmap.width * 4)
- return;
+ return ret;
ft_font->lock.unlock ();
@@ -951,19 +987,17 @@
nullptr, nullptr);
hb_glyph_extents_t extents;
- if (!hb_font_get_glyph_extents (font, gid, &extents))
+ if (!font->get_glyph_extents (gid, &extents, false))
goto out;
- if (!paint_funcs->image (paint_data,
- blob,
- bitmap.width,
- bitmap.rows,
- HB_PAINT_IMAGE_FORMAT_BGRA,
- font->slant_xy,
- &extents))
- {
- /* TODO Try a forced outline load and paint? */
- }
+ if (paint_funcs->image (paint_data,
+ blob,
+ bitmap.width,
+ bitmap.rows,
+ HB_PAINT_IMAGE_FORMAT_BGRA,
+ 0.f,
+ &extents))
+ ret = true;
out:
hb_blob_destroy (blob);
@@ -970,8 +1004,9 @@
ft_font->lock.lock ();
}
- return;
+ return ret;
}
+ return false;
}
#endif
#endif
@@ -1006,12 +1041,12 @@
hb_font_funcs_set_glyph_from_name_func (funcs, hb_ft_get_glyph_from_name, nullptr, nullptr);
#ifndef HB_NO_DRAW
- hb_font_funcs_set_draw_glyph_func (funcs, hb_ft_draw_glyph, nullptr, nullptr);
+ hb_font_funcs_set_draw_glyph_or_fail_func (funcs, hb_ft_draw_glyph_or_fail, nullptr, nullptr);
#endif
#ifndef HB_NO_PAINT
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) >= 21300
- hb_font_funcs_set_paint_glyph_func (funcs, hb_ft_paint_glyph, nullptr, nullptr);
+ hb_font_funcs_set_paint_glyph_or_fail_func (funcs, hb_ft_paint_glyph_or_fail, nullptr, nullptr);
#endif
#endif
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-machinery.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -273,7 +273,7 @@
private:
/* Must only have one pointer. */
- hb_atomic_t<Stored *> instance;
+ mutable hb_atomic_t<Stored *> instance;
};
/* Specializations. */
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-font.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -412,9 +412,6 @@
const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
const hb_ot_face_t *ot_face = ot_font->ot_face;
-#ifndef HB_NO_VAR_COMPOSITES
- if (ot_face->VARC->get_extents (font, glyph, extents)) return true;
-#endif
#if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR)
if (ot_face->sbix->get_extents (font, glyph, extents)) return true;
if (ot_face->CBDT->get_extents (font, glyph, extents)) return true;
@@ -422,6 +419,9 @@
#if !defined(HB_NO_COLOR) && !defined(HB_NO_PAINT)
if (ot_face->COLR->get_extents (font, glyph, extents)) return true;
#endif
+#ifndef HB_NO_VAR_COMPOSITES
+ if (ot_face->VARC->get_extents (font, glyph, extents)) return true;
+#endif
if (ot_face->glyf->get_extents (font, glyph, extents)) return true;
#ifndef HB_NO_OT_FONT_CFF
if (ot_face->cff2->get_extents (font, glyph, extents)) return true;
@@ -472,16 +472,9 @@
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- bool ret = _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, &metrics->ascender) &&
- _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER, &metrics->descender) &&
- _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP, &metrics->line_gap);
-
- /* Embolden */
- int y_shift = font->y_strength;
- if (font->y_scale < 0) y_shift = -y_shift;
- metrics->ascender += y_shift;
-
- return ret;
+ return _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, &metrics->ascender) &&
+ _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER, &metrics->descender) &&
+ _hb_ot_metrics_get_position_common (font, HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP, &metrics->line_gap);
}
#ifndef HB_NO_VERTICAL
@@ -498,50 +491,46 @@
#endif
#ifndef HB_NO_DRAW
-static void
-hb_ot_draw_glyph (hb_font_t *font,
- void *font_data HB_UNUSED,
- hb_codepoint_t glyph,
- hb_draw_funcs_t *draw_funcs, void *draw_data,
- void *user_data)
+static hb_bool_t
+hb_ot_draw_glyph_or_fail (hb_font_t *font,
+ void *font_data HB_UNUSED,
+ hb_codepoint_t glyph,
+ hb_draw_funcs_t *draw_funcs, void *draw_data,
+ void *user_data)
{
- hb_draw_session_t draw_session (draw_funcs, draw_data, font->slant_xy);
+ hb_draw_session_t draw_session {draw_funcs, draw_data};
#ifndef HB_NO_VAR_COMPOSITES
- if (!font->face->table.VARC->get_path (font, glyph, draw_session))
+ if (font->face->table.VARC->get_path (font, glyph, draw_session)) return true;
#endif
// Keep the following in synch with VARC::get_path_at()
- if (!font->face->table.glyf->get_path (font, glyph, draw_session))
+ if (font->face->table.glyf->get_path (font, glyph, draw_session)) return true;
#ifndef HB_NO_CFF
- if (!font->face->table.cff2->get_path (font, glyph, draw_session))
- if (!font->face->table.cff1->get_path (font, glyph, draw_session))
+ if (font->face->table.cff2->get_path (font, glyph, draw_session)) return true;
+ if (font->face->table.cff1->get_path (font, glyph, draw_session)) return true;
#endif
- {}
+ return false;
}
#endif
#ifndef HB_NO_PAINT
-static void
-hb_ot_paint_glyph (hb_font_t *font,
- void *font_data,
- hb_codepoint_t glyph,
- hb_paint_funcs_t *paint_funcs, void *paint_data,
- unsigned int palette,
- hb_color_t foreground,
- void *user_data)
+static hb_bool_t
+hb_ot_paint_glyph_or_fail (hb_font_t *font,
+ void *font_data,
+ hb_codepoint_t glyph,
+ hb_paint_funcs_t *paint_funcs, void *paint_data,
+ unsigned int palette,
+ hb_color_t foreground,
+ void *user_data)
{
#ifndef HB_NO_COLOR
- if (font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data, palette, foreground)) return;
- if (font->face->table.SVG->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
+ if (font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data, palette, foreground)) return true;
+ if (font->face->table.SVG->paint_glyph (font, glyph, paint_funcs, paint_data)) return true;
#ifndef HB_NO_OT_FONT_BITMAP
- if (font->face->table.CBDT->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
- if (font->face->table.sbix->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
+ if (font->face->table.CBDT->paint_glyph (font, glyph, paint_funcs, paint_data)) return true;
+ if (font->face->table.sbix->paint_glyph (font, glyph, paint_funcs, paint_data)) return true;
#endif
#endif
-
- // Outline glyph
- paint_funcs->push_clip_glyph (paint_data, glyph, font);
- paint_funcs->color (paint_data, true, foreground);
- paint_funcs->pop_clip (paint_data);
+ return false;
}
#endif
@@ -568,11 +557,11 @@
#endif
#ifndef HB_NO_DRAW
- hb_font_funcs_set_draw_glyph_func (funcs, hb_ot_draw_glyph, nullptr, nullptr);
+ hb_font_funcs_set_draw_glyph_or_fail_func (funcs, hb_ot_draw_glyph_or_fail, nullptr, nullptr);
#endif
#ifndef HB_NO_PAINT
- hb_font_funcs_set_paint_glyph_func (funcs, hb_ot_paint_glyph, nullptr, nullptr);
+ hb_font_funcs_set_paint_glyph_or_fail_func (funcs, hb_ot_paint_glyph_or_fail, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_ot_get_glyph_extents, nullptr, nullptr);
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-base-table.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -182,7 +182,7 @@
void collect_variation_indices (hb_set_t& varidx_set /* OUT */) const
{
switch (u.format) {
- case 3: hb_barrier (); u.format3.collect_variation_indices (varidx_set);
+ case 3: hb_barrier (); u.format3.collect_variation_indices (varidx_set); return;
default:return;
}
}
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-post-table.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -290,7 +290,7 @@
const Array16Of<HBUINT16> *glyphNameIndex = nullptr;
hb_vector_t<uint32_t> index_to_offset;
const uint8_t *pool = nullptr;
- hb_atomic_t<uint16_t *> gids_sorted_by_name;
+ mutable hb_atomic_t<uint16_t *> gids_sorted_by_name;
};
bool has_data () const { return version.to_int (); }
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shaper-arabic.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shaper-arabic.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shaper-arabic.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -260,7 +260,7 @@
* mask_array[NONE] == 0. */
hb_mask_t mask_array[ARABIC_NUM_FEATURES + 1];
- hb_atomic_t<arabic_fallback_plan_t *> fallback_plan;
+ mutable hb_atomic_t<arabic_fallback_plan_t *> fallback_plan;
unsigned int do_fallback : 1;
unsigned int has_stch : 1;
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -117,7 +117,7 @@
* in the specified face.
*
* Since: 1.4.2
- * Deprecated: 2.2.0 - use hb_ot_var_find_axis_info() instead
+ * Deprecated: 2.2.0: use hb_ot_var_find_axis_info() instead
**/
hb_bool_t
hb_ot_var_find_axis (hb_face_t *face,
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -84,6 +84,12 @@
}
}
+void hb_outline_t::slant (float slant_xy)
+{
+ for (auto &p : points)
+ p.x += slant_xy * p.y;
+}
+
float hb_outline_t::control_area () const
{
float a = 0;
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-outline.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -69,6 +69,7 @@
HB_INTERNAL void replay (hb_draw_funcs_t *pen, void *pen_data) const;
HB_INTERNAL float control_area () const;
+ HB_INTERNAL void slant (float slant_xy);
HB_INTERNAL void embolden (float x_strength, float y_strength,
float x_shift, float y_shift);
Added: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.cc (rev 0)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -0,0 +1,207 @@
+/*
+ * Copyright © 2022 Behdad Esfahbod
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ */
+
+#include "hb.hh"
+
+#ifndef HB_NO_PAINT
+
+#include "hb-paint-bounded.hh"
+
+#include "hb-machinery.hh"
+
+
+/*
+ * This file implements boundedness computation of COLRv1 fonts as described in:
+ *
+ * https://learn.microsoft.com/en-us/typography/opentype/spec/colr#glyph-metrics-and-boundedness
+ */
+
+static void
+hb_paint_bounded_push_clip_glyph (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_codepoint_t glyph,
+ hb_font_t *font,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->push_clip ();
+}
+
+static void
+hb_paint_bounded_push_clip_rectangle (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ float xmin, float ymin, float xmax, float ymax,
+ void *user_data)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->push_clip ();
+}
+
+static void
+hb_paint_bounded_pop_clip (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->pop_clip ();
+}
+
+static void
+hb_paint_bounded_push_group (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->push_group ();
+}
+
+static void
+hb_paint_bounded_pop_group (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_paint_composite_mode_t mode,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->pop_group (mode);
+}
+
+static hb_bool_t
+hb_paint_bounded_paint_image (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_blob_t *blob HB_UNUSED,
+ unsigned int width HB_UNUSED,
+ unsigned int height HB_UNUSED,
+ hb_tag_t format HB_UNUSED,
+ float slant HB_UNUSED,
+ hb_glyph_extents_t *glyph_extents,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->push_clip ();
+ c->paint ();
+ c->pop_clip ();
+
+ return true;
+}
+
+static void
+hb_paint_bounded_paint_color (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_bool_t use_foreground HB_UNUSED,
+ hb_color_t color HB_UNUSED,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->paint ();
+}
+
+static void
+hb_paint_bounded_paint_linear_gradient (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_color_line_t *color_line HB_UNUSED,
+ float x0 HB_UNUSED, float y0 HB_UNUSED,
+ float x1 HB_UNUSED, float y1 HB_UNUSED,
+ float x2 HB_UNUSED, float y2 HB_UNUSED,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->paint ();
+}
+
+static void
+hb_paint_bounded_paint_radial_gradient (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_color_line_t *color_line HB_UNUSED,
+ float x0 HB_UNUSED, float y0 HB_UNUSED, float r0 HB_UNUSED,
+ float x1 HB_UNUSED, float y1 HB_UNUSED, float r1 HB_UNUSED,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->paint ();
+}
+
+static void
+hb_paint_bounded_paint_sweep_gradient (hb_paint_funcs_t *funcs HB_UNUSED,
+ void *paint_data,
+ hb_color_line_t *color_line HB_UNUSED,
+ float cx HB_UNUSED, float cy HB_UNUSED,
+ float start_angle HB_UNUSED,
+ float end_angle HB_UNUSED,
+ void *user_data HB_UNUSED)
+{
+ hb_paint_bounded_context_t *c = (hb_paint_bounded_context_t *) paint_data;
+
+ c->paint ();
+}
+
+static inline void free_static_paint_bounded_funcs ();
+
+static struct hb_paint_bounded_funcs_lazy_loader_t : hb_paint_funcs_lazy_loader_t<hb_paint_bounded_funcs_lazy_loader_t>
+{
+ static hb_paint_funcs_t *create ()
+ {
+ hb_paint_funcs_t *funcs = hb_paint_funcs_create ();
+
+ hb_paint_funcs_set_push_clip_glyph_func (funcs, hb_paint_bounded_push_clip_glyph, nullptr, nullptr);
+ hb_paint_funcs_set_push_clip_rectangle_func (funcs, hb_paint_bounded_push_clip_rectangle, nullptr, nullptr);
+ hb_paint_funcs_set_pop_clip_func (funcs, hb_paint_bounded_pop_clip, nullptr, nullptr);
+ hb_paint_funcs_set_push_group_func (funcs, hb_paint_bounded_push_group, nullptr, nullptr);
+ hb_paint_funcs_set_pop_group_func (funcs, hb_paint_bounded_pop_group, nullptr, nullptr);
+ hb_paint_funcs_set_color_func (funcs, hb_paint_bounded_paint_color, nullptr, nullptr);
+ hb_paint_funcs_set_image_func (funcs, hb_paint_bounded_paint_image, nullptr, nullptr);
+ hb_paint_funcs_set_linear_gradient_func (funcs, hb_paint_bounded_paint_linear_gradient, nullptr, nullptr);
+ hb_paint_funcs_set_radial_gradient_func (funcs, hb_paint_bounded_paint_radial_gradient, nullptr, nullptr);
+ hb_paint_funcs_set_sweep_gradient_func (funcs, hb_paint_bounded_paint_sweep_gradient, nullptr, nullptr);
+
+ hb_paint_funcs_make_immutable (funcs);
+
+ hb_atexit (free_static_paint_bounded_funcs);
+
+ return funcs;
+ }
+} static_paint_bounded_funcs;
+
+static inline
+void free_static_paint_bounded_funcs ()
+{
+ static_paint_bounded_funcs.free_instance ();
+}
+
+hb_paint_funcs_t *
+hb_paint_bounded_get_funcs ()
+{
+ return static_paint_bounded_funcs.get_unconst ();
+}
+
+
+#endif
Added: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.hh (rev 0)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-bounded.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -0,0 +1,117 @@
+/*
+ * Copyright © 2022 Behdad Esfahbod
+ *
+ * This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ */
+
+#ifndef HB_PAINT_BOUNDED_HH
+#define HB_PAINT_BOUNDED_HH
+
+#include "hb.hh"
+#include "hb-paint.h"
+
+#include "hb-geometry.hh"
+
+
+typedef struct hb_paint_bounded_context_t hb_paint_bounded_context_t;
+
+struct hb_paint_bounded_context_t
+{
+ void clear ()
+ {
+ clips = 0;
+ bounded = true;
+ groups.clear ();
+ }
+
+ hb_paint_bounded_context_t ()
+ {
+ clear ();
+ }
+
+ bool is_bounded ()
+ {
+ return bounded;
+ }
+
+ void push_clip ()
+ {
+ clips++;
+ }
+
+ void pop_clip ()
+ {
+ if (clips == 0) return;
+ clips--;
+ }
+
+ void push_group ()
+ {
+ groups.push (bounded);
+ bounded = true;
+ }
+
+ void pop_group (hb_paint_composite_mode_t mode)
+ {
+ const bool src_bounded = bounded;
+ bounded = groups.pop ();
+ bool &backdrop_bounded = bounded;
+
+ // https://learn.microsoft.com/en-us/typography/opentype/spec/colr#format-32-paintcomposite
+ switch ((int) mode)
+ {
+ case HB_PAINT_COMPOSITE_MODE_CLEAR:
+ backdrop_bounded = true;
+ break;
+ case HB_PAINT_COMPOSITE_MODE_SRC:
+ case HB_PAINT_COMPOSITE_MODE_SRC_OUT:
+ backdrop_bounded = src_bounded;
+ break;
+ case HB_PAINT_COMPOSITE_MODE_DEST:
+ case HB_PAINT_COMPOSITE_MODE_DEST_OUT:
+ break;
+ case HB_PAINT_COMPOSITE_MODE_SRC_IN:
+ case HB_PAINT_COMPOSITE_MODE_DEST_IN:
+ backdrop_bounded = backdrop_bounded && src_bounded;
+ break;
+ default:
+ backdrop_bounded = backdrop_bounded || src_bounded;
+ break;
+ }
+ }
+
+ void paint ()
+ {
+ if (!clips)
+ bounded = false;
+ }
+
+ protected:
+ bool bounded; // true if current drawing bounded
+ unsigned clips; // number of active clips
+ hb_vector_t<bool> groups; // true if group bounded
+};
+
+HB_INTERNAL hb_paint_funcs_t *
+hb_paint_bounded_get_funcs ();
+
+
+#endif /* HB_PAINT_BOUNDED_HH */
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-extents.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-extents.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint-extents.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -28,14 +28,13 @@
#include "hb-paint-extents.hh"
-#include "hb-draw.h"
+#include "hb-draw.hh"
#include "hb-machinery.hh"
/*
- * This file implements bounds-extraction as well as boundedness
- * computation of COLRv1 fonts as described in:
+ * This file implements bounds-extraction computation of COLRv1 fonts as described in:
*
* https://learn.microsoft.com/en-us/typography/opentype/spec/colr#glyph-metrics-and-boundedness
*/
@@ -64,93 +63,6 @@
}
static void
-hb_draw_extents_move_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
- void *data,
- hb_draw_state_t *st,
- float to_x, float to_y,
- void *user_data HB_UNUSED)
-{
- hb_extents_t *extents = (hb_extents_t *) data;
-
- extents->add_point (to_x, to_y);
-}
-
-static void
-hb_draw_extents_line_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
- void *data,
- hb_draw_state_t *st,
- float to_x, float to_y,
- void *user_data HB_UNUSED)
-{
- hb_extents_t *extents = (hb_extents_t *) data;
-
- extents->add_point (to_x, to_y);
-}
-
-static void
-hb_draw_extents_quadratic_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
- void *data,
- hb_draw_state_t *st,
- float control_x, float control_y,
- float to_x, float to_y,
- void *user_data HB_UNUSED)
-{
- hb_extents_t *extents = (hb_extents_t *) data;
-
- extents->add_point (control_x, control_y);
- extents->add_point (to_x, to_y);
-}
-
-static void
-hb_draw_extents_cubic_to (hb_draw_funcs_t *dfuncs HB_UNUSED,
- void *data,
- hb_draw_state_t *st,
- float control1_x, float control1_y,
- float control2_x, float control2_y,
- float to_x, float to_y,
- void *user_data HB_UNUSED)
-{
- hb_extents_t *extents = (hb_extents_t *) data;
-
- extents->add_point (control1_x, control1_y);
- extents->add_point (control2_x, control2_y);
- extents->add_point (to_x, to_y);
-}
-
-static inline void free_static_draw_extents_funcs ();
-
-static struct hb_draw_extents_funcs_lazy_loader_t : hb_draw_funcs_lazy_loader_t<hb_draw_extents_funcs_lazy_loader_t>
-{
- static hb_draw_funcs_t *create ()
- {
- hb_draw_funcs_t *funcs = hb_draw_funcs_create ();
-
- hb_draw_funcs_set_move_to_func (funcs, hb_draw_extents_move_to, nullptr, nullptr);
- hb_draw_funcs_set_line_to_func (funcs, hb_draw_extents_line_to, nullptr, nullptr);
- hb_draw_funcs_set_quadratic_to_func (funcs, hb_draw_extents_quadratic_to, nullptr, nullptr);
- hb_draw_funcs_set_cubic_to_func (funcs, hb_draw_extents_cubic_to, nullptr, nullptr);
-
- hb_draw_funcs_make_immutable (funcs);
-
- hb_atexit (free_static_draw_extents_funcs);
-
- return funcs;
- }
-} static_draw_extents_funcs;
-
-static inline
-void free_static_draw_extents_funcs ()
-{
- static_draw_extents_funcs.free_instance ();
-}
-
-static hb_draw_funcs_t *
-hb_draw_extents_get_funcs ()
-{
- return static_draw_extents_funcs.get_unconst ();
-}
-
-static void
hb_paint_extents_push_clip_glyph (hb_paint_funcs_t *funcs HB_UNUSED,
void *paint_data,
hb_codepoint_t glyph,
@@ -221,6 +133,9 @@
{
hb_paint_extents_context_t *c = (hb_paint_extents_context_t *) paint_data;
+ if (!glyph_extents)
+ return false; // Happens with SVG images.
+
hb_extents_t extents = {(float) glyph_extents->x_bearing,
(float) glyph_extents->y_bearing + glyph_extents->height,
(float) glyph_extents->x_bearing + glyph_extents->width,
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.cc
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.cc 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.cc 2025-04-28 23:16:31 UTC (rev 75046)
@@ -87,7 +87,7 @@
unsigned int width,
unsigned int height,
hb_tag_t format,
- float slant_xy,
+ float slant_xy_deprecated,
hb_glyph_extents_t *extents,
void *user_data) { return false; }
@@ -615,7 +615,7 @@
* @width: width of the raster image in pixels, or 0
* @height: height of the raster image in pixels, or 0
* @format: the image format as a tag
- * @slant: the synthetic slant ratio to be applied to the image during rendering
+ * @slant: Deprecated. set to 0.0
* @extents: (nullable): the extents of the glyph
*
* Perform a "image" paint operation.
@@ -628,10 +628,10 @@
unsigned int width,
unsigned int height,
hb_tag_t format,
- float slant,
+ HB_UNUSED float slant,
hb_glyph_extents_t *extents)
{
- funcs->image (paint_data, image, width, height, format, slant, extents);
+ funcs->image (paint_data, image, width, height, format, 0.f, extents);
}
/**
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.h
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.h 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.h 2025-04-28 23:16:31 UTC (rev 75046)
@@ -167,8 +167,10 @@
* A virtual method for the #hb_paint_funcs_t to clip
* subsequent paint calls to the outline of a glyph.
*
- * The coordinates of the glyph outline are interpreted according
- * to the current transform.
+ * The coordinates of the glyph outline are expected in the
+ * current @font scale (ie. the results of calling
+ * hb_font_draw_glyph() with @font). The outline is
+ * transformed by the current transform.
*
* This clip is applied in addition to the current clip,
* and remains in effect until a matching call to
@@ -281,7 +283,7 @@
* @width: width of the raster image in pixels, or 0
* @height: height of the raster image in pixels, or 0
* @format: the image format as a tag
- * @slant: the synthetic slant ratio to be applied to the image during rendering
+ * @slant: Deprecated. Always set to 0.0.
* @extents: (nullable): glyph extents for desired rendering
* @user_data: User data pointer passed to hb_paint_funcs_set_image_func()
*
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.hh 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-paint.hh 2025-04-28 23:16:31 UTC (rev 75046)
@@ -162,10 +162,11 @@
{
float upem = font->face->get_upem ();
int xscale = font->x_scale, yscale = font->y_scale;
- float slant = font->slant_xy;
push_transform (paint_data,
- xscale/upem, 0, slant * yscale/upem, yscale/upem, 0, 0);
+ xscale/upem, 0,
+ 0, yscale/upem,
+ 0, 0);
}
void push_inverse_font_transform (void *paint_data,
@@ -174,10 +175,11 @@
float upem = font->face->get_upem ();
int xscale = font->x_scale ? font->x_scale : upem;
int yscale = font->y_scale ? font->y_scale : upem;
- float slant = font->slant_xy;
push_transform (paint_data,
- upem/xscale, 0, -slant * upem/xscale, upem/yscale, 0, 0);
+ upem/xscale, 0,
+ 0, upem/yscale,
+ 0, 0);
}
HB_NODISCARD
Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/meson.build
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/meson.build 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/meson.build 2025-04-28 23:16:31 UTC (rev 75046)
@@ -53,6 +53,8 @@
'hb-geometry.hh',
'hb-paint.cc',
'hb-paint.hh',
+ 'hb-paint-bounded.cc',
+ 'hb-paint-bounded.hh',
'hb-paint-extents.cc',
'hb-paint-extents.hh',
'hb-face.cc',
Modified: trunk/Build/source/libs/harfbuzz/version.ac
===================================================================
--- trunk/Build/source/libs/harfbuzz/version.ac 2025-04-28 19:50:11 UTC (rev 75045)
+++ trunk/Build/source/libs/harfbuzz/version.ac 2025-04-28 23:16:31 UTC (rev 75046)
@@ -8,4 +8,4 @@
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current harfbuzz version
-m4_define([harfbuzz_version], [11.1.0])
+m4_define([harfbuzz_version], [11.2.0])
More information about the tex-live-commits
mailing list.