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 /vcl | |
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 'vcl')
27 files changed, 132 insertions, 135 deletions
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index e30bfe4befdf..b566ea47bdcf 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -47,6 +47,7 @@ public: FontWidth GetWidthType() { if(meWidthType==WIDTH_DONTKNOW) AskConfig(); return meWidthType; } TextAlign GetAlignment() const { return meAlign; } rtl_TextEncoding GetCharSet() const { return meCharSet; } + const Size& GetFontSize() const { return maAverageFontSize; } bool IsSymbolFont() const { return mbSymbolFlag; } @@ -60,6 +61,7 @@ public: void SetWidthType( const FontWidth eWidthType ) { meWidthType = eWidthType; } void SetAlignment( const TextAlign eAlignment ) { meAlign = eAlignment; } void SetCharSet( const rtl_TextEncoding eCharSet ) { meCharSet = eCharSet; } + void SetFontSize( const Size& rSize ) { maAverageFontSize = rSize; } void SetSymbolFlag( const bool bSymbolFlag ) { mbSymbolFlag = bSymbolFlag; } @@ -91,11 +93,6 @@ public: void SetSubsettableFlag( bool bSubsettable ) { mbSubsettable = bSubsettable; } void SetOrientationFlag( bool bCanRotate ) { mbRotatable = bCanRotate; } - // Metric data - const Size& GetFontSize() const { return maSize; } - - void SetFontSize( const Size& rSize ) { maSize = rSize; } - bool operator==( const ImplFont& ) const; private: @@ -122,7 +119,7 @@ private: FontRelief meRelief; FontEmphasisMark meEmphasisMark; FontKerning meKerning; - Size maSize; + Size maAverageFontSize; rtl_TextEncoding meCharSet; LanguageTag maLanguageTag; diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 66e0def36506..d83a80cb7504 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1102,7 +1102,7 @@ static vcl::Font getFont( NSFont* pFont, long nDPIY, const vcl::Font& rDefault ) if( pFont ) { aResult.SetFamilyName( GetOUString( [pFont familyName] ) ); - aResult.SetHeight( static_cast<int>(([pFont pointSize] * 72.0 / (float)nDPIY)+0.5) ); + aResult.SetFontHeight( static_cast<int>(([pFont pointSize] * 72.0 / (float)nDPIY)+0.5) ); aResult.SetItalic( ([pFont italicAngle] != 0.0) ? ITALIC_NORMAL : ITALIC_NONE ); // FIMXE: bold ? } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index fd0beb44d6ae..dc835ed7f645 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1071,7 +1071,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLa // prepare single line hint (needed on mac to decide between normal push button and // rectangular bevel button look) - Size aFontSize(Application::GetSettings().GetStyleSettings().GetPushButtonFont().GetSize()); + Size aFontSize(Application::GetSettings().GetStyleSettings().GetPushButtonFont().GetFontSize()); aFontSize = rRenderContext.LogicToPixel(aFontSize, MapMode(MAP_POINT)); Size aInRectSize(rRenderContext.LogicToPixel(Size(aInRect.GetWidth(), aInRect.GetHeight()))); aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height()); diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 13e91579b93e..61d6d43c88bc 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1366,10 +1366,10 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& Size aSize = pDev->LogicToPixel( rSize ); vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetPointFont(*this); - Size aFontSize = aFont.GetSize(); + Size aFontSize = aFont.GetFontSize(); MapMode aPtMapMode(MAP_POINT); aFontSize = pDev->LogicToPixel(aFontSize, aPtMapMode); - aFont.SetSize(aFontSize); + aFont.SetFontSize(aFontSize); aFont.SetTransparent( true ); OutDevType eOutDevType = pDev->GetOutDevType(); diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 837e44482739..25e8decb6ea6 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -524,9 +524,9 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, bool Kapt, sal_u } Brei=Brei*sal_uLong(Atr.Breite)/100; Brei=Brei*sal_uLong(StdBrei)/100; - aFont.SetSize(Size(hPoint2Sgf(sal_uInt16(Brei)),hPoint2Sgf(sal_uInt16(Grad)))); + aFont.SetFontSize(Size(hPoint2Sgf(sal_uInt16(Brei)),hPoint2Sgf(sal_uInt16(Grad)))); } else { - aFont.SetSize(Size(0,hPoint2Sgf(sal_uInt16(Grad)))); + aFont.SetFontSize(Size(0,hPoint2Sgf(sal_uInt16(Grad)))); } aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor); diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index ab2d7a8a6c8b..b400a344b821 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -511,8 +511,8 @@ void EMFWriter::ImplCheckTextAttr() ImplBeginRecord( WIN_EMR_EXTCREATEFONTINDIRECTW ); m_rStm.WriteUInt32( mnTextHandle ); - ImplWriteExtent( -rFont.GetSize().Height() ); - ImplWriteExtent( rFont.GetSize().Width() ); + ImplWriteExtent( -rFont.GetFontSize().Height() ); + ImplWriteExtent( rFont.GetFontSize().Width() ); m_rStm.WriteInt32( rFont.GetOrientation() ).WriteInt32( rFont.GetOrientation() ); switch( rFont.GetWeight() ) diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 3ff2d3b5c2e4..55601721ca5a 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -238,7 +238,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont ) SolarMutexGuard aGuard; ScopedVclPtrInstance< VirtualDevice > pVDev; // converting the cell height into a font height - aFont.SetSize( aFontSize ); + aFont.SetFontSize( aFontSize ); pVDev->SetFont( aFont ); FontMetric aMetric( pVDev->GetFontMetric() ); long nHeight = aMetric.GetAscent() + aMetric.GetDescent(); @@ -252,7 +252,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont ) // Convert height to positive aFontSize.Height() = std::abs(aFontSize.Height()); - aFont.SetSize(aFontSize); + aFont.SetFontSize(aFontSize); }; WinMtf::WinMtf( WinMtfOutput* pWinMtfOutput, SvStream& rStreamWMF, FilterConfigItem* pConfigItem ) @@ -482,12 +482,12 @@ void WinMtfOutput::ImplMap( vcl::Font& rFont ) { // !!! HACK: we now always set the width to zero because the OS width is interpreted differently; // must later be made portable in SV (KA 1996-02-08) - Size aFontSize = ImplMap (rFont.GetSize(), false); + Size aFontSize = ImplMap (rFont.GetFontSize(), false); if( aFontSize.Height() < 0 ) aFontSize.Height() *= -1; - rFont.SetSize( aFontSize ); + rFont.SetFontSize( aFontSize ); if( ( mnWinExtX * mnWinExtY ) < 0 ) rFont.SetOrientation( 3600 - rFont.GetOrientation() ); @@ -687,8 +687,8 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle ) if ( eType == GDI_FONT ) { WinMtfFontStyle* pFontStyle = static_cast<WinMtfFontStyle*>(pStyle); - if (pFontStyle->aFont.GetHeight() == 0) - pFontStyle->aFont.SetHeight(423); + if (pFontStyle->aFont.GetFontHeight() == 0) + pFontStyle->aFont.SetFontHeight(423); ImplMap(pFontStyle->aFont); // defaulting to 12pt } else if ( eType == GDI_PEN ) @@ -721,8 +721,8 @@ void WinMtfOutput::CreateObject( sal_Int32 nIndex, GDIObjectType eType, void* pS if ( eType == GDI_FONT ) { WinMtfFontStyle* pFontStyle = static_cast<WinMtfFontStyle*>(pStyle); - if (pFontStyle->aFont.GetHeight() == 0) - pFontStyle->aFont.SetHeight(423); + if (pFontStyle->aFont.GetFontHeight() == 0) + pFontStyle->aFont.SetFontHeight(423); ImplMap(pFontStyle->aFont); } else if ( eType == GDI_PEN ) @@ -858,7 +858,7 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) : maFont.SetFamilyName( "Arial" ); // sj: #i57205#, we do have some scaling problems if using maFont.SetCharSet( RTL_TEXTENCODING_MS_1252 ); // the default font then most times a x11 font is used, we - maFont.SetHeight( 423 ); // will prevent this defining a font + maFont.SetFontHeight( 423 ); // will prevent this defining a font maLatestLineStyle.aLineColor = Color( 0x12, 0x34, 0x56 ); maLatestFillStyle.aFillColor = Color( 0x12, 0x34, 0x56 ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 72830fbbbeda..79f56f0fa09d 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -312,7 +312,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const vcl::Font & rFont) sal_uInt8 nPitchFamily; WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT); - WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height())); + WriteHeightWidth(Size(rFont.GetFontSize().Width(),-rFont.GetFontSize().Height())); pWMF->WriteInt16( rFont.GetOrientation() ).WriteInt16( rFont.GetOrientation() ); switch (rFont.GetWeight()) { diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 4cfd900f400d..2080ea1d52ab 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -148,7 +148,7 @@ void Font::SetStyleName( const OUString& rStyleName ) mpImplFont->maStyleName = rStyleName; } -void Font::SetSize( const Size& rSize ) +void Font::SetFontSize( const Size& rSize ) { if( mpImplFont->GetFontSize() != rSize ) { @@ -428,8 +428,8 @@ void Font::Merge( const vcl::Font& rFont ) if ( rFont.mpImplFont->GetWidthTypeNoAsk() != WIDTH_DONTKNOW ) SetWidthType( rFont.GetWidthType() ); - if ( rFont.GetSize().Height() ) - SetSize( rFont.GetSize() ); + if ( rFont.GetFontSize().Height() ) + SetFontSize( rFont.GetFontSize() ); if ( rFont.GetUnderline() != LINESTYLE_DONTKNOW ) { SetUnderline( rFont.GetUnderline() ); @@ -477,7 +477,7 @@ SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont ) rImplFont.SetFamilyName( rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet()) ); rImplFont.maStyleName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet()); - ReadPair( rIStm, rImplFont.maSize ); + ReadPair( rIStm, rImplFont.maAverageFontSize ); rIStm.ReadUInt16( nTmp16 ); rImplFont.SetCharSet( (rtl_TextEncoding) nTmp16 ); rIStm.ReadUInt16( nTmp16 ); rImplFont.SetFamilyType( (FontFamily) nTmp16 ); @@ -520,7 +520,7 @@ SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) VersionCompat aCompat( rOStm, StreamMode::WRITE, 3 ); rOStm.WriteUniOrByteString( rImplFont.GetFamilyName(), rOStm.GetStreamCharSet() ); rOStm.WriteUniOrByteString( rImplFont.GetStyleName(), rOStm.GetStreamCharSet() ); - WritePair( rOStm, rImplFont.maSize ); + WritePair( rOStm, rImplFont.maAverageFontSize ); rOStm.WriteUInt16( GetStoreCharSet( rImplFont.GetCharSet() ) ); rOStm.WriteUInt16( rImplFont.GetFamilyTypeNoAsk() ); @@ -605,23 +605,23 @@ namespace if( aInfo.width ) { if( aInfo.width == FWIDTH_ULTRA_CONDENSED ) - o_rResult.SetWidth( WIDTH_ULTRA_CONDENSED ); + o_rResult.SetAverageFontWidth( WIDTH_ULTRA_CONDENSED ); else if( aInfo.width == FWIDTH_EXTRA_CONDENSED ) - o_rResult.SetWidth( WIDTH_EXTRA_CONDENSED ); + o_rResult.SetAverageFontWidth( WIDTH_EXTRA_CONDENSED ); else if( aInfo.width == FWIDTH_CONDENSED ) - o_rResult.SetWidth( WIDTH_CONDENSED ); + o_rResult.SetAverageFontWidth( WIDTH_CONDENSED ); else if( aInfo.width == FWIDTH_SEMI_CONDENSED ) - o_rResult.SetWidth( WIDTH_SEMI_CONDENSED ); + o_rResult.SetAverageFontWidth( WIDTH_SEMI_CONDENSED ); else if( aInfo.width == FWIDTH_NORMAL ) - o_rResult.SetWidth( WIDTH_NORMAL ); + o_rResult.SetAverageFontWidth( WIDTH_NORMAL ); else if( aInfo.width == FWIDTH_SEMI_EXPANDED ) - o_rResult.SetWidth( WIDTH_SEMI_EXPANDED ); + o_rResult.SetAverageFontWidth( WIDTH_SEMI_EXPANDED ); else if( aInfo.width == FWIDTH_EXPANDED ) - o_rResult.SetWidth( WIDTH_EXPANDED ); + o_rResult.SetAverageFontWidth( WIDTH_EXPANDED ); else if( aInfo.width == FWIDTH_EXTRA_EXPANDED ) - o_rResult.SetWidth( WIDTH_EXTRA_EXPANDED ); + o_rResult.SetAverageFontWidth( WIDTH_EXTRA_EXPANDED ); else if( aInfo.width >= FWIDTH_ULTRA_EXPANDED ) - o_rResult.SetWidth( WIDTH_ULTRA_EXPANDED ); + o_rResult.SetAverageFontWidth( WIDTH_ULTRA_EXPANDED ); } // set italic o_rResult.SetItalic( (aInfo.italicAngle != 0) ? ITALIC_NORMAL : ITALIC_NONE ); @@ -780,11 +780,11 @@ FontAlign Font::GetAlignment() const { return mpImplFont->GetAlignment(); } const OUString& Font::GetFamilyName() const { return mpImplFont->GetFamilyName(); } const OUString& Font::GetStyleName() const { return mpImplFont->maStyleName; } -const Size& Font::GetSize() const { return mpImplFont->maSize; } -void Font::SetHeight( long nHeight ) { SetSize( Size( mpImplFont->GetFontSize().Width(), nHeight ) ); } -long Font::GetHeight() const { return mpImplFont->GetFontSize().Height(); } -void Font::SetWidth( long nWidth ) { SetSize( Size( nWidth, mpImplFont->GetFontSize().Height() ) ); } -long Font::GetWidth() const { return mpImplFont->GetFontSize().Width(); } +const Size& Font::GetFontSize() const { return mpImplFont->GetFontSize(); } +void Font::SetFontHeight( long nHeight ) { SetFontSize( Size( mpImplFont->GetFontSize().Width(), nHeight ) ); } +long Font::GetFontHeight() const { return mpImplFont->GetFontSize().Height(); } +void Font::SetAverageFontWidth( long nWidth ) { SetFontSize( Size( nWidth, mpImplFont->GetFontSize().Height() ) ); } +long Font::GetAverageFontWidth() const { return mpImplFont->GetFontSize().Width(); } rtl_TextEncoding Font::GetCharSet() const { return mpImplFont->GetCharSet(); } @@ -888,7 +888,7 @@ ImplFont::ImplFont( const ImplFont& rImplFont ) : meRelief( rImplFont.meRelief ), meEmphasisMark( rImplFont.meEmphasisMark ), meKerning( rImplFont.meKerning ), - maSize( rImplFont.maSize ), + maAverageFontSize( rImplFont.maAverageFontSize ), meCharSet( rImplFont.meCharSet ), maLanguageTag( rImplFont.maLanguageTag ), maCJKLanguageTag( rImplFont.maCJKLanguageTag ), @@ -925,7 +925,7 @@ bool ImplFont::operator==( const ImplFont& rOther ) const || (meAlign != rOther.meAlign) ) return false; - if( (maSize != rOther.maSize) + if( (maAverageFontSize != rOther.maAverageFontSize) || (mnOrientation != rOther.mnOrientation) || (mbVertical != rOther.mbVertical) ) return false; diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index 7a40ce51afe5..f214ddd64948 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -362,7 +362,7 @@ void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev ) const OUString sFullstop( sal_Unicode( 0x3001 ) ); // Fullwidth fullstop Rectangle aRect; pDev->GetTextBoundRect( aRect, sFullstop ); - const sal_uInt16 nH = rFont.GetSize().Height(); + const sal_uInt16 nH = rFont.GetFontSize().Height(); const sal_uInt16 nB = aRect.Left(); // Use 18.75% as a threshold to define a centered fullwidth fullstop. // In general, nB/nH < 5% for most Japanese fonts. diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 344c2e6835ea..6acf9b19abe3 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -102,7 +102,7 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, for(;; aSz.Height() -= nStep ) { - pFont->SetSize( aSz ); + pFont->SetFontSize( aSz ); pOutDev->SetFont( *pFont ); long nTextHeight = pOutDev->GetTextHeight(); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 4756804f96f6..e12d49ee38e3 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -2797,9 +2797,9 @@ MetaAction* MetaFontAction::Clone() void MetaFontAction::Scale( double fScaleX, double fScaleY ) { const Size aSize( - FRound(maFont.GetSize().Width() * fabs(fScaleX)), - FRound(maFont.GetSize().Height() * fabs(fScaleY))); - maFont.SetSize( aSize ); + FRound(maFont.GetFontSize().Width() * fabs(fScaleX)), + FRound(maFont.GetFontSize().Height() * fabs(fScaleY))); + maFont.SetFontSize( aSize ); } void MetaFontAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3c20b492aaf3..2e4966fc9c52 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1783,7 +1783,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal Font aFont; aFont.SetFamilyName( "Times" ); - aFont.SetSize( Size( 0, 12 ) ); + aFont.SetFontSize( Size( 0, 12 ) ); GraphicsState aState; aState.m_aMapMode = m_aMapMode; @@ -2316,7 +2316,7 @@ void PDFWriterImpl::endPage() // reset the default font Font aFont; aFont.SetFamilyName( "Times" ); - aFont.SetSize( Size( 0, 12 ) ); + aFont.SetFontSize( Size( 0, 12 ) ); m_aCurrentPDFState = m_aGraphicsStack.front(); m_aGraphicsStack.front().m_aFont = aFont; @@ -4694,8 +4694,8 @@ Font PDFWriterImpl::replaceFont( const vcl::Font& rControlFont, const vcl::Font& if( aFont.GetFamilyName().isEmpty() ) { aFont = rAppSetFont; - if( rControlFont.GetHeight() ) - aFont.SetSize( Size( 0, rControlFont.GetHeight() ) ); + if( rControlFont.GetFontHeight() ) + aFont.SetFontSize( Size( 0, rControlFont.GetFontHeight() ) ); else bAdjustSize = true; if( rControlFont.GetItalic() != ITALIC_DONTKNOW ) @@ -4703,17 +4703,17 @@ Font PDFWriterImpl::replaceFont( const vcl::Font& rControlFont, const vcl::Font& if( rControlFont.GetWeight() != WEIGHT_DONTKNOW ) aFont.SetWeight( rControlFont.GetWeight() ); } - else if( ! aFont.GetHeight() ) + else if( ! aFont.GetFontHeight() ) { - aFont.SetSize( rAppSetFont.GetSize() ); + aFont.SetFontSize( rAppSetFont.GetFontSize() ); bAdjustSize = true; } if( bAdjustSize ) { - Size aFontSize = aFont.GetSize(); + Size aFontSize = aFont.GetFontSize(); OutputDevice* pDefDev = Application::GetDefaultDevice(); aFontSize = OutputDevice::LogicToLogic( aFontSize, pDefDev->GetMapMode(), getMapMode() ); - aFont.SetSize( aFontSize ); + aFont.SetFontSize( aFontSize ); } return aFont; } @@ -4779,12 +4779,12 @@ void PDFWriterImpl::createDefaultPushButtonAppearance( PDFWidget& rButton, const // (that is before endRedirect()) OStringBuffer aDA( 256 ); appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetButtonTextColor() ), aDA ); - Font aDummyFont( OUString( "Helvetica" ), aFont.GetSize() ); + Font aDummyFont( OUString( "Helvetica" ), aFont.GetFontSize() ); sal_Int32 nDummyBuiltin = getBestBuiltinFont( aDummyFont ); aDA.append( ' ' ); aDA.append( m_aBuiltinFonts[nDummyBuiltin].getNameObject() ); aDA.append( ' ' ); - m_aPages[m_nCurrentPage].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA ); + m_aPages[m_nCurrentPage].appendMappedLength( sal_Int32( aFont.GetFontHeight() ), aDA ); aDA.append( " Tf" ); rButton.m_aDAString = aDA.makeStringAndClear(); @@ -4846,7 +4846,7 @@ Font PDFWriterImpl::drawFieldBorder( PDFWidget& rIntern, if( rWidget.Border ) { // adjust edit area accounting for border - sal_Int32 nDelta = aFont.GetHeight()/4; + sal_Int32 nDelta = aFont.GetFontHeight()/4; if( nDelta < 1 ) nDelta = 1; rIntern.m_aRect.Left() += nDelta; @@ -4887,7 +4887,7 @@ void PDFWriterImpl::createDefaultEditAppearance( PDFWidget& rEdit, const PDFWrit else aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( ' ' ); - m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA ); + m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetFontHeight() ), aDA ); aDA.append( " Tf" ); /* create an empty appearance stream, let the viewer create @@ -4956,7 +4956,7 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr else aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( ' ' ); - m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA ); + m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetFontHeight() ), aDA ); aDA.append( " Tf" ); rBox.m_aDAString = aDA.makeStringAndClear(); } @@ -4977,7 +4977,7 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW Font aFont = replaceFont( rWidget.TextFont, rSettings.GetRadioCheckFont() ); setFont( aFont ); - Size aFontSize = aFont.GetSize(); + Size aFontSize = aFont.GetFontSize(); if( aFontSize.Height() > rBox.m_aRect.GetHeight() ) aFontSize.Height() = rBox.m_aRect.GetHeight(); sal_Int32 nDelta = aFontSize.Height()/10; @@ -5041,7 +5041,7 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW OStringBuffer aDA( 256 ); appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA ); - sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetSize() ) ); + sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetFontSize() ) ); aDA.append( ' ' ); aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( " 0 Tf" ); @@ -5102,7 +5102,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P Font aFont = replaceFont( rWidget.TextFont, rSettings.GetRadioCheckFont() ); setFont( aFont ); - Size aFontSize = aFont.GetSize(); + Size aFontSize = aFont.GetFontSize(); if( aFontSize.Height() > rBox.m_aRect.GetHeight() ) aFontSize.Height() = rBox.m_aRect.GetHeight(); sal_Int32 nDelta = aFontSize.Height()/10; @@ -5166,7 +5166,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P OStringBuffer aDA( 256 ); appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA ); - sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetSize() ) ); + sal_Int32 nBest = getBestBuiltinFont( Font( OUString( "ZapfDingbats" ), aFont.GetFontSize() ) ); aDA.append( ' ' ); aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( " 0 Tf" ); @@ -8851,16 +8851,16 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool // transform font height back to current units // note: the layout calculates in outdevs device pixel !! sal_Int32 nFontHeight = m_pReferenceDevice->ImplDevicePixelToLogicHeight( nPixelFontHeight ); - if( m_aCurrentPDFState.m_aFont.GetWidth() ) + if( m_aCurrentPDFState.m_aFont.GetAverageFontWidth() ) { Font aFont( m_aCurrentPDFState.m_aFont ); - aFont.SetWidth( 0 ); + aFont.SetAverageFontWidth( 0 ); FontMetric aMetric = m_pReferenceDevice->GetFontMetric( aFont ); - if( aMetric.GetWidth() != m_aCurrentPDFState.m_aFont.GetWidth() ) + if( aMetric.GetAverageFontWidth() != m_aCurrentPDFState.m_aFont.GetAverageFontWidth() ) { fXScale = - (double)m_aCurrentPDFState.m_aFont.GetWidth() / - (double)aMetric.GetWidth(); + (double)m_aCurrentPDFState.m_aFont.GetAverageFontWidth() / + (double)aMetric.GetAverageFontWidth(); } // force state before GetFontMetric m_pReferenceDevice->ImplNewFont(); @@ -8952,7 +8952,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool } else { - double fW = (double)m_aCurrentPDFState.m_aFont.GetHeight() / 30.0; + double fW = (double)m_aCurrentPDFState.m_aFont.GetFontHeight() / 30.0; m_aPages.back().appendMappedLength( fW, aLine ); aLine.append ( " w\n" ); } diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 3ff05366678f..150590a5dcfe 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -243,7 +243,7 @@ void ImplWriteFont( SvStream& rOStm, const vcl::Font& rFont, ImplWriteColor( rOStm, rFont.GetColor() ); ImplWriteColor( rOStm, rFont.GetFillColor() ); rOStm.Write( aName, 32 ); - WritePair( rOStm, rFont.GetSize() ); + WritePair( rOStm, rFont.GetFontSize() ); rOStm.WriteInt16( 0 ); // no character orientation anymore rOStm.WriteInt16( rFont.GetOrientation() ); rOStm.WriteInt16( rActualCharSet ); @@ -824,7 +824,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rIStm.ReadInt16( nCharSet ).ReadInt16( nFamily ).ReadInt16( nPitch ).ReadInt16( nAlign ).ReadInt16( nWeight ).ReadInt16( nUnderline ).ReadInt16( nStrikeout ); rIStm.ReadCharAsBool( bItalic ).ReadCharAsBool( bOutline ).ReadCharAsBool( bShadow ).ReadCharAsBool( bTransparent ); - aFont.SetSize( Size( nWidth, nHeight ) ); + aFont.SetFontSize( Size( nWidth, nHeight ) ); aFont.SetCharSet( (rtl_TextEncoding) nCharSet ); aFont.SetFamily( (FontFamily) nFamily ); aFont.SetPitch( (FontPitch) nPitch ); diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index b10965eb29e6..79f983f79569 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -144,14 +144,14 @@ namespace vcl // now that the Zoom is part of the map mode, reset the target device's font to the "unzoomed" version Font aDrawFont( m_aUnzoomedPointFont ); - aDrawFont.SetSize( OutputDevice::LogicToLogic( aDrawFont.GetSize(), MAP_POINT, eTargetMapUnit ) ); + aDrawFont.SetFontSize( OutputDevice::LogicToLogic( aDrawFont.GetFontSize(), MAP_POINT, eTargetMapUnit ) ); _rTargetDevice.SetFont( aDrawFont ); // transfer font to the reference device m_rReferenceDevice.Push( PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); Font aRefFont( m_aUnzoomedPointFont ); - aRefFont.SetSize( OutputDevice::LogicToLogic( - aRefFont.GetSize(), MAP_POINT, m_rReferenceDevice.GetMapMode().GetMapUnit() ) ); + aRefFont.SetFontSize( OutputDevice::LogicToLogic( + aRefFont.GetFontSize(), MAP_POINT, m_rReferenceDevice.GetMapMode().GetMapUnit() ) ); m_rReferenceDevice.SetFont( aRefFont ); } diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 65bd0112ea33..9129ded50e9c 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -177,7 +177,7 @@ FontMetric OutputDevice::GetFontMetric() const // set aMetric with info from font aMetric.SetFamilyName( maFont.GetFamilyName() ); aMetric.SetStyleName( xFontMetric->GetStyleName() ); - aMetric.SetSize( PixelToLogic( Size( xFontMetric->GetWidth(), xFontMetric->GetAscent() + xFontMetric->GetDescent() - xFontMetric->GetInternalLeading() ) ) ); + aMetric.SetFontSize( PixelToLogic( Size( xFontMetric->GetWidth(), xFontMetric->GetAscent() + xFontMetric->GetDescent() - xFontMetric->GetInternalLeading() ) ) ); aMetric.SetCharSet( xFontMetric->IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); aMetric.SetFamily( xFontMetric->GetFamilyType() ); aMetric.SetPitch( xFontMetric->GetPitch() ); @@ -838,7 +838,7 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan if ( !aSearch.isEmpty() ) { - aFont.SetHeight( 12 ); // corresponds to nDefaultHeight + aFont.SetFontHeight( 12 ); // corresponds to nDefaultHeight aFont.SetWeight( WEIGHT_NORMAL ); aFont.SetLanguage( eLang ); @@ -885,18 +885,18 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan aFont.SetFamilyName( aSearch ); // convert to pixel height - Size aSize = pOutDev->ImplLogicToDevicePixel( aFont.GetSize() ); + Size aSize = pOutDev->ImplLogicToDevicePixel( aFont.GetFontSize() ); if ( !aSize.Height() ) { // use default pixel height only when logical height is zero - if ( aFont.GetHeight() ) + if ( aFont.GetFontHeight() ) aSize.Height() = 1; else aSize.Height() = (12*pOutDev->mnDPIY)/72; } // use default width only when logical width is zero - if( (0 == aSize.Width()) && (0 != aFont.GetSize().Width()) ) + if( (0 == aSize.Width()) && (0 != aFont.GetFontSize().Width()) ) aSize.Width() = 1; // get the name of the first available font @@ -1038,12 +1038,12 @@ bool OutputDevice::ImplNewFont() const // convert to pixel height // TODO: replace integer based aSize completely with subpixel accurate type - float fExactHeight = ImplFloatLogicHeightToDevicePixel( static_cast<float>(maFont.GetHeight()) ); - Size aSize = ImplLogicToDevicePixel( maFont.GetSize() ); + float fExactHeight = ImplFloatLogicHeightToDevicePixel( static_cast<float>(maFont.GetFontHeight()) ); + Size aSize = ImplLogicToDevicePixel( maFont.GetFontSize() ); if ( !aSize.Height() ) { // use default pixel height only when logical height is zero - if ( maFont.GetSize().Height() ) + if ( maFont.GetFontSize().Height() ) aSize.Height() = 1; else aSize.Height() = (12*mnDPIY)/72; @@ -1051,7 +1051,7 @@ bool OutputDevice::ImplNewFont() const } // select the default width only when logical width is zero - if( (0 == aSize.Width()) && (0 != maFont.GetSize().Width()) ) + if( (0 == aSize.Width()) && (0 != maFont.GetFontSize().Width()) ) aSize.Width() = 1; // get font entry @@ -1169,13 +1169,13 @@ bool OutputDevice::ImplNewFont() const int nNewWidth = (int)(nOrigWidth * fStretch + 0.5); if( (nNewWidth != nOrigWidth) && (nNewWidth != 0) ) { - Size aOrigSize = maFont.GetSize(); - const_cast<vcl::Font&>(maFont).SetSize( Size( nNewWidth, aSize.Height() ) ); + Size aOrigSize = maFont.GetFontSize(); + const_cast<vcl::Font&>(maFont).SetFontSize( Size( nNewWidth, aSize.Height() ) ); mbMap = false; mbNewFont = true; ImplNewFont(); // recurse once using stretched width mbMap = true; - const_cast<vcl::Font&>(maFont).SetSize( aOrigSize ); + const_cast<vcl::Font&>(maFont).SetFontSize( aOrigSize ); } } diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 4211bad7d28b..810d5b50413b 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -232,7 +232,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout ) vcl::Font aFont( GetFont() ); aFont.SetOrientation( 0 ); - aFont.SetSize( Size( mpFontInstance->maFontSelData.mnWidth, mpFontInstance->maFontSelData.mnHeight ) ); + aFont.SetFontSize( Size( mpFontInstance->maFontSelData.mnWidth, mpFontInstance->maFontSelData.mnHeight ) ); pVDev->SetFont( aFont ); pVDev->SetTextColor( Color( COL_BLACK ) ); pVDev->SetTextFillColor(); @@ -2508,7 +2508,7 @@ bool OutputDevice::GetTextBoundRect( Rectangle& rRect, aFont.SetOutline( false ); aFont.SetRelief( RELIEF_NONE ); aFont.SetOrientation( 0 ); - aFont.SetSize( Size( mpFontInstance->maFontSelData.mnWidth, mpFontInstance->maFontSelData.mnHeight ) ); + aFont.SetFontSize( Size( mpFontInstance->maFontSelData.mnWidth, mpFontInstance->maFontSelData.mnHeight ) ); aVDev->SetFont( aFont ); aVDev->SetTextAlign( ALIGN_TOP ); @@ -2735,7 +2735,7 @@ bool OutputDevice::GetTextOutlines( basegfx::B2DPolyPolygonVector& rVector, aFont.SetOrientation(0); if( bOptimize ) { - aFont.SetSize( Size( 0, GLYPH_FONT_HEIGHT ) ); + aFont.SetFontSize( Size( 0, GLYPH_FONT_HEIGHT ) ); aVDev->SetMapMode( MAP_PIXEL ); } aVDev->SetFont( aFont ); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 33183cf9a692..9b829d633a95 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2127,7 +2127,7 @@ void MessageDialog::SetMessagesWidths(vcl::Window *pParent, { assert(pPrimaryMessage); vcl::Font aFont = pParent->GetSettings().GetStyleSettings().GetLabelFont(); - aFont.SetSize(Size(0, aFont.GetSize().Height() * 1.2)); + aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * 1.2)); aFont.SetWeight(WEIGHT_BOLD); pPrimaryMessage->SetControlFont(aFont); pPrimaryMessage->SetMaxTextWidth(pPrimaryMessage->approximate_char_width() * 44); diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 1c6500d99529..1b4f76f10a91 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1366,8 +1366,8 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP vcl::Font aCopyFont = GetFont(); if( nOldDPIX != mnDPIX || nOldDPIY != mnDPIY ) { - aCopyFont.SetHeight( aCopyFont.GetHeight() * mnDPIY / nOldDPIY ); - aCopyFont.SetWidth( aCopyFont.GetWidth() * mnDPIX / nOldDPIX ); + aCopyFont.SetFontHeight( aCopyFont.GetFontHeight() * mnDPIY / nOldDPIY ); + aCopyFont.SetAverageFontWidth( aCopyFont.GetAverageFontWidth() * mnDPIX / nOldDPIX ); } SetFont( aCopyFont ); SetTextColor( GetTextColor() ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 71c175b52dfc..5f1970b86ab2 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -332,7 +332,7 @@ void PrintDialog::ShowNupOrderWindow::Paint(vcl::RenderContext& rRenderContext, int nPages = mnRows * mnColumns; Font aFont(rRenderContext.GetSettings().GetStyleSettings().GetFieldFont()); - aFont.SetSize(Size(0, 24)); + aFont.SetFontSize(Size(0, 24)); rRenderContext.SetFont(aFont); Size aSampleTextSize(rRenderContext.GetTextWidth(OUString::number(nPages + 1)), rRenderContext.GetTextHeight()); Size aOutSize(GetOutputSizePixel()); @@ -344,7 +344,7 @@ void PrintDialog::ShowNupOrderWindow::Paint(vcl::RenderContext& rRenderContext, long nFontHeight = long(24.0 * fScale) - 3; if (nFontHeight < 5) nFontHeight = 5; - aFont.SetSize(Size( 0, nFontHeight)); + aFont.SetFontSize(Size( 0, nFontHeight)); rRenderContext.SetFont(aFont); long nTextHeight = rRenderContext.GetTextHeight(); for (int i = 0; i < nPages; i++) diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx index e54a4382c747..c9a8fd1c7ba0 100644 --- a/vcl/source/window/settings.cxx +++ b/vcl/source/window/settings.cxx @@ -161,7 +161,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl ) maxFontheight = (int) ((( 8.0 * (double) GetDesktopRectPixel().getHeight()) / 600.0) + 1.5); vcl::Font aFont = aStyleSettings.GetMenuFont(); - int defFontheight = aFont.GetHeight(); + int defFontheight = aFont.GetFontHeight(); if( defFontheight > maxFontheight ) defFontheight = maxFontheight; @@ -178,59 +178,59 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl ) toolfontheight = (defFontheight+8) / 2; aFont = aStyleSettings.GetAppFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetAppFont( aFont ); aFont = aStyleSettings.GetTitleFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetTitleFont( aFont ); aFont = aStyleSettings.GetFloatTitleFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetFloatTitleFont( aFont ); // keep menu and help font size from system unless in broken locale size if( bBrokenLangFontHeight ) { aFont = aStyleSettings.GetMenuFont(); - if( aFont.GetHeight() < defFontheight ) + if( aFont.GetFontHeight() < defFontheight ) { - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetMenuFont( aFont ); } aFont = aStyleSettings.GetHelpFont(); - if( aFont.GetHeight() < defFontheight ) + if( aFont.GetFontHeight() < defFontheight ) { - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetHelpFont( aFont ); } } // use different height for toolfont aFont = aStyleSettings.GetToolFont(); - aFont.SetHeight( toolfontheight ); + aFont.SetFontHeight( toolfontheight ); aStyleSettings.SetToolFont( aFont ); aFont = aStyleSettings.GetLabelFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetLabelFont( aFont ); aFont = aStyleSettings.GetInfoFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetInfoFont( aFont ); aFont = aStyleSettings.GetRadioCheckFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetRadioCheckFont( aFont ); aFont = aStyleSettings.GetPushButtonFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetPushButtonFont( aFont ); aFont = aStyleSettings.GetFieldFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetFieldFont( aFont ); aFont = aStyleSettings.GetIconFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetIconFont( aFont ); aFont = aStyleSettings.GetTabFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetTabFont( aFont ); aFont = aStyleSettings.GetGroupFont(); - aFont.SetHeight( defFontheight ); + aFont.SetFontHeight( defFontheight ); aStyleSettings.SetGroupFont( aFont ); rSettings.SetStyleSettings( aStyleSettings ); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index a6c4fc8d4d30..fbe64960bb23 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1410,7 +1410,7 @@ void Window::ImplInitResolutionSettings() void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const { - Size aSize = rFont.GetSize(); + Size aSize = rFont.GetFontSize(); sal_uInt16 nScreenFontZoom; if (!utl::ConfigManager::IsAvoidConfig()) nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom(); @@ -1434,12 +1434,12 @@ void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFo if (rRenderContext.IsMapModeEnabled()) aSize = rRenderContext.PixelToLogic(aSize); - rFont.SetSize(aSize); + rFont.SetFontSize(aSize); } void Window::ImplLogicToPoint(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const { - Size aSize = rFont.GetSize(); + Size aSize = rFont.GetFontSize(); sal_uInt16 nScreenFontZoom; if (!utl::ConfigManager::IsAvoidConfig()) nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom(); @@ -1463,7 +1463,7 @@ void Window::ImplLogicToPoint(vcl::RenderContext& rRenderContext, vcl::Font& rFo aSize.Height() += mpWindowImpl->mpFrameData->mnDPIY / 2; aSize.Height() /= mpWindowImpl->mpFrameData->mnDPIY; - rFont.SetSize(aSize); + rFont.SetFontSize(aSize); } bool Window::ImplUpdatePos() @@ -1828,12 +1828,12 @@ void Window::ImplNewInputContext() if (!rFontName.isEmpty()) { OutputDevice *pFocusWinOutDev = pFocusWin->GetOutDev(); - Size aSize = pFocusWinOutDev->ImplLogicToDevicePixel( rFont.GetSize() ); + Size aSize = pFocusWinOutDev->ImplLogicToDevicePixel( rFont.GetFontSize() ); if ( !aSize.Height() ) { // only set default sizes if the font height in logical // coordinates equals 0 - if ( rFont.GetSize().Height() ) + if ( rFont.GetFontSize().Height() ) aSize.Height() = 1; else aSize.Height() = (12*pFocusWin->mnDPIY)/72; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 4624105aa68d..88344cf74e63 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -453,7 +453,7 @@ void Window::SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::F if (rZoom.GetNumerator() != rZoom.GetDenominator()) { vcl::Font aFont(rFont); - Size aSize = aFont.GetSize(); + Size aSize = aFont.GetFontSize(); double n = double(aSize.Width()); n *= double(rZoom.GetNumerator()); n /= double(rZoom.GetDenominator()); @@ -462,13 +462,13 @@ void Window::SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::F n *= double(rZoom.GetNumerator()); n /= double(rZoom.GetDenominator()); aSize.Height() = WinFloatRound(n); - aFont.SetSize(aSize); + aFont.SetFontSize(aSize); SetPointFont(rRenderContext, aFont); // Use another font if the representation is to be scaled, // and the actual font is not scalable FontMetric aMetric = rRenderContext.GetFontMetric(); - long nFontDiff = std::abs(rRenderContext.GetFont().GetSize().Height() - aMetric.GetSize().Height()); + long nFontDiff = std::abs(rRenderContext.GetFont().GetFontSize().Height() - aMetric.GetFontSize().Height()); if ((aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2)) { DefaultFontType nType; @@ -649,10 +649,10 @@ Size Window::CalcOutputSize( const Size& rWinSz ) const vcl::Font Window::GetDrawPixelFont(OutputDevice* pDev) const { vcl::Font aFont = GetPointFont(*pDev); - Size aFontSize = aFont.GetSize(); + Size aFontSize = aFont.GetFontSize(); MapMode aPtMapMode(MAP_POINT); aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode ); - aFont.SetSize( aFontSize ); + aFont.SetFontSize( aFontSize ); return aFont; } @@ -1493,7 +1493,7 @@ bool Window::set_font_attribute(const OString &rKey, const OString &rValue) { vcl::Font aFont(GetControlFont()); sal_Int32 nHeight = rValue.toInt32() / 1000; - aFont.SetHeight(nHeight); + aFont.SetFontHeight(nHeight); SetControlFont(aFont); } else diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index ef1c3f9c71ec..eda878510b6f 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -145,7 +145,7 @@ void XIMStatusWindow::layout() { m_aWindowSize.Width() = m_aStatusText->GetTextWidth( m_aStatusText->GetText() )+8; Font aFont( m_aStatusText->GetFont() ); - m_aWindowSize.Height() = aFont.GetHeight()+10; + m_aWindowSize.Height() = aFont.GetFontHeight()+10; m_aWindowSize = LogicToPixel( m_aWindowSize ); Size aControlSize( m_aWindowSize ); @@ -371,7 +371,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) : void IIIMPStatusWindow::layout() { Font aFont( m_aStatusBtn->GetFont() ); - Size aSize( 15*aFont.GetHeight(), aFont.GetHeight()+14 ); + Size aSize( 15*aFont.GetFontHeight(), aFont.GetFontHeight()+14 ); aSize = m_aStatusBtn->LogicToPixel( aSize ); m_aStatusBtn->SetPosSizePixel( Point( 0, 0 ), aSize ); diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 5ce0d947a3bf..ea352b0483e3 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -883,7 +883,7 @@ void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont ) nFontHeight *= 72; nFontHeight += nDPIY/2; nFontHeight /= nDPIY; - rFont.SetSize( Size( 0, nFontHeight ) ); + rFont.SetFontSize( Size( 0, nFontHeight ) ); rFont.SetOrientation( (short)rLogFont.lfEscapement ); if ( rLogFont.lfItalic ) rFont.SetItalic( ITALIC_NORMAL ); diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 8230ffb916e9..617cbe20df4b 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2580,12 +2580,12 @@ static void ImplSalUpdateStyleFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Fon // So if it is MS Sans Serif, a none scalable font we use // 8 Point as the minimum control height, in all other cases // 6 Point is the smallest one - if ( rFont.GetHeight() < 8 ) + if ( rFont.GetFontHeight() < 8 ) { if ( rtl_ustr_compareIgnoreAsciiCase( reinterpret_cast<const sal_Unicode*>(rLogFont.lfFaceName), reinterpret_cast<const sal_Unicode*>(L"MS Sans Serif") ) == 0 ) - rFont.SetHeight( 8 ); - else if ( rFont.GetHeight() < 6 ) - rFont.SetHeight( 6 ); + rFont.SetFontHeight( 8 ); + else if ( rFont.GetFontHeight() < 6 ) + rFont.SetFontHeight( 6 ); } } diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 2303f23c0d0b..2bb8f4318876 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -257,7 +257,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { FontMetric aFont = rRenderContext.GetDevFont((i * nFontCount) / nFontSamples); - aFont.SetHeight(400 + (i % 7) * 100); + aFont.SetFontHeight(400 + (i % 7) * 100); aFont.SetOrientation(i * (3600 / nFontSamples)); rRenderContext.SetFont(aFont); |