summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-05-26 15:45:30 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-05-27 09:33:13 +0000
commit6feb828757477669325ebd8bc4491b7e4d1283dc (patch)
treef6d6697f362286f1e07960369beb52d2aac32b3e
parentdbf24ea9aa010fe51da8d580a1403c8ecd9f0b04 (diff)
Resolves: tdf#89231 if no font has 0x202F fallback to a normal space
Change-Id: I2325c0b09ccf66ee15597251ad027b295de5502f (cherry picked from commit f76ecc3e9ce51b35fc18db55b808270079a3652b) Reviewed-on: https://gerrit.libreoffice.org/15912 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx6
-rw-r--r--vcl/source/outdev/font.cxx5
2 files changed, 10 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index b29627d200fa..c51ee4a9fa2d 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -445,6 +445,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 b04a318c3c40..068b2bbeb059 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -2080,7 +2080,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;