Lines 55-61
Link Here
|
55 |
|
55 |
|
56 |
#include <svx/fntctrl.hxx> |
56 |
#include <svx/fntctrl.hxx> |
57 |
#include <svx/dialogs.hrc> |
57 |
#include <svx/dialogs.hrc> |
58 |
#define TEXT_WIDTH 20 |
58 |
#define TEXT_WIDTH 60 |
59 |
|
59 |
|
60 |
using namespace ::com::sun::star::uno; |
60 |
using namespace ::com::sun::star::uno; |
61 |
using namespace ::com::sun::star::lang; |
61 |
using namespace ::com::sun::star::lang; |
Lines 137-161
Link Here
|
137 |
long n100PercentFontWidthCTL; |
137 |
long n100PercentFontWidthCTL; |
138 |
UINT16 nFontWidthScale; |
138 |
UINT16 nFontWidthScale; |
139 |
|
139 |
|
140 |
BOOL bSelection : 1, |
140 |
LanguageType eWesternLang; |
|
|
141 |
LanguageType eCJKLang; |
142 |
LanguageType eCTLLang; |
143 |
|
144 |
BOOL bSelection : 1, |
141 |
bGetSelection : 1, |
145 |
bGetSelection : 1, |
142 |
bUseResText : 1, |
146 |
bUseResText : 1, |
143 |
bTwoLines : 1, |
147 |
bTwoLines : 1, |
144 |
bIsCJKUI : 1, |
148 |
bIsCJKUI : 1, |
145 |
bIsCTLUI : 1, |
149 |
bIsCTLUI : 1, |
146 |
bUseFontNameAsText : 1, |
150 |
bUseFontNameAsText : 1, |
147 |
bTextInited : 1; |
151 |
bTextInited : 1, |
|
|
152 |
bIsCJKSupported : 1, |
153 |
bIsCTLSupported : 1; |
148 |
|
154 |
|
149 |
void _CheckScript(); |
155 |
void _CheckScript(); |
|
|
156 |
String GetPreviewString( bool bCTL, LanguageType eLang ); |
150 |
public: |
157 |
public: |
151 |
inline FontPrevWin_Impl() : |
158 |
inline FontPrevWin_Impl() : |
152 |
pPrinter( NULL ), bDelPrinter( FALSE ), |
159 |
pPrinter( NULL ), bDelPrinter( FALSE ), |
153 |
pColor( NULL ), pBackColor( 0 ), |
160 |
pColor( NULL ), pBackColor( 0 ), |
154 |
cStartBracket( 0 ), cEndBracket( 0 ), nFontWidthScale( 100 ), |
161 |
cStartBracket( 0 ), cEndBracket( 0 ), nFontWidthScale( 100 ), |
|
|
162 |
eWesternLang(LANGUAGE_NONE), |
163 |
eCJKLang(LANGUAGE_NONE), |
164 |
eCTLLang(LANGUAGE_NONE), |
155 |
bSelection( FALSE ), bGetSelection( FALSE ), bUseResText( FALSE ), |
165 |
bSelection( FALSE ), bGetSelection( FALSE ), bUseResText( FALSE ), |
156 |
bTwoLines( FALSE ), |
166 |
bTwoLines( FALSE ), |
157 |
bIsCJKUI( FALSE ), bIsCTLUI( FALSE ), |
167 |
bIsCJKUI( FALSE ), bIsCTLUI( FALSE ), |
158 |
bUseFontNameAsText( FALSE ), bTextInited( FALSE ) |
168 |
bUseFontNameAsText( FALSE ), bTextInited( FALSE ), |
|
|
169 |
bIsCTLSupported( FALSE ), |
170 |
bIsCJKSupported( FALSE ) |
159 |
{ |
171 |
{ |
160 |
Invalidate100PercentFontWidth(); |
172 |
Invalidate100PercentFontWidth(); |
161 |
} |
173 |
} |
Lines 201-206
Link Here
|
201 |
return n100PercentFontWidth != -1; |
213 |
return n100PercentFontWidth != -1; |
202 |
} |
214 |
} |
203 |
|
215 |
|
|
|
216 |
String FontPrevWin_Impl::GetPreviewString( bool bCTL, LanguageType eLang ) |
217 |
{ |
218 |
String sRet; |
219 |
if( bCTL ) |
220 |
{ |
221 |
ByteString sExample; |
222 |
//find a string related to the language type |
223 |
//if LANGUAGE_NONE is set then show the font name |
224 |
switch( eLang) |
225 |
{ |
226 |
case LANGUAGE_ARABIC : |
227 |
case LANGUAGE_ARABIC_ALGERIA : |
228 |
case LANGUAGE_ARABIC_BAHRAIN : |
229 |
case LANGUAGE_ARABIC_EGYPT : |
230 |
case LANGUAGE_ARABIC_IRAQ : |
231 |
case LANGUAGE_ARABIC_JORDAN : |
232 |
case LANGUAGE_ARABIC_KUWAIT : |
233 |
case LANGUAGE_ARABIC_LEBANON : |
234 |
case LANGUAGE_ARABIC_LIBYA : |
235 |
case LANGUAGE_ARABIC_MOROCCO : |
236 |
case LANGUAGE_ARABIC_OMAN : |
237 |
case LANGUAGE_ARABIC_QATAR : |
238 |
case LANGUAGE_ARABIC_SAUDI_ARABIA : |
239 |
case LANGUAGE_ARABIC_SYRIA : |
240 |
case LANGUAGE_ARABIC_TUNISIA : |
241 |
case LANGUAGE_ARABIC_UAE : |
242 |
case LANGUAGE_ARABIC_YEMEN : |
243 |
sExample = ByteString("+BkYGTgZFBk8GSAYwBk4GLA-"); |
244 |
break; |
245 |
case LANGUAGE_HEBREW: |
246 |
sExample = ByteString("+BdMF1QXSBd4F1A-"); |
247 |
break; |
248 |
case LANGUAGE_NONE: |
249 |
//no break; |
250 |
default:; |
251 |
} |
252 |
if( sExample.Len() ) |
253 |
sRet = String( sExample, RTL_TEXTENCODING_UTF7 ); |
254 |
else |
255 |
sRet = aCJKFont.GetName(); |
256 |
} |
257 |
else |
258 |
{ |
259 |
ByteString sExample; |
260 |
//if LANGUAGE_NONE is set then show the font name |
261 |
switch( eLang) |
262 |
{ |
263 |
case LANGUAGE_JAPANESE: |
264 |
sExample = ByteString("+AA0wtTDzMNcw6w-"); |
265 |
break; |
266 |
case LANGUAGE_CHINESE: |
267 |
case LANGUAGE_CHINESE_MACAU: |
268 |
case LANGUAGE_CHINESE_SIMPLIFIED: |
269 |
sExample = ByteString("+aDdUwQ-"); |
270 |
break; |
271 |
case LANGUAGE_CHINESE_SINGAPORE: |
272 |
case LANGUAGE_CHINESE_HONGKONG: |
273 |
case LANGUAGE_CHINESE_TRADITIONAL: |
274 |
sExample = ByteString("+aiNUwQ-"); |
275 |
break; |
276 |
case LANGUAGE_KOREAN: |
277 |
case LANGUAGE_KOREAN_JOHAB: |
278 |
sExample = ByteString("+rKy8+A-"); |
279 |
break; |
280 |
case LANGUAGE_NONE: |
281 |
//no break; |
282 |
default:; |
283 |
} |
284 |
if( sExample.Len() ) |
285 |
sRet = String( sExample, RTL_TEXTENCODING_UTF7 ); |
286 |
else |
287 |
sRet = aCJKFont.GetName(); |
288 |
} |
289 |
return sRet; |
290 |
} |
291 |
|
204 |
// class FontPrevWin_Impl ----------------------------------------------- |
292 |
// class FontPrevWin_Impl ----------------------------------------------- |
205 |
|
293 |
|
206 |
/*-----------------19.7.2001 08:44------------------ |
294 |
/*-----------------19.7.2001 08:44------------------ |
Lines 557-562
Link Here
|
557 |
|
645 |
|
558 |
// ----------------------------------------------------------------------- |
646 |
// ----------------------------------------------------------------------- |
559 |
|
647 |
|
|
|
648 |
void SvxFontPrevWindow::SetLanguages( |
649 |
LanguageType eWesternLang, LanguageType eCJKLang, LanguageType eCTLLang ) |
650 |
{ |
651 |
pImpl->eWesternLang = eWesternLang; |
652 |
pImpl->eCJKLang = eCJKLang; |
653 |
pImpl->eCTLLang = eCTLLang; |
654 |
} |
655 |
// ----------------------------------------------------------------------- |
656 |
|
657 |
void SvxFontPrevWindow::SetLanguageSupport( sal_Bool bCJK, sal_Bool bCTL ) |
658 |
{ |
659 |
pImpl->bIsCTLSupported = bCTL; |
660 |
pImpl->bIsCJKSupported = bCJK; |
661 |
} |
662 |
// ----------------------------------------------------------------------- |
663 |
|
560 |
void SvxFontPrevWindow::SetFont( const SvxFont& rOutFont ) |
664 |
void SvxFontPrevWindow::SetFont( const SvxFont& rOutFont ) |
561 |
{ |
665 |
{ |
562 |
setFont( rOutFont, pImpl->aFont ); |
666 |
setFont( rOutFont, pImpl->aFont ); |
Lines 641-655
Link Here
|
641 |
pImpl->aText = pSh->GetSelectionText(); |
745 |
pImpl->aText = pSh->GetSelectionText(); |
642 |
pImpl->bGetSelection = TRUE; |
746 |
pImpl->bGetSelection = TRUE; |
643 |
pImpl->bSelection = pImpl->aText.Len() != 0; |
747 |
pImpl->bSelection = pImpl->aText.Len() != 0; |
644 |
|
|
|
645 |
} |
748 |
} |
646 |
|
749 |
|
647 |
if ( !pImpl->bSelection || pImpl->bUseFontNameAsText ) |
750 |
if ( !pImpl->bSelection || pImpl->bUseFontNameAsText ) |
648 |
{ |
751 |
{ |
649 |
pImpl->aText = rFont.GetName(); |
752 |
pImpl->aText = rFont.GetName(); |
650 |
if( pImpl->bIsCJKUI ) |
753 |
String sDistance(String::CreateFromAscii("______")); |
651 |
pImpl->aText += rCJKFont.GetName(); |
754 |
if( pImpl->bIsCJKSupported ) |
652 |
//TODO bIsCTLUI |
755 |
{ |
|
|
756 |
// pImpl->aText += rCJKFont.GetName(); |
757 |
pImpl->aText += sDistance; |
758 |
pImpl->aText += pImpl->GetPreviewString( false, pImpl->eCJKLang ); |
759 |
} |
760 |
if( pImpl->bIsCTLSupported ) |
761 |
{ |
762 |
pImpl->aText += sDistance; |
763 |
pImpl->aText += pImpl->GetPreviewString( true, pImpl->eCTLLang ); |
764 |
} |
765 |
|
653 |
} |
766 |
} |
654 |
|
767 |
|
655 |
if ( !pImpl->aText.Len() ) |
768 |
if ( !pImpl->aText.Len() ) |