diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index fa51e62..8ae6771 100644 --- a/vcl/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx @@ -203,6 +211,7 @@ public: using LEFontInstance::mapCharToGlyph; virtual LEGlyphID mapCharToGlyph( LEUnicode32 ch ) const; + virtual LEGlyphID mapCharToGlyph( LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth ) const; virtual le_int32 getAscent() const; virtual le_int32 getDescent() const; @@ -279,6 +288,16 @@ LEGlyphID IcuFontFromServerFont::mapCharToGlyph( LEUnicode32 ch ) const return nGlyphIndex; } +LEGlyphID IcuFontFromServerFont::mapCharToGlyph( LEUnicode32 ch, const LECharMapper *mapper, le_bool /*filterZeroWidth*/ ) const +{ +/* icu has..., so only the Indic layouts allow the joiners to get mapped to glyphs + >│93 if (filterZeroWidth && (mappedChar == 0x200C || mappedChar == 0x200D)) { │ + │94 return canDisplay(mappedChar)? 0x0001 : 0xFFFF; │ + │95 } +*/ + return LEFontInstance::mapCharToGlyph( ch, mapper, false ); +} + // ----------------------------------------------------------------------- le_int32 IcuFontFromServerFont::getAscent() const @@ -422,13 +441,19 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr le_int32 eScriptCode = -1; for( int i = nMinRunPos; i < nEndRunPos; ++i ) { - eScriptCode = uscript_getScript( pIcuChars[i], &rcI18n ); - if( (eScriptCode > 0) && (eScriptCode != latnScriptCode) ) - break; + le_int32 eNextScriptCode = uscript_getScript( pIcuChars[i], &rcI18n ); + if( (eNextScriptCode > USCRIPT_INHERITED) ) + { + eScriptCode = eNextScriptCode; + if (eNextScriptCode != latnScriptCode) + break; + } } if( eScriptCode < 0 ) // TODO: handle errors better eScriptCode = latnScriptCode; + fprintf(stderr, "scriptcode is %d\n", eScriptCode); + // get layout engine matching to this script // no engine change necessary if script is latin if( !mpIcuLE || ((eScriptCode != meScriptCode) && (eScriptCode > USCRIPT_INHERITED)) ) @@ -449,6 +474,9 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr if( !mpIcuLE ) break; + if( pIcuChars[0] == 'A') + fprintf(stderr, "debug here\n"); // OpenTypeLayoutEngine.cpp:314 + // run ICU layout engine // TODO: get enough context, remove extra glyps below int nRawRunGlyphCount = mpIcuLE->layoutChars( pIcuChars, diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 226ec08..2c3dc0a 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6001,22 +6001,6 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr, nLayoutFlags |= SAL_LAYOUT_ENABLE_LIGATURES; else if( mnTextLayoutMode & TEXT_LAYOUT_COMPLEX_DISABLED ) nLayoutFlags |= SAL_LAYOUT_COMPLEX_DISABLED; - else - { - // disable CTL for non-CTL text - const sal_Unicode* pStr = rStr.GetBuffer() + nMinIndex; - const sal_Unicode* pEnd = rStr.GetBuffer() + nEndIndex; - for( ; pStr < pEnd; ++pStr ) - if( ((*pStr >= 0x0300) && (*pStr < 0x0370)) // diacritical marks - || ((*pStr >= 0x0590) && (*pStr < 0x10A0)) // many CTL scripts - || ((*pStr >= 0x1100) && (*pStr < 0x1200)) // hangul jamo - || ((*pStr >= 0x1700) && (*pStr < 0x1900)) // many CTL scripts - || ((*pStr >= 0xFB1D) && (*pStr < 0xFE00)) // middle east presentation - || ((*pStr >= 0xFE70) && (*pStr < 0xFEFF)) ) // arabic presentation B - break; - if( pStr >= pEnd ) - nLayoutFlags |= SAL_LAYOUT_COMPLEX_DISABLED; - } if( meTextLanguage ) //TODO: (mnTextLayoutMode & TEXT_LAYOUT_SUBSTITUTE_DIGITS) {