[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/generic

Khaled Hosny khaledhosny at eglug.org
Fri Aug 23 21:33:16 PDT 2013


 vcl/generic/glyphs/gcach_layout.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit fbaedf8bd45d3cc4409c92a4b798d9d9788567ed
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Thu Aug 22 21:25:44 2013 +0200

    fdo#66715: Avoid compatibility decomposition with HarfBuzz
    
    Change-Id: Ibbf5720baf7fb507e66515104115d58597258b1d
    Reviewed-on: https://gerrit.libreoffice.org/5598
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 4fd4cf4..9031ab7 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -298,6 +298,22 @@ static hb_font_funcs_t* getFontFuncs(void)
     return funcs;
 }
 
+// Disabled Unicode compatibility decomposition, see fdo#66715
+static unsigned int unicodeDecomposeCompatibility(hb_unicode_funcs_t* /*ufuncs*/,
+                                                  hb_codepoint_t      /*u*/,
+                                                  hb_codepoint_t*     /*decomposed*/,
+                                                  void*               /*user_data*/)
+{
+    return 0;
+}
+
+static hb_unicode_funcs_t* getUnicodeFuncs(void)
+{
+    static hb_unicode_funcs_t* ufuncs = hb_unicode_funcs_create(hb_icu_get_unicode_funcs());
+    hb_unicode_funcs_set_decompose_compatibility_func(ufuncs, unicodeDecomposeCompatibility, NULL, NULL);
+    return ufuncs;
+}
+
 class HbLayoutEngine : public ServerFontLayoutEngine
 {
 private:
@@ -384,6 +400,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
         OString sLanguage = OUStringToOString(aLangTag.getLanguage(), RTL_TEXTENCODING_UTF8);
 
         hb_buffer_t *pHbBuffer = hb_buffer_create();
+        hb_buffer_set_unicode_funcs(pHbBuffer, getUnicodeFuncs());
         hb_buffer_set_direction(pHbBuffer, bRightToLeft ? HB_DIRECTION_RTL: HB_DIRECTION_LTR);
         hb_buffer_set_script(pHbBuffer, hb_icu_script_to_script(eScriptCode));
         hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1));


More information about the Libreoffice-commits mailing list