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

Caolán McNamara caolanm at redhat.com
Tue May 26 07:46:27 PDT 2015


 vcl/generic/glyphs/gcach_layout.cxx |    6 ++++++
 vcl/source/outdev/font.cxx          |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit f76ecc3e9ce51b35fc18db55b808270079a3652b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 26 15:45:30 2015 +0100

    Resolves: tdf#89231 if no font has 0x202F fallback to a normal space
    
    Change-Id: I2325c0b09ccf66ee15597251ad027b295de5502f

diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 0eecae5..8d1c6f5 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -488,6 +488,12 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
                 int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint;
                 int32_t nCharPos = pHbGlyphInfos[i].cluster;
 
+                // tdf#89231 if it's just a missing non-breaking space, then use a normal space
+                if (!nGlyphIndex && (SalLayoutFlags::ForFallback & rArgs.mnFlags) && nCharPos >= 0 && rArgs.mpStr[nCharPos] == 0x202F)
+                {
+                    nGlyphIndex = rFont.GetGlyphIndex(' ');
+                }
+
                 // if needed request glyph fallback by updating LayoutArgs
                 if (!nGlyphIndex)
                 {
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 40bd5cd..216c8a6 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -2104,7 +2104,10 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
         if( nFallbackLevel < MAX_FALLBACK-1)
         {
             // ignore fallback font if it is the same as the original font
-            if( mpFontEntry->maFontSelData.mpFontData == aFontSelData.mpFontData )
+            // unless we are looking for a substituion for 0x202F, in which
+            // case we'll just use a normal space
+            if( mpFontEntry->maFontSelData.mpFontData == aFontSelData.mpFontData &&
+                aMissingCodes.indexOf(0x202F) == -1 )
             {
                 mpFontCache->Release( pFallbackFont );
                 continue;


More information about the Libreoffice-commits mailing list