harfbuzz-3.0.0.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 1b546978bc4ea0b2a73fbe4d7cf947887e865162 Mon Sep 17 00:00:00 2001
  2. From: Jean Ghali <jghali@libertysurf.fr>
  3. Date: Sat, 21 Aug 2021 20:05:43 +0000
  4. Subject: [PATCH] Use new hb-subset api with harfbuzz >= 2.9.0 in order to
  5. prepeare for removal of legacy API in 3.0
  6. git-svn-id: svn://scribus.net/trunk/Scribus@24696 11d20701-8431-0410-a711-e3c959e3b870
  7. ---
  8. scribus/fonts/sfnt.cpp | 10 +++++++++-
  9. 1 file changed, 9 insertions(+), 1 deletion(-)
  10. diff --git a/scribus/fonts/sfnt.cpp b/scribus/fonts/sfnt.cpp
  11. index 50777f66e3..fca8b39158 100644
  12. --- a/scribus/fonts/sfnt.cpp
  13. +++ b/scribus/fonts/sfnt.cpp
  14. @@ -1256,11 +1256,19 @@ namespace sfnt {
  15. for (int i = 0; i < cids.count(); ++i)
  16. hb_set_add(glyphSet, cids.at(i));
  17. -
  18. +
  19. +#if HB_VERSION_ATLEAST(2, 9, 0)
  20. + uint32_t subsetFlags = (uint32_t) hb_subset_input_get_flags(hbSubsetInput.get());
  21. + subsetFlags |= HB_SUBSET_FLAGS_RETAIN_GIDS;
  22. + subsetFlags &= ~HB_SUBSET_FLAGS_NO_HINTING;
  23. + subsetFlags |= HB_SUBSET_FLAGS_NAME_LEGACY;
  24. + hb_subset_input_set_flags(hbSubsetInput.get(), subsetFlags);
  25. +#else
  26. hb_subset_input_set_retain_gids(hbSubsetInput.get(), true);
  27. hb_subset_input_set_drop_hints(hbSubsetInput.get(), false);
  28. #if HB_VERSION_ATLEAST(2, 6, 5)
  29. hb_subset_input_set_name_legacy(hbSubsetInput.get(), true);
  30. +#endif
  31. #endif
  32. QScopedPointer<hb_face_t, HbFaceDeleter> hbSubsetFace(hb_subset(hbFullFace.get(), hbSubsetInput.get()));
  33. From 68ec41169eaceea4a6e1d6f359762a191c7e61d5 Mon Sep 17 00:00:00 2001
  34. From: Jean Ghali <jghali@libertysurf.fr>
  35. Date: Sun, 19 Sep 2021 11:59:50 +0000
  36. Subject: [PATCH] #16635: Replace hb_subset, removed in harfbuzz 3.0, by
  37. hb_subset_or_fail
  38. git-svn-id: svn://scribus.net/trunk/Scribus@24707 11d20701-8431-0410-a711-e3c959e3b870
  39. ---
  40. scribus/fonts/sfnt.cpp | 6 ++++++
  41. 1 file changed, 6 insertions(+)
  42. diff --git a/scribus/fonts/sfnt.cpp b/scribus/fonts/sfnt.cpp
  43. index fca8b39158..b3dfa50dc6 100644
  44. --- a/scribus/fonts/sfnt.cpp
  45. +++ b/scribus/fonts/sfnt.cpp
  46. @@ -1271,9 +1271,15 @@ namespace sfnt {
  47. #endif
  48. #endif
  49. +#if HB_VERSION_ATLEAST(2, 9, 0)
  50. + QScopedPointer<hb_face_t, HbFaceDeleter> hbSubsetFace(hb_subset_or_fail(hbFullFace.get(), hbSubsetInput.get()));
  51. + if (hbSubsetFace.isNull())
  52. + return QByteArray();
  53. +#else
  54. QScopedPointer<hb_face_t, HbFaceDeleter> hbSubsetFace(hb_subset(hbFullFace.get(), hbSubsetInput.get()));
  55. if (hbSubsetFace.isNull())
  56. return QByteArray();
  57. +#endif
  58. QScopedPointer<hb_blob_t, HbBlobDeleter> hbSubsetBlob(hb_face_reference_blob(hbSubsetFace.get()));
  59. if (hbSubsetBlob.isNull())