external/harfbuzz/0001-PairPos-Another-attempt-at-fixing-unsafe-to-break-wi.patch.1
 |   62 ++++++++++
 external/harfbuzz/UnpackedTarball_harfbuzz.mk                                  
     |    1 
 2 files changed, 63 insertions(+)

New commits:
commit da4a0d1520c501b5f8a4c3385cdc5f76653213f4
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 24 20:29:52 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Nov 25 09:52:21 2022 +0100

    add in latest harfbuzz effort
    
    the document still fails for me, but in a new way which suggests
    a possible problem on our side.
    
    Change-Id: Ic38259653a43b39f9330adc503d085a896c15d2a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143246
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git 
a/external/harfbuzz/0001-PairPos-Another-attempt-at-fixing-unsafe-to-break-wi.patch.1
 
b/external/harfbuzz/0001-PairPos-Another-attempt-at-fixing-unsafe-to-break-wi.patch.1
new file mode 100644
index 000000000000..0fd429257b8d
--- /dev/null
+++ 
b/external/harfbuzz/0001-PairPos-Another-attempt-at-fixing-unsafe-to-break-wi.patch.1
@@ -0,0 +1,62 @@
+From 05aa084e67705285941c9acd13151e2a38da8b0f Mon Sep 17 00:00:00 2001
+From: Behdad Esfahbod <beh...@behdad.org>
+Date: Thu, 24 Nov 2022 12:13:31 -0700
+Subject: [PATCH] [PairPos] Another attempt at fixing unsafe-to-break with
+ ValueFormat2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116
+
+Test:
+$ hb-shape XBRoya34.ttf  ' الأ' --show-flags --script=arab
+---
+ src/OT/Layout/GPOS/PairPosFormat2.hh | 9 +++++----
+ src/OT/Layout/GPOS/PairSet.hh        | 5 +++--
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/src/OT/Layout/GPOS/PairPosFormat2.hh 
b/src/OT/Layout/GPOS/PairPosFormat2.hh
+index 1bb0d60ae..523e0e936 100644
+--- a/src/OT/Layout/GPOS/PairPosFormat2.hh
++++ b/src/OT/Layout/GPOS/PairPosFormat2.hh
+@@ -241,15 +241,16 @@ struct PairPosFormat2_4
+     boring:
+       buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1);
+ 
+-
+-    buffer->idx = skippy_iter.idx;
+     if (len2)
+     {
+-      buffer->idx++;
++      skippy_iter.idx++;
+       // https://github.com/harfbuzz/harfbuzz/issues/3824
+-      buffer->unsafe_to_break (buffer->idx - 1, buffer->idx + 1);
++      // 
https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116
++      buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1);
+     }
+ 
++    buffer->idx = skippy_iter.idx;
++
+     return_trace (true);
+   }
+ 
+diff --git a/src/OT/Layout/GPOS/PairSet.hh b/src/OT/Layout/GPOS/PairSet.hh
+index b1d9f83bc..2ad1f004c 100644
+--- a/src/OT/Layout/GPOS/PairSet.hh
++++ b/src/OT/Layout/GPOS/PairSet.hh
+@@ -132,8 +132,9 @@ struct PairSet
+       if (len2)
+       {
+       pos++;
+-      // https://github.com/harfbuzz/harfbuzz/issues/3824
+-      buffer->unsafe_to_break (pos - 1, pos + 1);
++      // https://github.com/harfbuzz/harfbuzz/issues/3824
++      // 
https://github.com/harfbuzz/harfbuzz/issues/3888#issuecomment-1326781116
++      buffer->unsafe_to_break (buffer->idx, pos + 1);
+       }
+ 
+       buffer->idx = pos;
+-- 
+2.38.1
+
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk 
b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 91af57205ac8..4b97fa208c5b 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
     external/harfbuzz/0001-hb-view-Fix-cairo-slanting-condition.patch.1 \
     
external/harfbuzz/0001-font-Respect-subfont-slant-setting-in-hb-draw.patch.1 \
     
external/harfbuzz/0001-buffer-diff-Fix-check-for-glyph-flag-equality.patch.1 \
+    
external/harfbuzz/0001-PairPos-Another-attempt-at-fixing-unsafe-to-break-wi.patch.1
 \
 ))
 
 # vim: set noet sw=4 ts=4:

Reply via email to