r24696 by jghali - Use new hb-subset api with harfbuzz >= 2.9.0 in order to prepeare for removal of legacy API in 3.0

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 21 20:05:43 UTC 2021


Author: jghali
Date: Sat Aug 21 20:05:43 2021
New Revision: 24696

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24696
Log:
Use new hb-subset api with harfbuzz >= 2.9.0 in order to prepeare for removal of legacy API in 3.0

Modified:
    trunk/Scribus/scribus/fonts/sfnt.cpp

Modified: trunk/Scribus/scribus/fonts/sfnt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24696&path=/trunk/Scribus/scribus/fonts/sfnt.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/sfnt.cpp	(original)
+++ trunk/Scribus/scribus/fonts/sfnt.cpp	Sat Aug 21 20:05:43 2021
@@ -1256,12 +1256,20 @@
 
 		for (int i = 0; i < cids.count(); ++i)
 			hb_set_add(glyphSet, cids.at(i));
-	
+
+#if HB_VERSION_ATLEAST(2, 9, 0)
+		uint32_t subsetFlags = (uint32_t) hb_subset_input_get_flags(hbSubsetInput.get());
+		subsetFlags |= HB_SUBSET_FLAGS_RETAIN_GIDS;
+		subsetFlags &= ~HB_SUBSET_FLAGS_NO_HINTING;
+		subsetFlags |= HB_SUBSET_FLAGS_NAME_LEGACY;
+		hb_subset_input_set_flags(hbSubsetInput.get(), subsetFlags);
+#else
 		hb_subset_input_set_retain_gids(hbSubsetInput.get(), true);
 		hb_subset_input_set_drop_hints(hbSubsetInput.get(), false);
 #if HB_VERSION_ATLEAST(2, 6, 5)
 		hb_subset_input_set_name_legacy(hbSubsetInput.get(), true);
 #endif
+#endif
 
 		QScopedPointer<hb_face_t, HbFaceDeleter> hbSubsetFace(hb_subset(hbFullFace.get(), hbSubsetInput.get()));
 		if (hbSubsetFace.isNull())




More information about the scribus-commit mailing list