Index: svtools/util/makefile.mk =================================================================== RCS file: /cvs/util/svtools/util/makefile.mk,v retrieving revision 1.59 diff -u -r1.59 makefile.mk --- svtools/util/makefile.mk 19 Jun 2006 21:29:51 -0000 1.59 +++ svtools/util/makefile.mk 28 Oct 2007 08:24:20 -0000 @@ -158,6 +158,9 @@ $(ICUUCLIB) \ $(JVMFWKLIB) +SHL1STDLIBS+=\ + $(ICUINLIB) + .IF "$(OS)"=="MACOSX" # static libraries go at end SHL1STDLIBS+= $(JPEG3RDLIB) Index: svtools/inc/ctrlbox.hxx =================================================================== RCS file: /cvs/util/svtools/inc/ctrlbox.hxx,v retrieving revision 1.12.204.2 diff -u -r1.12.204.2 ctrlbox.hxx --- svtools/inc/ctrlbox.hxx 19 Jan 2007 16:18:39 -0000 1.12.204.2 +++ svtools/inc/ctrlbox.hxx 28 Oct 2007 08:24:20 -0000 @@ -59,6 +59,9 @@ #include #endif +#include +#include + class ImplFontList; class ImpColorList; class ImpLineList; @@ -413,6 +416,7 @@ // declared as private because some compilers would generate the default functions FontNameBox( const FontNameBox& ); FontNameBox& operator =( const FontNameBox& ); + void getExampleText(const char *localeID, String& aTestText) ; }; // ---------------- Index: svtools/source/control/ctrlbox.cxx =================================================================== RCS file: /cvs/util/svtools/source/control/ctrlbox.cxx,v retrieving revision 1.21.86.2 diff -u -r1.21.86.2 ctrlbox.cxx --- svtools/source/control/ctrlbox.cxx 19 Jan 2007 16:18:52 -0000 1.21.86.2 +++ svtools/source/control/ctrlbox.cxx 28 Oct 2007 08:24:20 -0000 @@ -61,6 +61,13 @@ #include +#include +#include + +#ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX +#include +#endif + #define IMGTEXTSPACE 2 #define EXTRAFONTSIZE 5 @@ -760,6 +767,7 @@ bSymbolFont = bStarSymbol = TRUE; } + nMaxLen += 12; // Since we want to add " - ABC" or some other sample, possibly for both CTL and CJK // guess maximimum width Size aOneCharSz( GetTextWidth( String( 'X' ) ), GetTextHeight() ); Size aSz( aOneCharSz ); @@ -790,6 +798,24 @@ } // ------------------------------------------------------------------- +void FontNameBox::getExampleText(const char *localeID, String& aTestText) +{ + UErrorCode status = U_ZERO_ERROR; + ULocaleData * uld = ulocdata_open(localeID, &status); + if (U_FAILURE(status)) + return; + uint32_t options = USET_CASE_INSENSITIVE; + ULocaleDataExemplarSetType extype = ULOCDATA_ES_STANDARD,; + USet* pUSet = ulocdata_getExemplarSet (uld, 0, options, extype, &status ) ; + + aTestText.Append( (sal_Unicode)uset_charAt(pUSet,0)); + aTestText.Append( (sal_Unicode)uset_charAt(pUSet,1)); + aTestText.Append( (sal_Unicode)uset_charAt(pUSet,2)); + + uset_close(pUSet); + ulocdata_close(uld); +} +// ------------------------------------------------------------------- void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) { @@ -851,9 +877,52 @@ long nTextHeight = rUDEvt.GetDevice()->GetTextHeight(); Point aPos( nX, aTopLeft.Y() + (nH-nTextHeight)/2 ); + bool bShowWestern = false; + bool bShowCTL = false; + bool bShowCJK = false; + String aWesternText, aCTLText, aCJKText; + SvtLanguageOptions aLanguageOptions; + + if ( aLanguageOptions.IsCTLFontEnabled() || aLanguageOptions.IsCJKFontEnabled()) + { + SvtLinguConfig* pImplLinguConfig = new SvtLinguConfig(); + SvtLinguOptions aLinguOptions; + bool bOptionRet = pImplLinguConfig->GetOptions(aLinguOptions); + + rtl::OString rLangStrWestern = MsLangId::convertLanguageToIsoByteString(aLinguOptions.nDefaultLanguage); + rtl::OString rLangStrCTL = MsLangId::convertLanguageToIsoByteString(aLinguOptions.nDefaultLanguage_CTL); + rtl::OString rLangStrCJK = MsLangId::convertLanguageToIsoByteString(aLinguOptions.nDefaultLanguage_CJK); + + getExampleText(rLangStrWestern.getStr(),aWesternText); + getExampleText(rLangStrCTL.getStr(),aCTLText); + getExampleText(rLangStrCJK.getStr(),aCJKText); + + bShowWestern = HasGlyphs( aFont, aWesternText ) >= aWesternText.Len(); + bShowCTL = HasGlyphs( aFont, aCTLText ) >= aCTLText.Len() && aLanguageOptions.IsCTLFontEnabled(); + bShowCJK = HasGlyphs( aFont, aCJKText ) >= aCJKText.Len() && aLanguageOptions.IsCJKFontEnabled();; + } + String aString; if( !bSymbolFont ) + { aString = rInfo.GetName(); + if (bShowWestern || bShowCTL || bShowCJK) + { + aString.AppendAscii( " - " ); + if (bShowCTL && bShowCJK) + { + aString += aCTLText; + aString.AppendAscii( " - " ); + aString += aCJKText; + } + else if (bShowCTL) + aString += aCTLText; + else if (bShowCJK) + aString += aCJKText; + else + aString += aWesternText; + } + } else { // use some sample characters available in the font