diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-10-21 09:33:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-21 11:27:39 +0100 |
commit | e84482a38363004d5dc2fde24e57d4215b48797a (patch) | |
tree | 3b060be8bfb764ac030b520d2347be407100a4df /cui | |
parent | 41c083a7ade3feb7f5b6516f859db00fa8e2cf72 (diff) |
Use language/script specific CTL/CJK sample text in font preview
i.e. font names are often typically in English, so fairly useless
to take the English name to preview what effect the font will have
in a CTL/CJK script.
More languages and scripts need to be added, but this should be
sufficient to bootstrap this up
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 782af954b9a1..a92019eeeaa2 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -493,12 +493,15 @@ void SvxCharNamePage::Initialize() m_pWestFontNameLB->SetModifyHdl( aLink ); m_pWestFontStyleLB->SetModifyHdl( aLink ); m_pWestFontSizeLB->SetModifyHdl( aLink ); + m_pWestFontLanguageLB->SetSelectHdl( aLink ); m_pEastFontNameLB->SetModifyHdl( aLink ); m_pEastFontStyleLB->SetModifyHdl( aLink ); m_pEastFontSizeLB->SetModifyHdl( aLink ); + m_pEastFontLanguageLB->SetSelectHdl( aLink ); m_pCTLFontNameLB->SetModifyHdl( aLink ); m_pCTLFontStyleLB->SetModifyHdl( aLink ); m_pCTLFontSizeLB->SetModifyHdl( aLink ); + m_pCTLFontLanguageLB->SetSelectHdl( aLink ); m_pImpl->m_aUpdateTimer.SetTimeoutHdl( LINK( this, SvxCharNamePage, UpdateHdl_Impl ) ); @@ -547,6 +550,7 @@ namespace const FontNameBox* _pFontNameLB, const FontStyleBox* _pFontStyleLB, const FontSizeBox* _pFontSizeLB, + const SvxLanguageBox* _pLanguageLB, const FontList* _pFontList, sal_uInt16 _nFontWhich, sal_uInt16 _nFontHeightWhich) @@ -556,7 +560,7 @@ namespace FontInfo aFontInfo; String sFontName(_pFontNameLB->GetText()); sal_Bool bFontAvailable = _pFontList->IsAvailable( sFontName ); - if(bFontAvailable || _pFontNameLB->GetSavedValue() != sFontName) + if (bFontAvailable || _pFontNameLB->GetSavedValue() != sFontName) aFontInfo = _pFontList->Get( sFontName, _pFontStyleLB->GetText() ); else { @@ -594,6 +598,8 @@ namespace aSize.Height() = 200; // default 10pt aFontInfo.SetSize( aSize ); + _rFont.SetLanguage(_pLanguageLB->GetSelectLanguage()); + _rFont.SetFamily( aFontInfo.GetFamily() ); _rFont.SetName( aFontInfo.GetName() ); _rFont.SetStyleName( aFontInfo.GetStyleName() ); @@ -624,11 +630,11 @@ void SvxCharNamePage::UpdatePreview_Impl() // Font const FontList* pFontList = GetFontList(); FontInfo aFontInfo = - calcFontInfo(rFont,this,m_pWestFontNameLB,m_pWestFontStyleLB,m_pWestFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_FONT ),GetWhich( SID_ATTR_CHAR_FONTHEIGHT )); + calcFontInfo(rFont,this,m_pWestFontNameLB,m_pWestFontStyleLB,m_pWestFontSizeLB,m_pWestFontLanguageLB,pFontList,GetWhich( SID_ATTR_CHAR_FONT ),GetWhich( SID_ATTR_CHAR_FONTHEIGHT )); - calcFontInfo(rCJKFont,this,m_pEastFontNameLB,m_pEastFontStyleLB,m_pEastFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_CJK_FONT ),GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT )); + calcFontInfo(rCJKFont,this,m_pEastFontNameLB,m_pEastFontStyleLB,m_pEastFontSizeLB,m_pEastFontLanguageLB,pFontList,GetWhich( SID_ATTR_CHAR_CJK_FONT ),GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT )); - calcFontInfo(rCTLFont,this,m_pCTLFontNameLB,m_pCTLFontStyleLB,m_pCTLFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_CTL_FONT ),GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT )); + calcFontInfo(rCTLFont,this,m_pCTLFontNameLB,m_pCTLFontStyleLB,m_pCTLFontSizeLB,m_pCTLFontLanguageLB,pFontList,GetWhich( SID_ATTR_CHAR_CTL_FONT ),GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT )); m_aPreviewWin.Invalidate(); m_aFontTypeFT.SetText( pFontList->GetFontMapText( aFontInfo ) ); |