proposition for patch in CommonSalLayout.cxx

Stanisław Jeśmanowicz stan at mail2.jesmanowicz.com
Mon Mar 8 14:50:21 UTC 2021


Dear all,

I noticed that LibreOffice is using the hard coded harfbuzz shapers list in CommonSalLayout.cxx file 
(line 470).
I recommend the patch attached to be more flexible.
This take all possible shapers in a given HarfBuzz implementation.
This also allows the use of newly created shapers.

Just repleces line:
-  const char*const pHbShapers[] = { "dt", "graphite2", "coretext_aat", "ot", "fallback", nullptr };

with:
+  const char **pHbShapers = hb_shape_list_shapers();

Best regards,
Stan

===== patch

--- libreoffice-7.0.4.9/vcl/source/gdi/CommonSalLayout.cxx 2021-03-07 18:38:41.339770315 +0100
+++ libreoffice-7.0.4.x/vcl/source/gdi/CommonSalLayout.cxx 2021-03-08 12:29:37.045184836 +0100
@@ -463,11 +463,8 @@
                   nMinRunPos, nRunLen);
               hb_buffer_set_cluster_level(pHbBuffer, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS);

-            // The shapers that we want HarfBuzz to use, in the order of
-            // preference. The coretext_aat shaper is available only on macOS,
-            // but there is no harm in always including it, HarfBuzz will
-            // ignore unavailable shapers.
-            const char*const pHbShapers[] = { "dt", "graphite2", "coretext_aat", "ot", "fallback", 
nullptr };
+            // Take all possible shapers in a given HarfBuzz implementation.
+            const char **pHbShapers = hb_shape_list_shapers();
               bool ok = hb_shape_full(pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size(), 
pHbShapers);
               assert(ok);
               (void) ok;

-- 
__________________________________________________________

Stanislaw Jesmanowicz      stan <at> mail2 <dot> jesmanowicz <dot> com
Amsterdam                  voice : + 31 20 6126193
The Netherlands            mobile: + 31  653380520

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libreoffice.CommonSalLayout.patch
Type: text/x-patch
Size: 1045 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20210308/cdbe975f/attachment.bin>


More information about the LibreOffice mailing list