Kaydet (Commit) 8e43f5d3 authored tarafından Khaled Hosny's avatar Khaled Hosny

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
üst b5423da2
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment