diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-03 10:13:00 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-04 03:17:26 +0000 |
commit | 697d445ed0c7b60e463243db89af32e2145b475b (patch) | |
tree | 5a74d57cdc97f82bc78a686dee345a229a082a72 /sd | |
parent | 91a7580e03d5b47c6e2513afce85ddee45e730b6 (diff) |
vcl: take into account the font width is the average font width
I'm changing the Font class function names:
- SetSize -> SetFontSize
- GetSize -> GetFontSize
- SetHeight -> SetFontHeight
- GetHeight -> GetFontHeight
- SetWidth -> SetAverageFontWidth
- GetWidth -> GetAverageFontWidth
That's because it really makes no sense to say that there is a
single constant font width because obviously proportional fonts
don't have one - the best we can do is an average font width,
which is what folks like Microsoft sort of do already. On a fixed
font, the average is still accurate, for obvious reasons :-)
I'm also not a fan of GetSize/SetSize as I find it a might too
generic.
Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70
Reviewed-on: https://gerrit.libreoffice.org/22069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 4 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 6 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-text.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationwindow.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/bulmaper.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/showwin.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsTheme.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/tools/PreviewRenderer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/grviewsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 4 |
11 files changed, 23 insertions, 23 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 153bf96642b1..47c16c165523 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -244,7 +244,7 @@ void SdDrawDocument::CreateLayoutTemplates() vcl::Font aBulletFont( SdStyleSheetPool::GetBulletFont() ); - aBulletFont.SetSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt + aBulletFont.SetFontSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt aBulletItem.SetFont(aBulletFont); aBulletItem.SetSymbol( 0x25CF ); // In points @@ -1198,7 +1198,7 @@ void SdDrawDocument::SetTextDefaults() const // BulletItem and BulletFont for Titel and Outline SvxBulletItem aBulletItem(EE_PARA_BULLET); vcl::Font aBulletFont( SdStyleSheetPool::GetBulletFont() ); - aBulletFont.SetSize(Size(0,846)); // 24 pt + aBulletFont.SetFontSize(Size(0,846)); // 24 pt aBulletItem.SetFont(aBulletFont); aBulletItem.SetStyle(SvxBulletStyle::BULLET); aBulletItem.SetStart(1); diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 359d99ccc976..148cd729ac8d 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -371,7 +371,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool // #i16874# enable kerning by default but only for new documents rTitleSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) ); - aBulletFont.SetSize(Size(0,1552)); // 44 pt + aBulletFont.SetFontSize(Size(0,1552)); // 44 pt PutNumBulletItem( pSheet, aBulletFont ); } @@ -420,7 +420,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool rSubtitleSet.Put(aSvxLRSpaceItem); vcl::Font aTmpFont( GetBulletFont() ); - aTmpFont.SetSize(Size(0, 1129)); // 32 pt + aTmpFont.SetFontSize(Size(0, 1129)); // 32 pt PutNumBulletItem( pSheet, aTmpFont ); } @@ -1199,7 +1199,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, } nFontSize = (sal_uInt16)((nFontSize * 2540L) / 72); // Pt --> 1/100 mm - rBulletFont.SetSize(Size(0,846)); // 24 pt + rBulletFont.SetFontSize(Size(0,846)); // 24 pt aNumberFormat.SetBulletFont(&rBulletFont); aNumRule.SetLevel( i, aNumberFormat ); } diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 63982286c944..b1ad83c474a6 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1411,7 +1411,7 @@ sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry ) vcl::Font aFont; aFont.SetCharSet( rEntry.CharSet ); aFont.SetFamilyName( rEntry.Original ); - aFont.SetHeight( 100 ); + aFont.SetFontHeight( 100 ); if ( !pVDev ) pVDev = VclPtr<VirtualDevice>::Create(); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index e0c42c49225a..7ecf96fc617a 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -321,7 +321,7 @@ void AnnotationWindow::InitControls() AllSettings aSettings = mpMeta->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); vcl::Font aFont = aStyleSettings.GetFieldFont(); - aFont.SetHeight(8); + aFont.SetFontHeight(8); aStyleSettings.SetFieldFont(aFont); aSettings.SetStyleSettings(aStyleSettings); mpMeta->SetSettings(aSettings); @@ -386,9 +386,9 @@ void AnnotationWindow::Rescale() if ( mpMeta ) { vcl::Font aFont( mpMeta->GetSettings().GetStyleSettings().GetFieldFont() ); - sal_Int32 nHeight = aFont.GetHeight(); + sal_Int32 nHeight = aFont.GetFontHeight(); nHeight = nHeight * aMode.GetScaleY().GetNumerator() / aMode.GetScaleY().GetDenominator(); - aFont.SetHeight( nHeight ); + aFont.SetFontHeight( nHeight ); mpMeta->SetControlFont( aFont ); } } diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx index 96316eb88945..3f9615a22bae 100644 --- a/sd/source/ui/func/bulmaper.cxx +++ b/sd/source/ui/func/bulmaper.cxx @@ -72,7 +72,7 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet& const SvxFontHeightItem& rFHItem = static_cast<const SvxFontHeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontHeightID ))); - aMyFont.SetSize(Size(0, rFHItem.GetHeight())); + aMyFont.SetFontSize(Size(0, rFHItem.GetHeight())); const SvxWeightItem& rWItem = static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nWeightID ))); diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index ecbebd0bb363..85be7aaca1d2 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -476,7 +476,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) vcl::Font aFont( GetSettings().GetStyleSettings().GetMenuFont() ); const vcl::Font aOldFont( GetFont() ); - aFont.SetSize( aTextSize ); + aFont.SetFontSize( aTextSize ); aFont.SetColor( COL_WHITE ); aFont.SetCharSet( aOldFont.GetCharSet() ); aFont.SetLanguage( aOldFont.GetLanguage() ); @@ -545,7 +545,7 @@ void ShowWindow::DrawEndScene() const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, GetMapMode() ) ); const OUString aText( SdResId( STR_PRES_SOFTEND ) ); - aFont.SetSize( aTextSize ); + aFont.SetFontSize( aTextSize ); aFont.SetColor( COL_WHITE ); aFont.SetCharSet( aOldFont.GetCharSet() ); aFont.SetLanguage( aOldFont.GetLanguage() ); diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx index f669b6ad4639..1ae6f92b48c8 100644 --- a/sd/source/ui/slidesorter/view/SlsTheme.cxx +++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx @@ -147,8 +147,8 @@ std::shared_ptr<vcl::Font> Theme::GetFont ( pFont->SetTransparent(true); pFont->SetWeight(WEIGHT_NORMAL); { - const Size aSize (pFont->GetSize()); - pFont->SetSize(Size(aSize.Width()*5/3, aSize.Height()*5/3)); + const Size aSize (pFont->GetFontSize()); + pFont->SetFontSize(Size(aSize.Width()*5/3, aSize.Height()*5/3)); } break; } @@ -157,10 +157,10 @@ std::shared_ptr<vcl::Font> Theme::GetFont ( { // Transform the point size to pixel size. const MapMode aFontMapMode (MAP_POINT); - const Size aFontSize (rDevice.LogicToPixel(pFont->GetSize(), aFontMapMode)); + const Size aFontSize (rDevice.LogicToPixel(pFont->GetFontSize(), aFontMapMode)); // Transform the font size to the logical coordinates of the device. - pFont->SetSize(rDevice.PixelToLogic(aFontSize)); + pFont->SetFontSize(rDevice.PixelToLogic(aFontSize)); } return pFont; diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index fa63de954286..5c6af241911f 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -334,7 +334,7 @@ void PreviewRenderer::PaintSubstitutionText (const OUString& rSubstitutionText) const vcl::Font& rOriginalFont (mpPreviewDevice->GetFont()); vcl::Font aFont (mpPreviewDevice->GetSettings().GetStyleSettings().GetAppFont()); sal_Int32 nHeight (mpPreviewDevice->PixelToLogic(Size(0,snSubstitutionTextSize)).Height()); - aFont.SetHeight(nHeight); + aFont.SetFontHeight(nHeight); mpPreviewDevice->SetFont (aFont); // Paint the substitution text. diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx index 7e635aef641b..361a538d66a2 100644 --- a/sd/source/ui/view/grviewsh.cxx +++ b/sd/source/ui/view/grviewsh.cxx @@ -76,7 +76,7 @@ void GraphicViewShell::ArrangeGUIElements() Size aSize = mpLayerTabBar->GetSizePixel(); const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel()); - aSize.Height() = GetParentWindow()->GetFont().GetHeight() + 4; + aSize.Height() = GetParentWindow()->GetFont().GetFontHeight() + 4; aSize.Width() = aFrameSize.Width(); Point aPos (0, maViewSize.Height() - aSize.Height()); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index d3c04c2a77de..7834bf19d8ba 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -129,10 +129,10 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie LanguageType eLang = mrOutliner.GetDefaultLanguage(); maPageNumberFont = OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ); - maPageNumberFont.SetHeight( 500 ); + maPageNumberFont.SetFontHeight( 500 ); maBulletFont.SetColor( COL_AUTO ); - maBulletFont.SetHeight( 1000 ); + maBulletFont.SetFontHeight( 1000 ); maBulletFont.SetCharSet(RTL_TEXTENCODING_MS_1252); // and replacing other values by standard maBulletFont.SetFamilyName( "StarSymbol" ); maBulletFont.SetWeight(WEIGHT_NORMAL); @@ -1686,7 +1686,7 @@ IMPL_LINK_TYPED(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, v Point aTextPos( aImagePos.X() - aOffset.Width(), pInfo->mrStartPos.Y() ); vcl::Font aNewFont( OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ) ); - aNewFont.SetSize( aFontSz ); + aNewFont.SetFontSize( aFontSz ); aNewFont.SetVertical( bVertical ); aNewFont.SetOrientation( bVertical ? 2700 : 0 ); aNewFont.SetColor( COL_AUTO ); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 98c6615c4077..482ad6135812 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -379,7 +379,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected static sal_uInt32 nTextSizeFactor(100); // use a factor to get more linear text size calculations - aScaledVclFont.SetHeight( 500 * nTextSizeFactor ); + aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor ); // get basic geometry and get text size drawinglayer::primitive2d::TextLayouterDevice aTextLayouter; @@ -404,7 +404,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected vcl::Font aVclFont; basegfx::B2DVector aTextSizeAttribute; - aVclFont.SetHeight( 500 ); + aVclFont.SetFontHeight( 500 ); const drawinglayer::attribute::FontAttribute aFontAttribute( drawinglayer::primitive2d::getFontAttributeFromVclFont( |