Kaydet (Commit) 9adfadfe authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#57939 use different layout instances for differing kerning flags

use different layout engine instances for different kerning+ligature
combinations

Change-Id: I951dec2dfdd25df2c60f617e70a094bd0753aa77
(cherry picked from commit 2f80337e)
Signed-off-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d9061db7
...@@ -266,6 +266,7 @@ private: ...@@ -266,6 +266,7 @@ private:
IcuFontFromServerFont maIcuFont; IcuFontFromServerFont maIcuFont;
le_int32 meScriptCode; le_int32 meScriptCode;
le_int32 mnLayoutFlags;
LayoutEngine* mpIcuLE; LayoutEngine* mpIcuLE;
public: public:
...@@ -280,6 +281,7 @@ public: ...@@ -280,6 +281,7 @@ public:
IcuLayoutEngine::IcuLayoutEngine( ServerFont& rServerFont ) IcuLayoutEngine::IcuLayoutEngine( ServerFont& rServerFont )
: maIcuFont( rServerFont ), : maIcuFont( rServerFont ),
meScriptCode( USCRIPT_INVALID_CODE ), meScriptCode( USCRIPT_INVALID_CODE ),
mnLayoutFlags( 0 ),
mpIcuLE( NULL ) mpIcuLE( NULL )
{} {}
...@@ -367,13 +369,14 @@ bool IcuLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) ...@@ -367,13 +369,14 @@ bool IcuLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
if( eScriptCode < 0 ) // TODO: handle errors better if( eScriptCode < 0 ) // TODO: handle errors better
eScriptCode = latnScriptCode; eScriptCode = latnScriptCode;
// get layout engine matching to this script // get layout engine matching to this script and ligature/kerning combination
// no engine change necessary if script is latin // no engine change necessary if script is latin
if( !mpIcuLE || ((eScriptCode != meScriptCode) && (eScriptCode > USCRIPT_INHERITED)) ) if( !mpIcuLE || ((eScriptCode != meScriptCode) && (eScriptCode > USCRIPT_INHERITED)) || (mnLayoutFlags != nLayoutFlags) )
{ {
// TODO: cache multiple layout engines when multiple scripts are used // TODO: cache multiple layout engines when multiple scripts are used
delete mpIcuLE; delete mpIcuLE;
meScriptCode = eScriptCode; meScriptCode = eScriptCode;
mnLayoutFlags = nLayoutFlags;
le_int32 eLangCode = 0; // TODO: get better value le_int32 eLangCode = 0; // TODO: get better value
mpIcuLE = LayoutEngine::layoutEngineFactory( &maIcuFont, eScriptCode, eLangCode, nLayoutFlags, rcIcu ); mpIcuLE = LayoutEngine::layoutEngineFactory( &maIcuFont, eScriptCode, eLangCode, nLayoutFlags, rcIcu );
if( LE_FAILURE(rcIcu) ) if( LE_FAILURE(rcIcu) )
......
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