[Libreoffice-commits] core.git: 2 commits - vcl/generic

Khaled Hosny khaledhosny at eglug.org
Tue Feb 4 15:34:25 PST 2014


 vcl/generic/glyphs/gcach_layout.cxx |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 9140d2795494cf318e2e149a5cef03088746fd80
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Tue Feb 4 10:19:46 2014 +0200

    Minor
    
    Change-Id: Ic2182ffc76d63b966fc381dadb59af344dda945e

diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 9c119bb..dcf2196 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -132,9 +132,6 @@ std::ostream &operator <<(std::ostream& s, ServerFont* pFont)
     return s;
 }
 
-static hb_font_funcs_t* pHbFontFuncs = NULL;
-static hb_unicode_funcs_t* pHbUnicodeFuncs = NULL;
-
 static hb_blob_t *getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
 {
     char pTagName[5];
@@ -374,8 +371,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
 
     SAL_INFO("vcl.harfbuzz", "layout(" << this << ",rArgs=" << rArgs << ")");
 
-    if (pHbFontFuncs == NULL)
-        pHbFontFuncs = getFontFuncs();
+    static hb_font_funcs_t* pHbFontFuncs = getFontFuncs();
 
     hb_font_t *pHbFont = hb_font_create(mpHbFace);
     hb_font_set_funcs(pHbFont, pHbFontFuncs, &rFont, NULL);
@@ -435,8 +431,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
 
             OString sLanguage = OUStringToOString(rArgs.maLanguageTag.getLanguage(), RTL_TEXTENCODING_UTF8);
 
-            if (pHbUnicodeFuncs == NULL)
-                pHbUnicodeFuncs = getUnicodeFuncs();
+            static hb_unicode_funcs_t* pHbUnicodeFuncs = getUnicodeFuncs();
 
             int nHbFlags = HB_BUFFER_FLAG_DEFAULT;
             if (nMinRunPos == 0)
commit e3a41d57e46e85656ba3fec56de541274da9ec91
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Tue Feb 4 10:04:03 2014 +0200

    Set HarfBuzz buffer flags for text boundaries
    
    If the run is the start and/or end of the whole text string being laid
    out, set corresponding HarfBuzz buffer flags as it will help HarfBuzz
    e.g. place a stray combining at the beginning of a paragraph on a dotted
    circle.
    
    Change-Id: I05c9fa46b251a2ce4e716da33fb6edda680d2dd1

diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 7f4266a..9c119bb 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -438,11 +438,18 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
             if (pHbUnicodeFuncs == NULL)
                 pHbUnicodeFuncs = getUnicodeFuncs();
 
+            int nHbFlags = HB_BUFFER_FLAG_DEFAULT;
+            if (nMinRunPos == 0)
+                nHbFlags |= HB_BUFFER_FLAG_BOT; /* Beginning-of-text */
+            if (nEndRunPos == rArgs.mnLength)
+                nHbFlags |= HB_BUFFER_FLAG_EOT; /* End-of-text */
+
             hb_buffer_t *pHbBuffer = hb_buffer_create();
             hb_buffer_set_unicode_funcs(pHbBuffer, pHbUnicodeFuncs);
             hb_buffer_set_direction(pHbBuffer, bRightToLeft ? HB_DIRECTION_RTL: HB_DIRECTION_LTR);
             hb_buffer_set_script(pHbBuffer, maHbScript);
             hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1));
+            hb_buffer_set_flags(pHbBuffer, (hb_buffer_flags_t) nHbFlags);
             hb_buffer_add_utf16(pHbBuffer, rArgs.mpStr, rArgs.mnLength, nMinRunPos, nRunLen);
             hb_shape(pHbFont, pHbBuffer, NULL, 0);
 


More information about the Libreoffice-commits mailing list