Lines 61-66
Link Here
|
61 |
|
61 |
|
62 |
#include <vcl/i18nhelp.hxx> |
62 |
#include <vcl/i18nhelp.hxx> |
63 |
|
63 |
|
|
|
64 |
#include <svtools/lingucfg.hxx> |
65 |
#include <i18npool/mslangid.hxx> |
66 |
|
67 |
#ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX |
68 |
#include <svtools/languageoptions.hxx> |
69 |
#endif |
70 |
|
64 |
#define IMGTEXTSPACE 2 |
71 |
#define IMGTEXTSPACE 2 |
65 |
#define EXTRAFONTSIZE 5 |
72 |
#define EXTRAFONTSIZE 5 |
66 |
|
73 |
|
Lines 759-765
Link Here
|
759 |
|| aFontName.EqualsIgnoreCaseAscii( "opensymbol" ) ) |
766 |
|| aFontName.EqualsIgnoreCaseAscii( "opensymbol" ) ) |
760 |
bSymbolFont = bStarSymbol = TRUE; |
767 |
bSymbolFont = bStarSymbol = TRUE; |
761 |
} |
768 |
} |
762 |
|
769 |
|
|
|
770 |
nMaxLen += 6; // Since we want to add " - ABC" or some other sample |
763 |
// guess maximimum width |
771 |
// guess maximimum width |
764 |
Size aOneCharSz( GetTextWidth( String( 'X' ) ), GetTextHeight() ); |
772 |
Size aOneCharSz( GetTextWidth( String( 'X' ) ), GetTextHeight() ); |
765 |
Size aSz( aOneCharSz ); |
773 |
Size aSz( aOneCharSz ); |
Lines 790-795
Link Here
|
790 |
} |
798 |
} |
791 |
|
799 |
|
792 |
// ------------------------------------------------------------------- |
800 |
// ------------------------------------------------------------------- |
|
|
801 |
void FontNameBox::getExampleText(const char *localeID, String& aTestText) |
802 |
{ |
803 |
UErrorCode status = U_ZERO_ERROR; |
804 |
ULocaleData * uld = ulocdata_open(localeID, &status); |
805 |
if (U_FAILURE(status)) |
806 |
return; |
807 |
uint32_t options = USET_CASE_INSENSITIVE; |
808 |
ULocaleDataExemplarSetType extype = ULOCDATA_ES_STANDARD,; |
809 |
USet* pUSet = ulocdata_getExemplarSet (uld, 0, options, extype, &status ) ; |
810 |
UChar32 char1 = uset_charAt(pUSet,0); |
811 |
UChar32 char2 = uset_charAt(pUSet,1); |
812 |
UChar32 char3 = uset_charAt(pUSet,2); |
813 |
|
814 |
aTestText.Append( (sal_Unicode)char1); |
815 |
aTestText.Append( (sal_Unicode)char2); |
816 |
aTestText.Append( (sal_Unicode)char3); |
817 |
|
818 |
uset_close(pUSet); |
819 |
ulocdata_close(uld); |
820 |
} |
821 |
// ------------------------------------------------------------------- |
793 |
|
822 |
|
794 |
void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) |
823 |
void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) |
795 |
{ |
824 |
{ |
Lines 851-859
Link Here
|
851 |
long nTextHeight = rUDEvt.GetDevice()->GetTextHeight(); |
880 |
long nTextHeight = rUDEvt.GetDevice()->GetTextHeight(); |
852 |
Point aPos( nX, aTopLeft.Y() + (nH-nTextHeight)/2 ); |
881 |
Point aPos( nX, aTopLeft.Y() + (nH-nTextHeight)/2 ); |
853 |
|
882 |
|
|
|
883 |
bool bHasCTL = false; |
884 |
bool bHasWestern = false; |
885 |
String aCTLText, aWesternText; |
886 |
SvtLanguageOptions aLanguageOptions; |
887 |
|
888 |
if ( aLanguageOptions.IsCTLFontEnabled() ) |
889 |
{ |
890 |
SvtLinguConfig* pImplLinguConfig = new SvtLinguConfig(); |
891 |
SvtLinguOptions aLinguOptions; |
892 |
bool bOptionRet = pImplLinguConfig->GetOptions(aLinguOptions); |
893 |
|
894 |
INT16 nDefaultWestern = aLinguOptions.nDefaultLanguage; |
895 |
INT16 nDefaultCTL = aLinguOptions.nDefaultLanguage_CTL; |
896 |
|
897 |
rtl::OString rLangStr = MsLangId::convertLanguageToIsoByteString(nDefaultWestern); |
898 |
rtl::OString rLangStrCTL = MsLangId::convertLanguageToIsoByteString(nDefaultCTL); |
899 |
|
900 |
getExampleText(rLangStr.getStr(),aWesternText); |
901 |
getExampleText(rLangStrCTL.getStr(),aCTLText); |
902 |
|
903 |
bHasCTL = HasGlyphs( aFont, aCTLText ) >= aCTLText.Len(); |
904 |
bHasWestern = HasGlyphs( aFont, aWesternText ) >= aWesternText.Len(); |
905 |
} |
906 |
|
854 |
String aString; |
907 |
String aString; |
855 |
if( !bSymbolFont ) |
908 |
if( !bSymbolFont ) |
|
|
909 |
{ |
856 |
aString = rInfo.GetName(); |
910 |
aString = rInfo.GetName(); |
|
|
911 |
if (bHasCTL || bHasWestern) |
912 |
{ |
913 |
aString.AppendAscii( " - " ); |
914 |
if (bHasCTL) |
915 |
aString += aCTLText; |
916 |
else |
917 |
aString += aWesternText; |
918 |
} |
919 |
} |
857 |
else |
920 |
else |
858 |
{ |
921 |
{ |
859 |
// use some sample characters available in the font |
922 |
// use some sample characters available in the font |