From d4bfdbf4901acf6ad798019780f62c4c93a6c145 Mon Sep 17 00:00:00 2001 From: hdu Date: Mon, 22 Feb 2010 17:16:11 +0100 Subject: #i101552# implement dynamic glyph fallback for WIN (thanks yanminjia!) --- vcl/inc/vcl/outfont.hxx | 6 ++ vcl/source/gdi/outdev3.cxx | 12 +++ vcl/win/source/gdi/salgdi3.cxx | 214 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 231 insertions(+), 1 deletion(-) diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx index b72e78994a75..8feb9bfed8b8 100644 --- a/vcl/inc/vcl/outfont.hxx +++ b/vcl/inc/vcl/outfont.hxx @@ -39,6 +39,8 @@ #include +#include + class ImplDevFontListData; class ImplGetDevFontList; class ImplGetDevSizeList; @@ -190,6 +192,7 @@ public: // TODO: change to private class VCL_DLLPUBLIC ImplDevFontList { private: + friend class WinGlyphFallbackSubstititution; mutable bool mbMatchData; // true if matching attributes are initialized bool mbMapNames; // true if MapNames are available @@ -226,6 +229,9 @@ public: ImplGetDevFontList* GetDevFontList() const; ImplGetDevSizeList* GetDevSizeList( const String& rFontName ) const; + //used by 2-level font fallback + ImplDevFontListData* ImplFindByLocale(com::sun::star::lang::Locale lc) const; + protected: void InitMatchData() const; bool AreMapNamesAvailable() const { return mbMapNames; } diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 28fa4f8f5461..3aa98004c500 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -1661,6 +1661,18 @@ void ImplDevFontList::InitMatchData() const } } +//---------------------------------------------------------------------------- +ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const +{ + // get the default font for a specified locale + const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get(); + String aDefault = rDefaults.getUserInterfaceFont( lc ); + ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault ); + if( pFontData ) + return pFontData; + return 0; +} + // ----------------------------------------------------------------------- ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType, diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 12fdad65dfb1..babc968ca859 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -47,11 +47,15 @@ #include "vcl/fontsubset.hxx" #include "vcl/sallayout.hxx" +#include "vcl/outdev.h" // for ImplGlyphFallbackFontSubstitution +#include "unotools/fontcfg.hxx" // for IMPL_FONT_ATTR_SYMBOL + #include "rtl/logfile.hxx" #include "rtl/tencinfo.h" #include "rtl/textcvt.h" #include "rtl/bootstrap.hxx" +#include "i18npool/mslangid.hxx" #include "osl/module.h" #include "osl/file.hxx" @@ -82,7 +86,6 @@ #include #include - using namespace vcl; static const int MAXFONTHEIGHT = 2048; @@ -314,6 +317,208 @@ RawFontData::RawFontData( HDC hDC, DWORD nTableTag ) } } +// =========================================================================== +// platform specific font substitution hooks for glyph fallback enhancement +// TODO: move into i18n module (maybe merge with svx/ucsubset.*) +struct Unicode2LangType +{ + sal_UCS4 mnMinCode; + sal_UCS4 mnMaxCode; + LanguageType mnLangID; +}; + +// map unicode ranges to languages supported by OOo +// NOTE: due to the binary search used this list must be sorted by mnMinCode +static const Unicode2LangType aLangFromCodeChart[]= { + {0x0000, 0x007f, LANGUAGE_ENGLISH}, // Basic Latin + {0x0080, 0x024f, LANGUAGE_ENGLISH}, // Latin Extended-A and Latin Extended-B + {0x0250, 0x02af, LANGUAGE_SYSTEM}, // IPA Extensions + {0x0370, 0x03ff, LANGUAGE_GREEK}, // Greek + {0x0590, 0x05ff, LANGUAGE_HEBREW}, // Hebrew + {0x0600, 0x06ff, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic + {0x0900, 0x097f, LANGUAGE_HINDI}, // Devanagari + {0x0980, 0x09ff, LANGUAGE_BENGALI}, // Bengali + {0x0a80, 0x0aff, LANGUAGE_GUJARATI}, // Gujarati + {0x0b00, 0x0b7f, LANGUAGE_ORIYA}, // Oriya + {0x0b80, 0x0bff, LANGUAGE_TAMIL}, // Tamil + {0x0e00, 0x0e7f, LANGUAGE_THAI}, // Thai + {0x0e80, 0x0eff, LANGUAGE_LAO}, // Lao + {0x1000, 0x109f, LANGUAGE_BURMESE}, // Burmese + {0x1100, 0x11ff, LANGUAGE_KOREAN}, // Hangul Jamo, Korean-specific + {0x1780, 0x17ff, LANGUAGE_KHMER}, // Khmer + {0x1e00, 0x1eff, LANGUAGE_ENGLISH}, // Latin Extended Additional + {0x2c60, 0x2c7f, LANGUAGE_ENGLISH}, // Latin Extended-C + {0x2e80, 0x2fff, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Radicals Supplement + Kangxi Radical + Ideographic Description Characters + {0x3000, 0x303F, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Symbols and punctuation + {0x3040, 0x30FF, LANGUAGE_JAPANESE}, // Japanese Hiragana + Katakana + {0x3100, 0x312f, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo + {0x3130, 0x318f, LANGUAGE_KOREAN}, // Hangul Compatibility Jamo, Kocrean-specific + {0x3190, 0x319f, LANGUAGE_JAPANESE}, // Kanbun + {0x31a0, 0x31bf, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended + {0x31c0, 0x31ef, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Strokes + {0x31f0, 0x31ff, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions + {0x3400, 0x4dbf, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Unified Ideographs Extension A + {0x4e00, 0x9fcf, LANGUAGE_CHINESE_SIMPLIFIED}, // Unified CJK Ideographs + {0xa720, 0xa7ff, LANGUAGE_ENGLISH}, // Latin Extended-D + {0xac00, 0xd7af, LANGUAGE_KOREAN}, // Hangul Syllables, Kocrean-specific + {0xF900, 0xFAFF, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Compatibility Ideographs + {0xfb00, 0xfb4f, LANGUAGE_HEBREW}, // Hibrew present forms + {0xfb50, 0xfdff, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A + {0xfe70, 0xfefe, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B + {0xff65, 0xff9f, LANGUAGE_JAPANESE}, // Japanese Halfwidth Katakana variant + {0xffa0, 0xffDC, LANGUAGE_KOREAN}, // Kocrean halfwidth hangual variant + {0x10140, 0x1018f, LANGUAGE_GREEK}, // Ancient Greak numbers + {0x1d200, 0x1d24f, LANGUAGE_GREEK}, // Ancient Greek Musical + {0x20000, 0x2a6df, LANGUAGE_CHINESE}, // CJK Unified Ideographs Extension B + {0x2f800, 0x2fa1f, LANGUAGE_CHINESE} // CJK Compatibility Ideographs Supplement +}; + +// get language type in accordance of a missing char +const LanguageType MapCharToLanguage( sal_UCS4 uChar ) +{ + // binary search + int nLow = 0; + int nHigh = (sizeof(aLangFromCodeChart) / sizeof(*aLangFromCodeChart)) - 1; + while( nLow <= nHigh ) + { + int nMiddle = (nHigh + nLow) / 2; + if( uChar < aLangFromCodeChart[ nMiddle].mnMinCode ) + nHigh = nMiddle - 1; + else if( uChar > aLangFromCodeChart[ nMiddle].mnMaxCode ) + nLow = nMiddle + 1; + else + return aLangFromCodeChart[ nMiddle].mnLangID; + } + + return LANGUAGE_DONTKNOW; +} + +//class ImplWinFontData; +void ImplGetLogFontFromFontSelect( HDC hDC, + const ImplFontSelectData* pFont, + LOGFONTW& rLogFont, + bool /*bTestVerticalAvail*/ ); + +class WinGlyphFallbackSubstititution +: public ImplGlyphFallbackFontSubstitution +{ +public: + WinGlyphFallbackSubstititution( HDC hDC, ImplDevFontList* pDFL ); + +// void SetHDC( HDC hDC ) { mhDC = hDC; } +// void SetFontList( ImplDevFontList* pFontLiest ) { mpFontList = pFontList; } + bool FindFontSubstitute( ImplFontSelectData&, rtl::OUString& rMissingChars ) const; +private: + HDC mhDC; + ImplDevFontList* mpFontList; + bool HasMissingChars( const ImplFontData*, const rtl::OUString& rMissingChars ) const; +}; + +inline WinGlyphFallbackSubstititution::WinGlyphFallbackSubstititution( HDC hDC, ImplDevFontList* pDFL ) +: mhDC( hDC ) +, mpFontList( pDFL ) +{} + +// does a font face hold the given missing characters? +bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace, const rtl::OUString& rMissingChars ) const +{ + const ImplWinFontData* pWinFont = static_cast(pFace); + if( !pWinFont->GetImplFontCharMap() ) + { + // construct a Size structure as the parameter of constructor of class ImplFontSelectData + const Size aSize( pFace->GetWidth(), pFace->GetHeight() ); + // create a ImplFontSelectData object for getting s LOGFONT + const ImplFontSelectData aFSD( *pFace, aSize, (float)aSize.Height(), 0, false ); + // construct log font + LOGFONTW aLogFont; + ImplGetLogFontFromFontSelect( mhDC, &aFSD, aLogFont, true ); + + // create HFONT from log font + HFONT hNewFont = ::CreateFontIndirectW( &aLogFont ); + // select the new font into device + HFONT hOldFont = ::SelectFont( mhDC, hNewFont ); + + // read CMAP table + pWinFont->UpdateFromHDC( mhDC );; + + ::SelectFont( mhDC, hOldFont ); + ::DeleteFont( hNewFont ); + } + + sal_Int32 nStrIndex = 0; // TODO: check more missing characters? + const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIndex ); + const bool bHasChar = pWinFont->HasChar( uChar ); + return bHasChar; +} + +//get fallback font for missing characters +bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFontSelData, rtl::OUString& rMissingChars ) const +{ + //g et locale by the language type of missing string + com::sun::star::lang::Locale aLocale; + + // what are langauge and mapping locale of the missing characters? + sal_Int32 nStrIdx = 0; + const sal_Int32 nStrLen = rMissingChars.getLength(); + while( nStrIdx < nStrLen ) + { + const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIdx ); + const LanguageType eLang = MapCharToLanguage( uChar ); + if( eLang == LANGUAGE_DONTKNOW ) + continue; + MsLangId::convertLanguageToLocale( eLang, aLocale ); + break; + } + + // fall back to default UI locale + if( nStrIdx >= nStrLen ) + aLocale = Application::GetSettings().GetUILocale(); + + // first level fallback, get font type face by locale + /*const*/ ImplDevFontListData* pDevFont = mpFontList->ImplFindByLocale( aLocale ); + if( pDevFont ) + { +// const ImplFontData* pFace = pDevFont->FindBestFontFace( rFontSelData ); +// if( HasMissingChas( pFace, MissingChars) ) { + rFontSelData.maSearchName = pDevFont->GetSearchName(); + return true; +// } + } + + // are the missing characters symbols? + pDevFont = mpFontList->ImplFindByAttributes( IMPL_FONT_ATTR_SYMBOL, + rFontSelData.meWeight, rFontSelData.meWidthType, + rFontSelData.meFamily, rFontSelData.meItalic, rFontSelData.maSearchName ); + if( pDevFont ) + { + const ImplFontData* pFace = pDevFont->FindBestFontFace( rFontSelData ); + if( HasMissingChars( pFace, rMissingChars ) ) + { + rFontSelData.maSearchName = pDevFont->GetSearchName(); + return true; + } + } + + // last level fallback, check each font type face one by one + const ImplGetDevFontList* pTestFontList = mpFontList->GetDevFontList(); + // limit the count of fonts to be checked to prevent hangs + static const int MAX_GFBFONT_COUNT = 600; + int nTestFontCount = pTestFontList->Count(); + if( nTestFontCount > MAX_GFBFONT_COUNT ) + nTestFontCount = MAX_GFBFONT_COUNT; + + for( int i = 0; i < nTestFontCount; ++i ) + { + const ImplFontData* pFace = pTestFontList->Get( i ); + if( !HasMissingChars( pFace, rMissingChars ) ) + continue; + rFontSelData.maSearchName = pFace->maName; + return true; + } + + return false; +} + // ======================================================================= struct ImplEnumInfo @@ -910,6 +1115,8 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const { + if(!mpUnicodeMap) + return 0; mpUnicodeMap->AddReference(); return mpUnicodeMap; } @@ -2248,6 +2455,11 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList ) bImplSalCourierScalable = aInfo.mbImplSalCourierScalable; bImplSalCourierNew = aInfo.mbImplSalCourierNew; } + + //set font fallback hook + static WinGlyphFallbackSubstititution aSubstFallback(mhDC, pFontList); + //aSubstFallback.SetHDC(mhDC); + pFontList->SetFallbackHook( &aSubstFallback ); } // ---------------------------------------------------------------------------- -- cgit v1.2.3 From 622ca3aa67232d56ee8fff25bc49ba3839e642e0 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 3 Mar 2010 16:55:16 +0100 Subject: "#i101552# avoid fonts with obsolete CMAP tables for glyph fallback" and some minor changes --- vcl/win/source/gdi/salgdi3.cxx | 57 +++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index babc968ca859..981ee89d665d 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -393,7 +393,6 @@ const LanguageType MapCharToLanguage( sal_UCS4 uChar ) return LANGUAGE_DONTKNOW; } -//class ImplWinFontData; void ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData* pFont, LOGFONTW& rLogFont, @@ -423,7 +422,8 @@ inline WinGlyphFallbackSubstititution::WinGlyphFallbackSubstititution( HDC hDC, bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace, const rtl::OUString& rMissingChars ) const { const ImplWinFontData* pWinFont = static_cast(pFace); - if( !pWinFont->GetImplFontCharMap() ) + const ImplFontCharMap* pCharMap = pWinFont->GetImplFontCharMap(); + if( !pCharMap ) { // construct a Size structure as the parameter of constructor of class ImplFontSelectData const Size aSize( pFace->GetWidth(), pFace->GetHeight() ); @@ -438,26 +438,42 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace, // select the new font into device HFONT hOldFont = ::SelectFont( mhDC, hNewFont ); - // read CMAP table + // read CMAP table to update their pCharMap pWinFont->UpdateFromHDC( mhDC );; + // cleanup temporary font ::SelectFont( mhDC, hOldFont ); ::DeleteFont( hNewFont ); + + // get the new charmap + pCharMap = pWinFont->GetImplFontCharMap(); + } + + // avoid fonts with unknown CMAP subtables for glyph fallback + if( !pCharMap || pCharMap->IsDefaultMap() ) + return false; + + int nMatchCount = 0; + // static const int nMaxMatchCount = 1; // TODO: check more missing characters? + const sal_Int32 nStrLen = rMissingChars.getLength(); + for( sal_Int32 nStrIdx = 0; nStrIdx < nStrLen; ++nStrIdx ) + { + const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIdx ); + nMatchCount += pCharMap->HasChar( uChar ); + break; // for now } - sal_Int32 nStrIndex = 0; // TODO: check more missing characters? - const sal_UCS4 uChar = rMissingChars.iterateCodePoints( &nStrIndex ); - const bool bHasChar = pWinFont->HasChar( uChar ); - return bHasChar; + const bool bHasMatches = (nMatchCount > 0); + return bHasMatches; } -//get fallback font for missing characters +// find a fallback font for missing characters +// TODO: should stylistic matches be searched and prefered? bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFontSelData, rtl::OUString& rMissingChars ) const { - //g et locale by the language type of missing string + // guess a locale matching to the missing chars com::sun::star::lang::Locale aLocale; - // what are langauge and mapping locale of the missing characters? sal_Int32 nStrIdx = 0; const sal_Int32 nStrLen = rMissingChars.getLength(); while( nStrIdx < nStrLen ) @@ -470,19 +486,21 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo break; } - // fall back to default UI locale + // fall back to default UI locale if the missing characters are inconclusive if( nStrIdx >= nStrLen ) aLocale = Application::GetSettings().GetUILocale(); - // first level fallback, get font type face by locale + // first level fallback: + // try use the locale specific default fonts in VCL.xcu /*const*/ ImplDevFontListData* pDevFont = mpFontList->ImplFindByLocale( aLocale ); if( pDevFont ) { -// const ImplFontData* pFace = pDevFont->FindBestFontFace( rFontSelData ); -// if( HasMissingChas( pFace, MissingChars) ) { + const ImplFontData* pFace = pDevFont->FindBestFontFace( rFontSelData ); + if( HasMissingChars( pFace, rMissingChars ) ) + { rFontSelData.maSearchName = pDevFont->GetSearchName(); return true; -// } + } } // are the missing characters symbols? @@ -1115,8 +1133,8 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const { - if(!mpUnicodeMap) - return 0; + if( !mpUnicodeMap ) + return NULL; mpUnicodeMap->AddReference(); return mpUnicodeMap; } @@ -2456,9 +2474,8 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList ) bImplSalCourierNew = aInfo.mbImplSalCourierNew; } - //set font fallback hook - static WinGlyphFallbackSubstititution aSubstFallback(mhDC, pFontList); - //aSubstFallback.SetHDC(mhDC); + // set font fallback hook + static WinGlyphFallbackSubstititution aSubstFallback( mhDC, pFontList ); pFontList->SetFallbackHook( &aSubstFallback ); } -- cgit v1.2.3 From 96f94b2462fb61d9457545112f939937d3b9e20d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Thu, 4 Mar 2010 13:27:03 +0100 Subject: #i101552# adjust language detection for CJK unified chars --- vcl/win/source/gdi/salgdi3.cxx | 71 +++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 981ee89d665d..a71022ed57b8 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -327,9 +327,12 @@ struct Unicode2LangType LanguageType mnLangID; }; +// entries marked with default-CJK get replaced with the default-CJK language +#define LANGUAGE_DEFAULT_CJK 0xFFF0 + // map unicode ranges to languages supported by OOo // NOTE: due to the binary search used this list must be sorted by mnMinCode -static const Unicode2LangType aLangFromCodeChart[]= { +static Unicode2LangType aLangFromCodeChart[]= { {0x0000, 0x007f, LANGUAGE_ENGLISH}, // Basic Latin {0x0080, 0x024f, LANGUAGE_ENGLISH}, // Latin Extended-A and Latin Extended-B {0x0250, 0x02af, LANGUAGE_SYSTEM}, // IPA Extensions @@ -349,19 +352,19 @@ static const Unicode2LangType aLangFromCodeChart[]= { {0x1e00, 0x1eff, LANGUAGE_ENGLISH}, // Latin Extended Additional {0x2c60, 0x2c7f, LANGUAGE_ENGLISH}, // Latin Extended-C {0x2e80, 0x2fff, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Radicals Supplement + Kangxi Radical + Ideographic Description Characters - {0x3000, 0x303F, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Symbols and punctuation + {0x3000, 0x303F, LANGUAGE_DEFAULT_CJK}, // CJK Symbols and punctuation {0x3040, 0x30FF, LANGUAGE_JAPANESE}, // Japanese Hiragana + Katakana {0x3100, 0x312f, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo {0x3130, 0x318f, LANGUAGE_KOREAN}, // Hangul Compatibility Jamo, Kocrean-specific {0x3190, 0x319f, LANGUAGE_JAPANESE}, // Kanbun {0x31a0, 0x31bf, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended - {0x31c0, 0x31ef, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Strokes + {0x31c0, 0x31ef, LANGUAGE_DEFAULT_CJK}, // CJK Ideographs {0x31f0, 0x31ff, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions - {0x3400, 0x4dbf, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Unified Ideographs Extension A - {0x4e00, 0x9fcf, LANGUAGE_CHINESE_SIMPLIFIED}, // Unified CJK Ideographs + {0x3400, 0x4dbf, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension A + {0x4e00, 0x9fcf, LANGUAGE_DEFAULT_CJK}, // Unified CJK Ideographs {0xa720, 0xa7ff, LANGUAGE_ENGLISH}, // Latin Extended-D {0xac00, 0xd7af, LANGUAGE_KOREAN}, // Hangul Syllables, Kocrean-specific - {0xF900, 0xFAFF, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Compatibility Ideographs + {0xF900, 0xFAFF, LANGUAGE_DEFAULT_CJK}, // CJK Compatibility Ideographs {0xfb00, 0xfb4f, LANGUAGE_HEBREW}, // Hibrew present forms {0xfb50, 0xfdff, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A {0xfe70, 0xfefe, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B @@ -369,13 +372,47 @@ static const Unicode2LangType aLangFromCodeChart[]= { {0xffa0, 0xffDC, LANGUAGE_KOREAN}, // Kocrean halfwidth hangual variant {0x10140, 0x1018f, LANGUAGE_GREEK}, // Ancient Greak numbers {0x1d200, 0x1d24f, LANGUAGE_GREEK}, // Ancient Greek Musical - {0x20000, 0x2a6df, LANGUAGE_CHINESE}, // CJK Unified Ideographs Extension B - {0x2f800, 0x2fa1f, LANGUAGE_CHINESE} // CJK Compatibility Ideographs Supplement + {0x20000, 0x2a6df, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension B + {0x2f800, 0x2fa1f, LANGUAGE_DEFAULT_CJK} // CJK Compatibility Ideographs Supplement }; -// get language type in accordance of a missing char -const LanguageType MapCharToLanguage( sal_UCS4 uChar ) +// get language matching to the missing char +LanguageType MapCharToLanguage( sal_UCS4 uChar ) { + // entries marked with default-CJK should get replaced with a default-CJK language + static bool bFirst = true; + if( bFirst ) + { + bFirst = false; + // TODO: use the default-CJK language instead + // when the setting from Tools->Options->LangSettings->Languages becomes available here + LanguageType nDefaultCJK = LANGUAGE_CHINESE; + const LanguageType nUILang = Application::GetSettings().GetUILanguage(); + switch( nUILang ) + { + case LANGUAGE_JAPANESE: + case LANGUAGE_KOREAN: + case LANGUAGE_KOREAN_JOHAB: + case LANGUAGE_CHINESE_SIMPLIFIED: + case LANGUAGE_CHINESE_TRADITIONAL: + case LANGUAGE_CHINESE_SINGAPORE: + case LANGUAGE_CHINESE_HONGKONG: + case LANGUAGE_CHINESE_MACAU: + nDefaultCJK = nUILang; + break; + default: + nDefaultCJK = LANGUAGE_CHINESE; + break; + } + + static const int nCount = (sizeof(aLangFromCodeChart) / sizeof(*aLangFromCodeChart)); + for( int i = 0; i < nCount; ++i ) + { + if( aLangFromCodeChart[ i].mnLangID == LANGUAGE_DEFAULT_CJK ) + aLangFromCodeChart[ i].mnLangID = nDefaultCJK; + } + } + // binary search int nLow = 0; int nHigh = (sizeof(aLangFromCodeChart) / sizeof(*aLangFromCodeChart)) - 1; @@ -393,19 +430,12 @@ const LanguageType MapCharToLanguage( sal_UCS4 uChar ) return LANGUAGE_DONTKNOW; } -void ImplGetLogFontFromFontSelect( HDC hDC, - const ImplFontSelectData* pFont, - LOGFONTW& rLogFont, - bool /*bTestVerticalAvail*/ ); - class WinGlyphFallbackSubstititution : public ImplGlyphFallbackFontSubstitution { public: - WinGlyphFallbackSubstititution( HDC hDC, ImplDevFontList* pDFL ); + WinGlyphFallbackSubstititution( HDC, ImplDevFontList* ); -// void SetHDC( HDC hDC ) { mhDC = hDC; } -// void SetFontList( ImplDevFontList* pFontLiest ) { mpFontList = pFontList; } bool FindFontSubstitute( ImplFontSelectData&, rtl::OUString& rMissingChars ) const; private: HDC mhDC; @@ -418,6 +448,9 @@ inline WinGlyphFallbackSubstititution::WinGlyphFallbackSubstititution( HDC hDC, , mpFontList( pDFL ) {} +void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*, + LOGFONTW&, bool /*bTestVerticalAvail*/ ); + // does a font face hold the given missing characters? bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace, const rtl::OUString& rMissingChars ) const { @@ -491,7 +524,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo aLocale = Application::GetSettings().GetUILocale(); // first level fallback: - // try use the locale specific default fonts in VCL.xcu + // try use the locale specific default fonts defined in VCL.xcu /*const*/ ImplDevFontListData* pDevFont = mpFontList->ImplFindByLocale( aLocale ); if( pDevFont ) { -- cgit v1.2.3 From 155791b70804fb83964c66db1c283c0b4e1ea19d Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 8 Mar 2010 14:31:48 +0100 Subject: #i101552# use current screenfont list for dynamic glyph fallback --- vcl/win/source/gdi/salgdi3.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index a71022ed57b8..42509649ca3f 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -385,6 +385,7 @@ LanguageType MapCharToLanguage( sal_UCS4 uChar ) { bFirst = false; // TODO: use the default-CJK language instead + // TODO: use default language determined by #i97086# // when the setting from Tools->Options->LangSettings->Languages becomes available here LanguageType nDefaultCJK = LANGUAGE_CHINESE; const LanguageType nUILang = Application::GetSettings().GetUILanguage(); @@ -434,18 +435,16 @@ class WinGlyphFallbackSubstititution : public ImplGlyphFallbackFontSubstitution { public: - WinGlyphFallbackSubstititution( HDC, ImplDevFontList* ); + WinGlyphFallbackSubstititution( HDC ); bool FindFontSubstitute( ImplFontSelectData&, rtl::OUString& rMissingChars ) const; private: HDC mhDC; - ImplDevFontList* mpFontList; bool HasMissingChars( const ImplFontData*, const rtl::OUString& rMissingChars ) const; }; -inline WinGlyphFallbackSubstititution::WinGlyphFallbackSubstititution( HDC hDC, ImplDevFontList* pDFL ) +inline WinGlyphFallbackSubstititution::WinGlyphFallbackSubstititution( HDC hDC ) : mhDC( hDC ) -, mpFontList( pDFL ) {} void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*, @@ -525,7 +524,8 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo // first level fallback: // try use the locale specific default fonts defined in VCL.xcu - /*const*/ ImplDevFontListData* pDevFont = mpFontList->ImplFindByLocale( aLocale ); + const ImplDevFontList* pDevFontList = ImplGetSVData()->maGDIData.mpScreenFontList; + /*const*/ ImplDevFontListData* pDevFont = pDevFontList->ImplFindByLocale( aLocale ); if( pDevFont ) { const ImplFontData* pFace = pDevFont->FindBestFontFace( rFontSelData ); @@ -537,7 +537,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo } // are the missing characters symbols? - pDevFont = mpFontList->ImplFindByAttributes( IMPL_FONT_ATTR_SYMBOL, + pDevFont = pDevFontList->ImplFindByAttributes( IMPL_FONT_ATTR_SYMBOL, rFontSelData.meWeight, rFontSelData.meWidthType, rFontSelData.meFamily, rFontSelData.meItalic, rFontSelData.maSearchName ); if( pDevFont ) @@ -551,7 +551,7 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFo } // last level fallback, check each font type face one by one - const ImplGetDevFontList* pTestFontList = mpFontList->GetDevFontList(); + const ImplGetDevFontList* pTestFontList = pDevFontList->GetDevFontList(); // limit the count of fonts to be checked to prevent hangs static const int MAX_GFBFONT_COUNT = 600; int nTestFontCount = pTestFontList->Count(); @@ -2507,8 +2507,8 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList ) bImplSalCourierNew = aInfo.mbImplSalCourierNew; } - // set font fallback hook - static WinGlyphFallbackSubstititution aSubstFallback( mhDC, pFontList ); + // set glyph fallback hook + static WinGlyphFallbackSubstititution aSubstFallback( mhDC ); pFontList->SetFallbackHook( &aSubstFallback ); } -- cgit v1.2.3 From 176b670a1142752950dddfab4bda587c8e8c3bf5 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Tue, 9 Mar 2010 11:38:53 +0100 Subject: ##i101552# use default CJK language determined from the registry --- vcl/win/source/gdi/salgdi3.cxx | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 42509649ca3f..c991d1db2be0 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -379,17 +379,34 @@ static Unicode2LangType aLangFromCodeChart[]= { // get language matching to the missing char LanguageType MapCharToLanguage( sal_UCS4 uChar ) { - // entries marked with default-CJK should get replaced with a default-CJK language + // entries marked with default-CJK get replaced with the prefered CJK language static bool bFirst = true; if( bFirst ) { bFirst = false; - // TODO: use the default-CJK language instead - // TODO: use default language determined by #i97086# - // when the setting from Tools->Options->LangSettings->Languages becomes available here + + // use method suggested in #i97086# to determnine the systems default language + // TODO: move into i18npool or sal/osl/w32/nlsupport.c + LanguageType nDefaultLang = 0; + HKEY hKey = NULL; + LONG lResult = ::RegOpenKeyExA( HKEY_LOCAL_MACHINE, + "SYSTEM\\CurrentControlSet\\Control\\Nls\\Language", + 0, KEY_QUERY_VALUE, &hKey ); + char aKeyValBuf[16]; + DWORD nKeyValSize = sizeof(aKeyValBuf); + if( ERROR_SUCCESS == lResult ) + lResult = RegQueryValueExA( hKey, "Default", NULL, NULL, (LPBYTE)aKeyValBuf, &nKeyValSize ); + aKeyValBuf[ sizeof(aKeyValBuf)-1 ] = '\0'; + if( ERROR_SUCCESS == lResult ) + nDefaultLang = (LanguageType)rtl_str_toInt32( aKeyValBuf, 16 ); + + // TODO: use the default-CJK language selected in + // Tools->Options->LangSettings->Languages when it becomes available here + if( !nDefaultLang ) + nDefaultLang = Application::GetSettings().GetUILanguage(); + LanguageType nDefaultCJK = LANGUAGE_CHINESE; - const LanguageType nUILang = Application::GetSettings().GetUILanguage(); - switch( nUILang ) + switch( nDefaultLang ) { case LANGUAGE_JAPANESE: case LANGUAGE_KOREAN: @@ -399,13 +416,14 @@ LanguageType MapCharToLanguage( sal_UCS4 uChar ) case LANGUAGE_CHINESE_SINGAPORE: case LANGUAGE_CHINESE_HONGKONG: case LANGUAGE_CHINESE_MACAU: - nDefaultCJK = nUILang; + nDefaultCJK = nDefaultLang; break; default: nDefaultCJK = LANGUAGE_CHINESE; break; } + // change the marked entries to prefered language static const int nCount = (sizeof(aLangFromCodeChart) / sizeof(*aLangFromCodeChart)); for( int i = 0; i < nCount; ++i ) { -- cgit v1.2.3 From b73bee2f1e62be1832fe3e4bca36122a78b53092 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 22 Mar 2010 12:21:23 +0100 Subject: #i101552 update the win-gfb unicode->language list --- vcl/win/source/gdi/salgdi3.cxx | 109 ++++++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 39 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index c991d1db2be0..932d1749396d 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -319,7 +319,8 @@ RawFontData::RawFontData( HDC hDC, DWORD nTableTag ) // =========================================================================== // platform specific font substitution hooks for glyph fallback enhancement -// TODO: move into i18n module (maybe merge with svx/ucsubset.*) +// TODO: move into i18n module (maybe merge with svx/ucsubset.* +// or merge with i18nutil/source/utility/unicode_data.h) struct Unicode2LangType { sal_UCS4 mnMinCode; @@ -333,47 +334,77 @@ struct Unicode2LangType // map unicode ranges to languages supported by OOo // NOTE: due to the binary search used this list must be sorted by mnMinCode static Unicode2LangType aLangFromCodeChart[]= { - {0x0000, 0x007f, LANGUAGE_ENGLISH}, // Basic Latin - {0x0080, 0x024f, LANGUAGE_ENGLISH}, // Latin Extended-A and Latin Extended-B - {0x0250, 0x02af, LANGUAGE_SYSTEM}, // IPA Extensions - {0x0370, 0x03ff, LANGUAGE_GREEK}, // Greek - {0x0590, 0x05ff, LANGUAGE_HEBREW}, // Hebrew - {0x0600, 0x06ff, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic - {0x0900, 0x097f, LANGUAGE_HINDI}, // Devanagari - {0x0980, 0x09ff, LANGUAGE_BENGALI}, // Bengali - {0x0a80, 0x0aff, LANGUAGE_GUJARATI}, // Gujarati - {0x0b00, 0x0b7f, LANGUAGE_ORIYA}, // Oriya - {0x0b80, 0x0bff, LANGUAGE_TAMIL}, // Tamil - {0x0e00, 0x0e7f, LANGUAGE_THAI}, // Thai - {0x0e80, 0x0eff, LANGUAGE_LAO}, // Lao - {0x1000, 0x109f, LANGUAGE_BURMESE}, // Burmese - {0x1100, 0x11ff, LANGUAGE_KOREAN}, // Hangul Jamo, Korean-specific - {0x1780, 0x17ff, LANGUAGE_KHMER}, // Khmer - {0x1e00, 0x1eff, LANGUAGE_ENGLISH}, // Latin Extended Additional - {0x2c60, 0x2c7f, LANGUAGE_ENGLISH}, // Latin Extended-C - {0x2e80, 0x2fff, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Radicals Supplement + Kangxi Radical + Ideographic Description Characters + {0x0000, 0x007F, LANGUAGE_ENGLISH}, // Basic Latin + {0x0080, 0x024F, LANGUAGE_ENGLISH}, // Latin Extended-A and Latin Extended-B + {0x0250, 0x02AF, LANGUAGE_SYSTEM}, // IPA Extensions + {0x0370, 0x03FF, LANGUAGE_GREEK}, // Greek + {0x0590, 0x05FF, LANGUAGE_HEBREW}, // Hebrew + {0x0600, 0x06FF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic + {0x0900, 0x097F, LANGUAGE_HINDI}, // Devanagari + {0x0980, 0x09FF, LANGUAGE_BENGALI}, // Bengali + {0x0A80, 0x0AFF, LANGUAGE_GUJARATI}, // Gujarati + {0x0B00, 0x0B7F, LANGUAGE_ORIYA}, // Oriya + {0x0B80, 0x0BFF, LANGUAGE_TAMIL}, // Tamil + {0x0C00, 0x0C7F, LANGUAGE_TELUGU}, // Telugu + {0x0C80, 0x0CFF, LANGUAGE_KANNADA}, // Kannada + {0x0D00, 0x0D7F, LANGUAGE_MALAYALAM}, // Malayalam + {0x0D80, 0x0D7F, LANGUAGE_SINHALESE_SRI_LANKA}, // Sinhala + {0x0E00, 0x0E7F, LANGUAGE_THAI}, // Thai + {0x0E80, 0x0EFF, LANGUAGE_LAO}, // Lao + {0x0F00, 0x0FFF, LANGUAGE_TIBETAN}, // Tibetan + {0x1000, 0x109F, LANGUAGE_BURMESE}, // Burmese + {0x10A0, 0x10FF, LANGUAGE_GEORGIAN}, // Georgian + {0x1100, 0x11FF, LANGUAGE_KOREAN}, // Hangul Jamo, Korean-specific +// {0x1200, 0x139F, LANGUAGE_AMHARIC_ETHIOPIA}, // Ethiopic +// {0x1200, 0x139F, LANGUAGE_TIGRIGNA_ETHIOPIA}, // Ethiopic + {0x13A0, 0x13FF, LANGUAGE_CHEROKEE_UNITED_STATES}, // Cherokee +// {0x1400, 0x167F, LANGUAGE_CANADIAN_ABORIGINAL}, // Canadian Aboriginial Syllabics +// {0x1680, 0x169F, LANGUAGE_OGHAM}, // Ogham +// {0x16A0, 0x16F0, LANGUAGE_RUNIC}, // Runic +// {0x1700, 0x171F, LANGUAGE_TAGALOG}, // Tagalog +// {0x1720, 0x173F, LANGUAGE_HANUNOO}, // Hanunoo +// {0x1740, 0x175F, LANGUAGE_BUHID}, // Buhid +// {0x1760, 0x177F, LANGUAGE_TAGBANWA}, // Tagbanwa + {0x1780, 0x17FF, LANGUAGE_KHMER}, // Khmer + {0x18A0, 0x18AF, LANGUAGE_MONGOLIAN}, // Mongolian +// {0x1900, 0x194F, LANGUAGE_LIMBU}, // Limbu +// {0x1950, 0x197F, LANGUAGE_TAILE}, // Tai Le +// {0x1980, 0x19DF, LANGUAGE_TAILUE}, // Tai Lue + {0x19E0, 0x19FF, LANGUAGE_KHMER}, // Khmer Symbols +// {0x1A00, 0x1A1F, LANGUAGE_BUGINESE}, // Buginese/Lontara +// {0x1B00, 0x1B7F, LANGUAGE_BALINESE}, // Balinese +// {0x1D00, 0x1DFF, LANGUAGE_NONE}, // Phonetic Symbols + {0x1E00, 0x1EFF, LANGUAGE_ENGLISH}, // Latin Extended Additional + {0x1F00, 0x1FFF, LANGUAGE_GREEK}, // Greek Extended + {0x2C60, 0x2C7F, LANGUAGE_ENGLISH}, // Latin Extended-C + {0x2E80, 0x2FFf, LANGUAGE_CHINESE_SIMPLIFIED}, // CJK Radicals Supplement + Kangxi Radical + Ideographic Description Characters {0x3000, 0x303F, LANGUAGE_DEFAULT_CJK}, // CJK Symbols and punctuation {0x3040, 0x30FF, LANGUAGE_JAPANESE}, // Japanese Hiragana + Katakana - {0x3100, 0x312f, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo - {0x3130, 0x318f, LANGUAGE_KOREAN}, // Hangul Compatibility Jamo, Kocrean-specific - {0x3190, 0x319f, LANGUAGE_JAPANESE}, // Kanbun - {0x31a0, 0x31bf, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended - {0x31c0, 0x31ef, LANGUAGE_DEFAULT_CJK}, // CJK Ideographs - {0x31f0, 0x31ff, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions - {0x3400, 0x4dbf, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension A - {0x4e00, 0x9fcf, LANGUAGE_DEFAULT_CJK}, // Unified CJK Ideographs - {0xa720, 0xa7ff, LANGUAGE_ENGLISH}, // Latin Extended-D - {0xac00, 0xd7af, LANGUAGE_KOREAN}, // Hangul Syllables, Kocrean-specific + {0x3100, 0x312F, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo + {0x3130, 0x318F, LANGUAGE_KOREAN}, // Hangul Compatibility Jamo, Kocrean-specific + {0x3190, 0x319F, LANGUAGE_JAPANESE}, // Kanbun + {0x31A0, 0x31BF, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended + {0x31C0, 0x31EF, LANGUAGE_DEFAULT_CJK}, // CJK Ideographs + {0x31F0, 0x31FF, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions + {0x3200, 0x321F, LANGUAGE_KOREAN}, + {0x3220, 0x325F, LANGUAGE_DEFAULT_CJK}, + {0x3260, 0x327F, LANGUAGE_KOREAN}, + {0x3280, 0x32CF, LANGUAGE_DEFAULT_CJK}, + {0x32d0, 0x32FF, LANGUAGE_JAPANESE}, // Japanese Circled Katakana + {0x3400, 0x4DBF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension A + {0x4E00, 0x9FCF, LANGUAGE_DEFAULT_CJK}, // Unified CJK Ideographs + {0xA720, 0xA7FF, LANGUAGE_ENGLISH}, // Latin Extended-D + {0xAC00, 0xD7AF, LANGUAGE_KOREAN}, // Hangul Syllables, Korean-specific {0xF900, 0xFAFF, LANGUAGE_DEFAULT_CJK}, // CJK Compatibility Ideographs - {0xfb00, 0xfb4f, LANGUAGE_HEBREW}, // Hibrew present forms - {0xfb50, 0xfdff, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A - {0xfe70, 0xfefe, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B - {0xff65, 0xff9f, LANGUAGE_JAPANESE}, // Japanese Halfwidth Katakana variant - {0xffa0, 0xffDC, LANGUAGE_KOREAN}, // Kocrean halfwidth hangual variant - {0x10140, 0x1018f, LANGUAGE_GREEK}, // Ancient Greak numbers - {0x1d200, 0x1d24f, LANGUAGE_GREEK}, // Ancient Greek Musical - {0x20000, 0x2a6df, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension B - {0x2f800, 0x2fa1f, LANGUAGE_DEFAULT_CJK} // CJK Compatibility Ideographs Supplement + {0xFB00, 0xFB4F, LANGUAGE_HEBREW}, // Hebrew present forms + {0xFB50, 0xFDFF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A + {0xFE70, 0xFEFE, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B + {0xFF65, 0xFF9F, LANGUAGE_JAPANESE}, // Japanese Halfwidth Katakana variant + {0xFFA0, 0xFFDC, LANGUAGE_KOREAN}, // Kocrean halfwidth hangual variant + {0x10140, 0x1018F, LANGUAGE_GREEK}, // Ancient Greak numbers + {0x1D200, 0x1D24F, LANGUAGE_GREEK}, // Ancient Greek Musical + {0x20000, 0x2A6DF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension B + {0x2F800, 0x2FA1F, LANGUAGE_DEFAULT_CJK} // CJK Compatibility Ideographs Supplement }; // get language matching to the missing char -- cgit v1.2.3 From 68761cb20d4aa261b671166a5658942a0069a58a Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Mon, 22 Mar 2010 15:05:10 +0100 Subject: #i101552# minor finishing touches on CWS gfb4win02 --- vcl/win/source/gdi/salgdi3.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 932d1749396d..2145de5abce3 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -386,17 +386,17 @@ static Unicode2LangType aLangFromCodeChart[]= { {0x31A0, 0x31BF, LANGUAGE_CHINESE_TRADITIONAL}, // Bopomofo Extended {0x31C0, 0x31EF, LANGUAGE_DEFAULT_CJK}, // CJK Ideographs {0x31F0, 0x31FF, LANGUAGE_JAPANESE}, // Japanese Katakana Phonetic Extensions - {0x3200, 0x321F, LANGUAGE_KOREAN}, - {0x3220, 0x325F, LANGUAGE_DEFAULT_CJK}, - {0x3260, 0x327F, LANGUAGE_KOREAN}, - {0x3280, 0x32CF, LANGUAGE_DEFAULT_CJK}, + {0x3200, 0x321F, LANGUAGE_KOREAN}, // Parenthesized Hangul + {0x3220, 0x325F, LANGUAGE_DEFAULT_CJK}, // Parenthesized Ideographs + {0x3260, 0x327F, LANGUAGE_KOREAN}, // Circled Hangul + {0x3280, 0x32CF, LANGUAGE_DEFAULT_CJK}, // Circled Ideographs {0x32d0, 0x32FF, LANGUAGE_JAPANESE}, // Japanese Circled Katakana {0x3400, 0x4DBF, LANGUAGE_DEFAULT_CJK}, // CJK Unified Ideographs Extension A {0x4E00, 0x9FCF, LANGUAGE_DEFAULT_CJK}, // Unified CJK Ideographs {0xA720, 0xA7FF, LANGUAGE_ENGLISH}, // Latin Extended-D {0xAC00, 0xD7AF, LANGUAGE_KOREAN}, // Hangul Syllables, Korean-specific {0xF900, 0xFAFF, LANGUAGE_DEFAULT_CJK}, // CJK Compatibility Ideographs - {0xFB00, 0xFB4F, LANGUAGE_HEBREW}, // Hebrew present forms + {0xFB00, 0xFB4F, LANGUAGE_HEBREW}, // Hebrew Presentation Forms {0xFB50, 0xFDFF, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-A {0xFE70, 0xFEFE, LANGUAGE_ARABIC_PRIMARY_ONLY}, // Arabic Presentation Forms-B {0xFF65, 0xFF9F, LANGUAGE_JAPANESE}, // Japanese Halfwidth Katakana variant @@ -484,7 +484,7 @@ class WinGlyphFallbackSubstititution : public ImplGlyphFallbackFontSubstitution { public: - WinGlyphFallbackSubstititution( HDC ); + explicit WinGlyphFallbackSubstititution( HDC ); bool FindFontSubstitute( ImplFontSelectData&, rtl::OUString& rMissingChars ) const; private: -- cgit v1.2.3