summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2015-08-01 21:23:43 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2015-08-01 21:47:36 +0200
commit8e43f5d3222ca320e28026bfef4b6096376446c1 (patch)
treeacfc8c58f332f37c13d7fb3340e5034718ad73c5 /vcl/generic
parentb5423da269dc218b37d7fe6c675b032d950bcd54 (diff)
Move fix for tdf#89231 to a better place
The Unicode to glyph id callback function is the natural and simpler place for that kind of check. Change-Id: I0e9fa131dcffa5063277f029e391eede7417c72b
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 43550f2d4b15..f9dd96d91919 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -148,6 +148,10 @@ static hb_bool_t getFontGlyph(hb_font_t* /*font*/, void* pFontData,
ServerFont* pFont = static_cast<ServerFont*>(pFontData);
*nGlyphIndex = pFont->GetRawGlyphIndex(ch, vs);
+ // tdf#89231 if the font is missing non-breaking space, then use a normal space
+ if (*nGlyphIndex == 0 && ch == 0x202F && !vs)
+ *nGlyphIndex = pFont->GetRawGlyphIndex(' ');
+
return *nGlyphIndex != 0;
}
@@ -488,12 +492,6 @@ 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)
{