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>
This commit is contained in:
Chris Sherlock
2016-02-04 03:17:26 +00:00
parent 91a7580e03
commit 697d445ed0
172 changed files with 541 additions and 545 deletions
@@ -1022,7 +1022,7 @@ Document::retrieveCharacterAttributes(
//character height
aAttribs[i].Name = "CharHeight";
aAttribs[i].Handle = -1;
aAttribs[i].Value = css::uno::makeAny( (sal_Int16)aFont.GetHeight() );
aAttribs[i].Value = css::uno::makeAny( (sal_Int16)aFont.GetFontHeight() );
aAttribs[i].State = css::beans::PropertyState_DIRECT_VALUE;
i++;
@@ -34,8 +34,8 @@ CharacterAttributesHelper::CharacterAttributesHelper( const vcl::Font& rFont, sa
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontName" ), makeAny( rFont.GetFamilyName() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontPitch" ), makeAny( (sal_Int16) rFont.GetPitch() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontStyleName" ), makeAny( rFont.GetStyleName() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharHeight" ), makeAny( (sal_Int16) rFont.GetSize().Height() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharScaleWidth" ), makeAny( (sal_Int16) rFont.GetSize().Width() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharHeight" ), makeAny( (sal_Int16) rFont.GetFontSize().Height() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharScaleWidth" ), makeAny( (sal_Int16) rFont.GetFontSize().Width() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharStrikeout" ), makeAny( (sal_Int16) rFont.GetStrikeout() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharUnderline" ), makeAny( (sal_Int16) rFont.GetUnderline() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharWeight" ), makeAny( (float) rFont.GetWeight() ) ) );
+1 -1
View File
@@ -804,7 +804,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
vcl::Font aFont( GetEditEngine()->GetFont() );
aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetTransparent( true );
aFont.SetSize( Size( 0, 360 ) );
aFont.SetFontSize( Size( 0, 360 ) );
pPrinter->SetFont( aFont );
pPrinter->SetMapMode( MAP_100TH_MM );
+2 -2
View File
@@ -2870,12 +2870,12 @@ void CodeCompleteWindow::ResizeAndPositionListBox()
pListBox->SetSizePixel( aSize );
//calculate position
const Rectangle aVisArea( pParent->GetEditView()->GetStartDocPos(), pParent->GetOutputSizePixel() );//the visible area
const Rectangle aVisArea( pParent->GetEditView()->GetStartDocPos(), pParent->GetOutputSizePixel() ); //the visible area
const Point& aBottomPoint = aVisArea.BottomRight();
if( aVisArea.TopRight().getY() + aPos.getY() + aSize.getHeight() > aBottomPoint.getY() )
{//clipped at the bottom: move it up
const long& nParentFontHeight = pParent->GetEditEngine()->GetFont().GetHeight();//parent's font (in the IDE): needed for height
const long& nParentFontHeight = pParent->GetEditEngine()->GetFont().GetFontHeight(); //parent's font (in the IDE): needed for height
aPos.Y() -= aSize.getHeight() + nParentFontHeight + nCursorPad;
}
+1 -1
View File
@@ -1187,7 +1187,7 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
return;
Size aTabBarSize;
aTabBarSize.Height() = GetViewFrame()->GetWindow().GetFont().GetHeight() + 4;
aTabBarSize.Height() = GetViewFrame()->GetWindow().GetFont().GetFontHeight() + 4;
aTabBarSize.Width() = rSize.Width();
Size aSz( rSize );
+2 -2
View File
@@ -43,9 +43,9 @@ Layout::Layout (vcl::Window* pParent) :
SetBackground(GetSettings().GetStyleSettings().GetWindowColor());
vcl::Font aFont = GetFont();
Size aSz = aFont.GetSize();
Size aSz = aFont.GetFontSize();
aSz.Height() *= 1.5;
aFont.SetSize(aSz);
aFont.SetFontSize(aSz);
aFont.SetWeight(WEIGHT_BOLD);
aFont.SetColor(GetSettings().GetStyleSettings().GetWindowTextColor());
SetFont(aFont);
+1 -1
View File
@@ -1161,7 +1161,7 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
pPrinter->SetMapMode( aMap );
vcl::Font aFont;
aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetSize( Size( 0, 360 ));
aFont.SetFontSize( Size( 0, 360 ));
pPrinter->SetFont( aFont );
Size aPaperSz = pPrinter->GetOutputSize();
+2 -2
View File
@@ -68,7 +68,7 @@ namespace cairocanvas
const bool bOldMapState( pOutDev->IsMapModeEnabled() );
pOutDev->EnableMapMode(false);
const Size aSize = pOutDev->GetFontMetric( *maFont ).GetSize();
const Size aSize = pOutDev->GetFontMetric( *maFont ).GetFontSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -78,7 +78,7 @@ namespace cairocanvas
const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
maFont->SetWidth( nNewWidth );
maFont->SetAverageFontWidth( nNewWidth );
pOutDev->EnableMapMode(bOldMapState);
}
@@ -81,7 +81,7 @@ namespace cairocanvas
if( !::rtl::math::approxEqual(aScale.getX(), aScale.getY()) )
{
// retrieve true font width
const sal_Int32 nFontWidth( rOutDev.GetFontMetric( io_rVCLFont ).GetWidth() );
const sal_Int32 nFontWidth( rOutDev.GetFontMetric( io_rVCLFont ).GetAverageFontWidth() );
const sal_Int32 nScaledFontWidth( ::basegfx::fround(nFontWidth * aScale.getX()) );
@@ -92,13 +92,13 @@ namespace cairocanvas
return false;
}
io_rVCLFont.SetWidth( nScaledFontWidth );
io_rVCLFont.SetAverageFontWidth( nScaledFontWidth );
}
if( !::rtl::math::approxEqual(aScale.getY(), 1.0) )
{
const sal_Int32 nFontHeight( io_rVCLFont.GetHeight() );
io_rVCLFont.SetHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
const sal_Int32 nFontHeight( io_rVCLFont.GetFontHeight() );
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
}
io_rVCLFont.SetOrientation( static_cast< short >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) );
+4 -4
View File
@@ -430,8 +430,8 @@ namespace cairocanvas
continue;
vcl::Font aFont = rOutDev.GetFont();
long nWidth = aFont.GetWidth();
long nHeight = aFont.GetHeight();
long nWidth = aFont.GetAverageFontWidth();
long nHeight = aFont.GetFontHeight();
if (nWidth == 0)
nWidth = nHeight;
if (nWidth == 0 || nHeight == 0)
@@ -487,7 +487,7 @@ namespace cairocanvas
SAL_INFO(
"canvas.cairo",
"Size:(" << aFont.GetWidth() << "," << aFont.GetHeight()
"Size:(" << aFont.GetAverageFontWidth() << "," << aFont.GetFontHeight()
<< "), Pos (" << rOutpos.X() << "," << rOutpos.Y()
<< "), G("
<< (cairo_glyphs.size() > 0 ? cairo_glyphs[0].index : -1)
@@ -507,7 +507,7 @@ namespace cairocanvas
//faux bold
if (rSysFontData.bFakeBold)
{
double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetFontHeight() );
int total_steps = 1 * ((int) (bold_dx + 0.5));
// loop to draw the text for every half pixel of displacement
@@ -130,7 +130,7 @@ namespace dxcanvas
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
{
const Size aSize = xVirtualDevice->GetFontMetric( aFont ).GetSize();
const Size aSize = xVirtualDevice->GetFontMetric( aFont ).GetFontSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -139,7 +139,7 @@ namespace dxcanvas
const sal_Int32 nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
aFont.SetWidth( nNewWidth );
aFont.SetAverageFontWidth( nNewWidth );
}
// set font
@@ -259,7 +259,7 @@ namespace dxcanvas
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
{
const Size aSize = xVirtualDevice->GetFontMetric( aFont ).GetSize();
const Size aSize = xVirtualDevice->GetFontMetric( aFont ).GetFontSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -268,7 +268,7 @@ namespace dxcanvas
const sal_Int32 nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
aFont.SetWidth( nNewWidth );
aFont.SetAverageFontWidth( nNewWidth );
}
// set font
+2 -2
View File
@@ -738,7 +738,7 @@ namespace oglcanvas
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
{
const Size aSize = pVDev->GetFontMetric( aFont ).GetSize();
const Size aSize = pVDev->GetFontMetric( aFont ).GetFontSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -747,7 +747,7 @@ namespace oglcanvas
const sal_Int32 nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
aFont.SetWidth( nNewWidth );
aFont.SetAverageFontWidth( nNewWidth );
}
// set font
+2 -2
View File
@@ -68,7 +68,7 @@ namespace vclcanvas
const bool bOldMapState( rOutDev.IsMapModeEnabled() );
rOutDev.EnableMapMode(false);
const Size aSize = rOutDev.GetFontMetric( *maFont ).GetSize();
const Size aSize = rOutDev.GetFontMetric( *maFont ).GetFontSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -78,7 +78,7 @@ namespace vclcanvas
const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
maFont->SetWidth( nNewWidth );
maFont->SetAverageFontWidth( nNewWidth );
rOutDev.EnableMapMode(bOldMapState);
}
+4 -4
View File
@@ -117,7 +117,7 @@ namespace vclcanvas
if( !::rtl::math::approxEqual(aScale.getX(), aScale.getY()) )
{
// retrieve true font width
const sal_Int32 nFontWidth( rOutDev.GetFontMetric( io_rVCLFont ).GetWidth() );
const sal_Int32 nFontWidth( rOutDev.GetFontMetric( io_rVCLFont ).GetAverageFontWidth() );
const sal_Int32 nScaledFontWidth( ::basegfx::fround(nFontWidth * aScale.getX()) );
@@ -128,13 +128,13 @@ namespace vclcanvas
return false;
}
io_rVCLFont.SetWidth( nScaledFontWidth );
io_rVCLFont.SetAverageFontWidth( nScaledFontWidth );
}
if( !::rtl::math::approxEqual(aScale.getY(), 1.0) )
{
const sal_Int32 nFontHeight( io_rVCLFont.GetHeight() );
io_rVCLFont.SetHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
const sal_Int32 nFontHeight( io_rVCLFont.GetFontHeight() );
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
}
io_rVCLFont.SetOrientation( static_cast< short >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) );
+1 -1
View File
@@ -103,7 +103,7 @@ namespace vclcanvas
const Point& rPos )
{
vcl::Font aVCLFont;
aVCLFont.SetHeight( 20 );
aVCLFont.SetFontHeight( 20 );
aVCLFont.SetColor( Color( INFO_COLOR ) );
rOutDev.SetTextAlign(ALIGN_TOP);
+1 -1
View File
@@ -315,7 +315,7 @@ namespace vclcanvas
// paint sprite prio
vcl::Font aVCLFont;
aVCLFont.SetHeight( std::min(long(20),aOutputSize.Height()) );
aVCLFont.SetFontHeight( std::min(long(20),aOutputSize.Height()) );
aVCLFont.SetColor( COL_RED );
rTargetSurface.SetTextAlign(ALIGN_TOP);
+1 -1
View File
@@ -83,7 +83,7 @@ const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
aFont = vcl::Font("Brillante St",Size(0,0));
else
aFont = pDevice->GetFont();
aFont.SetSize(Size(0, 96));
aFont.SetFontSize(Size(0, 96));
aFont.SetColor(COL_GREEN); // RGB_COLORDATA(0xf0, 0xf0, 0xf0));
pDevice->SetFont(aFont);
pDevice->Erase();
+2 -2
View File
@@ -767,7 +767,7 @@ struct FontAttribSetter
else if(rPropName == "CharHeight")
{
float fHeight = rProp.second.get<float>();
mrFont.SetSize(Size(0,(fHeight*127+36)/72)); //taken from the MCW implementation
mrFont.SetFontSize(Size(0,(fHeight*127+36)/72)); //taken from the MCW implementation
}
else if(rPropName == "CharUnderline")
{
@@ -784,7 +784,7 @@ struct FontAttribSetter
{
float fWidth = rProp.second.get<float>();
FontWidth eFontWidth = VCLUnoHelper::ConvertFontWidth(fWidth);
mrFont.SetWidth(eFontWidth);
mrFont.SetAverageFontWidth(eFontWidth);
}
}
private:
@@ -808,7 +808,7 @@ namespace cppcanvas
// TODO(Q3): This code smells of programming by
// coincidence (the next two if statements)
::Size rFontSizeLog( rFont.GetSize() );
::Size rFontSizeLog( rFont.GetFontSize() );
if (rFontSizeLog.Height() == 0)
{
@@ -823,8 +823,8 @@ namespace cppcanvas
if( nFontWidthLog != 0 )
{
vcl::Font aTestFont = rFont;
aTestFont.SetWidth( 0 );
sal_Int32 nNormalWidth = rParms.mrVDev.GetFontMetric( aTestFont ).GetWidth();
aTestFont.SetAverageFontWidth( 0 );
sal_Int32 nNormalWidth = rParms.mrVDev.GetFontMetric( aTestFont ).GetAverageFontWidth();
if( nNormalWidth != nFontWidthLog )
if( nNormalWidth )
aFontMatrix.m00 = (double)nFontWidthLog / nNormalWidth;
@@ -888,7 +888,7 @@ namespace cppcanvas
{
// calculate shadow offset (similar to outdev3.cxx)
// TODO(F3): better match with outdev3.cxx
sal_Int32 nShadowOffset = static_cast<sal_Int32>(1.5 + ((rParms.mrVDev.GetFont().GetHeight()-24.0)/24.0));
sal_Int32 nShadowOffset = static_cast<sal_Int32>(1.5 + ((rParms.mrVDev.GetFont().GetFontHeight()-24.0)/24.0));
if( nShadowOffset < 1 )
nShadowOffset = 1;
+1 -1
View File
@@ -1590,7 +1590,7 @@ namespace cppcanvas
VirtualDevice& rVDev )
{
const ::basegfx::B2DSize aFontSize( 0,
rVDev.GetFont().GetHeight() / 64.0 );
rVDev.GetFont().GetFontHeight() / 64.0 );
const double nOutlineWidth(
(rState.mapModeTransform * aFontSize).getY() );
+3 -3
View File
@@ -162,17 +162,17 @@ void AboutDialog::StyleControls()
vcl::Font aLabelFont = rStyleSettings.GetLabelFont();
vcl::Font aLargeFont = aLabelFont;
aLargeFont.SetSize(Size( 0, aLabelFont.GetSize().Height() * 3));
aLargeFont.SetFontSize(Size( 0, aLabelFont.GetFontSize().Height() * 3));
// Logo Replacement Text
m_pLogoReplacement->SetControlFont(aLargeFont);
// Description Text
aLargeFont.SetSize(Size(0, aLabelFont.GetSize().Height() * 1.3));
aLargeFont.SetFontSize(Size(0, aLabelFont.GetFontSize().Height() * 1.3));
m_pDescriptionText->SetControlFont(aLargeFont);
// Version Text
aLargeFont.SetSize(Size(0, aLabelFont.GetSize().Height() * 1.2));
aLargeFont.SetFontSize(Size(0, aLabelFont.GetFontSize().Height() * 1.2));
m_pVersion->SetControlFont(aLargeFont);
// If not in high-contrast mode, hard-code colors
+5 -5
View File
@@ -88,7 +88,7 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, bool bOne_, const SfxIte
const SfxStringItem* pFontNameItem = SfxItemSet::GetItem<SfxStringItem>(pSet, SID_FONT_NAME, false);
if ( pFontItem )
{
vcl::Font aTmpFont( pFontItem->GetFamilyName(), pFontItem->GetStyleName(), GetCharFont().GetSize() );
vcl::Font aTmpFont( pFontItem->GetFamilyName(), pFontItem->GetStyleName(), GetCharFont().GetFontSize() );
aTmpFont.SetCharSet( pFontItem->GetCharSet() );
aTmpFont.SetPitch( pFontItem->GetPitch() );
SetCharFont( aTmpFont );
@@ -204,7 +204,7 @@ void SvxShowText::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
bool bGotBoundary = true;
bool bShrankFont = false;
vcl::Font aOrigFont(rRenderContext.GetFont());
Size aFontSize(aOrigFont.GetSize());
Size aFontSize(aOrigFont.GetFontSize());
Rectangle aBoundRect;
for (long nFontHeight = aFontSize.Height(); nFontHeight > 0; nFontHeight -= 5)
@@ -222,7 +222,7 @@ void SvxShowText::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
break;
vcl::Font aFont(aOrigFont);
aFontSize.Height() = nFontHeight;
aFont.SetSize(aFontSize);
aFont.SetFontSize(aFontSize);
rRenderContext.SetFont(aFont);
mnY = (nWinHeight - GetTextHeight()) / 2;
bShrankFont = true;
@@ -276,7 +276,7 @@ void SvxShowText::SetFont( const vcl::Font& rFont )
maFont = vcl::Font(rFont);
maFont.SetWeight(WEIGHT_NORMAL);
maFont.SetAlignment(ALIGN_TOP);
maFont.SetSize(PixelToLogic(Size(0, nWinHeight / 2)));
maFont.SetFontSize(PixelToLogic(Size(0, nWinHeight / 2)));
maFont.SetTransparent(true);
Control::SetFont(maFont);
@@ -288,7 +288,7 @@ void SvxShowText::SetFont( const vcl::Font& rFont )
Size SvxShowText::GetOptimalSize() const
{
const vcl::Font &rFont = GetFont();
const Size rFontSize = rFont.GetSize();
const Size rFontSize = rFont.GetFontSize();
long nWinHeight = LogicToPixel(rFontSize).Height() * 2;
return Size( GetTextWidth( GetText() ) + 2 * 12, nWinHeight );
}
+2 -2
View File
@@ -130,7 +130,7 @@ namespace svx
// the font for the secondary text:
vcl::Font aSmallerFont(rRenderContext.GetFont());
// heuristic: 80% of the original size
aSmallerFont.SetHeight( (long)( 0.8 * aSmallerFont.GetHeight() ) );
aSmallerFont.SetFontHeight( (long)( 0.8 * aSmallerFont.GetFontHeight() ) );
// let's calculate the size of our two texts
Rectangle aPrimaryRect = rRenderContext.GetTextRect( _rRect, m_sPrimaryText, _nTextStyle );
@@ -309,7 +309,7 @@ namespace svx
Size RubyRadioButton::GetOptimalSize() const
{
vcl::Font aSmallerFont( GetFont() );
aSmallerFont.SetHeight( static_cast<long>( 0.8 * aSmallerFont.GetHeight() ) );
aSmallerFont.SetFontHeight( static_cast<long>( 0.8 * aSmallerFont.GetFontHeight() ) );
Rectangle rect( Point(), Size( SAL_MAX_INT32, SAL_MAX_INT32 ) );
Size aPrimarySize = GetTextRect( rect, m_aRubyText.getPrimaryText() ).GetSize();
+1 -1
View File
@@ -351,7 +351,7 @@ void OfaImpBrwString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Ren
{
aFont = *pUserData->pFont;
aFont.SetColor(aOldFont.GetColor());
aFont.SetSize(aOldFont.GetSize());
aFont.SetFontSize(aOldFont.GetFontSize());
}
aFont.SetWeight(WEIGHT_BOLD);
+14 -14
View File
@@ -484,7 +484,7 @@ namespace
sal_uInt16 _nFontWhich,
sal_uInt16 _nFontHeightWhich)
{
Size aSize = _rFont.GetSize();
Size aSize = _rFont.GetFontSize();
aSize.Width() = 0;
FontMetric aFontMetrics;
OUString sFontName(_pFontNameLB->GetText());
@@ -525,7 +525,7 @@ namespace
aSize.Height() = PointToTwips( static_cast<long>(_pFontSizeLB->GetValue() / 10) );
else
aSize.Height() = 200; // default 10pt
aFontMetrics.SetSize( aSize );
aFontMetrics.SetFontSize( aSize );
_rFont.SetLanguage(_pLanguageLB->GetSelectLanguage());
@@ -536,7 +536,7 @@ namespace
_rFont.SetCharSet( aFontMetrics.GetCharSet() );
_rFont.SetWeight( aFontMetrics.GetWeight() );
_rFont.SetItalic( aFontMetrics.GetItalic() );
_rFont.SetSize( aFontMetrics.GetSize() );
_rFont.SetFontSize( aFontMetrics.GetFontSize() );
return aFontMetrics;
}
@@ -550,11 +550,11 @@ void SvxCharNamePage::UpdatePreview_Impl()
SvxFont& rCJKFont = GetPreviewCJKFont();
SvxFont& rCTLFont = GetPreviewCTLFont();
// Size
Size aSize = rFont.GetSize();
Size aSize = rFont.GetFontSize();
aSize.Width() = 0;
Size aCJKSize = rCJKFont.GetSize();
Size aCJKSize = rCJKFont.GetFontSize();
aCJKSize.Width() = 0;
Size aCTLSize = rCTLFont.GetSize();
Size aCTLSize = rCTLFont.GetFontSize();
aCTLSize.Width() = 0;
// Font
const FontList* pFontList = GetFontList();
@@ -2710,9 +2710,9 @@ void SvxCharPositionPage::Initialize()
// to handle the changes of the other pages
SetExchangeSupport();
GetPreviewFont().SetSize( Size( 0, 240 ) );
GetPreviewCJKFont().SetSize( Size( 0, 240 ) );
GetPreviewCTLFont().SetSize( Size( 0, 240 ) );
GetPreviewFont().SetFontSize( Size( 0, 240 ) );
GetPreviewCJKFont().SetFontSize( Size( 0, 240 ) );
GetPreviewCTLFont().SetFontSize( Size( 0, 240 ) );
m_pNormalPosBtn->Check();
PositionHdl_Impl( m_pNormalPosBtn );
@@ -2876,7 +2876,7 @@ IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, KerningSelectHdl_Impl, ListBox&, void
{
// Condensed -> max value == 1/6 of the current font height
SvxFont& rFont = GetPreviewFont();
long nMax = rFont.GetSize().Height() / 6;
long nMax = rFont.GetFontSize().Height() / 6;
m_pKerningMF->SetMax( m_pKerningMF->Normalize( nMax ), FUNIT_TWIP );
m_pKerningMF->SetLast( m_pKerningMF->GetMax( m_pKerningMF->GetUnit() ) );
}
@@ -2961,7 +2961,7 @@ void SvxCharPositionPage::ActivatePage( const SfxItemSet& rSet )
{
// Condensed -> max value == 1/6 of the current font height
SvxFont& rFont = GetPreviewFont();
long nMax = rFont.GetSize().Height() / 6;
long nMax = rFont.GetFontSize().Height() / 6;
long nKern = (short)m_pKerningMF->Denormalize( LogicToLogic( static_cast<long>(m_pKerningMF->GetValue()), MAP_POINT, MAP_TWIP ) );
m_pKerningMF->SetMax( m_pKerningMF->Normalize( nKern > nMax ? nKern : nMax ), FUNIT_TWIP );
m_pKerningMF->SetLast( m_pKerningMF->GetMax( m_pKerningMF->GetUnit() ) );
@@ -3445,9 +3445,9 @@ void SvxCharTwoLinesPage::Initialize()
SvxFont& rFont = GetPreviewFont();
SvxFont& rCJKFont = GetPreviewCJKFont();
SvxFont& rCTLFont = GetPreviewCTLFont();
rFont.SetSize( Size( 0, 220 ) );
rCJKFont.SetSize( Size( 0, 220 ) );
rCTLFont.SetSize( Size( 0, 220 ) );
rFont.SetFontSize( Size( 0, 220 ) );
rCJKFont.SetFontSize( Size( 0, 220 ) );
rCTLFont.SetFontSize( Size( 0, 220 ) );
}
+4 -4
View File
@@ -2413,7 +2413,7 @@ static sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev,
// in case of a height of zero it is drawed in original height
if(!aTmpSize.Height())
aTmpSize.Height() = 1;
aFont.SetSize(aTmpSize);
aFont.SetFontSize(aTmpSize);
aFont.SetTransparent(true);
Color aBulletColor = rFmt.GetBulletColor();
if(aBulletColor.GetColor() == COL_AUTO)
@@ -2494,7 +2494,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectan
sal_uInt16 nFontHeight = nYStep * 6 / 10;
if (bPosition)
nFontHeight = nYStep * 15 / 10;
aStdFont.SetSize(Size( 0, nFontHeight ));
aStdFont.SetFontSize(Size( 0, nFontHeight ));
SvxNodeNum aNum(sal_uInt8(0));
sal_uInt16 nPreNum = pActNum->GetLevel(0).GetStart();
@@ -2553,7 +2553,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectan
}
else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType())
{
nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawBullet(pVDev.get(), rFmt, nNumberXPos, nYStart, aStdFont.GetSize()) : 0;
nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawBullet(pVDev.get(), rFmt, nNumberXPos, nYStart, aStdFont.GetFontSize()) : 0;
}
else
{
@@ -2676,7 +2676,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectan
{
if (rFmt.IsShowSymbol())
{
nTextOffset = lcl_DrawBullet(pVDev.get(), rFmt, nXStart, nYStart, aStdFont.GetSize());
nTextOffset = lcl_DrawBullet(pVDev.get(), rFmt, nXStart, nYStart, aStdFont.GetFontSize());
nTextOffset = nTextOffset + nXStep;
}
}
@@ -133,7 +133,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent )
m_pVisibleCell->GetBox().EnableTriState( false );
vcl::Font aTitleFont = OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE,Window::GetSettings().GetLanguageTag().getLanguageType(),GetDefaultFontFlags::OnlyOne);
aTitleFont.SetSize(Size(0, 6));
aTitleFont.SetFontSize(Size(0, 6));
SetTitleFont(aTitleFont);
OUString aTxt(ModuleRes(STR_QUERY_SORTTEXT));
+1 -1
View File
@@ -1585,7 +1585,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
nullptr, Size(1, 1), DeviceFormat::DEFAULT));
::Rectangle aRect;
vcl::Font aFont(rFontMetric);
aFont.SetSize(Size(0, 25));
aFont.SetFontSize(Size(0, 25));
aDevice->SetFont(aFont);
aDevice->GetTextBoundRect(aRect, aFontName);
int nFontWidth = aRect.BottomRight().X() + 1;
+1 -1
View File
@@ -662,7 +662,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
_vdev->SetLineColor();
_vdev->DrawRect(Rectangle(pSpl->_tlx+pSpl->_barspace, pSpl->_tly+pSpl->_barspace, pSpl->_tlx+pSpl->_barspace+length, pSpl->_tly+pSpl->_barheight-pSpl->_barspace));
vcl::Font aFont;
aFont.SetSize(Size(0, 12));
aFont.SetFontSize(Size(0, 12));
aFont.SetAlignment(ALIGN_BASELINE);
_vdev->SetFont(aFont);
_vdev->SetTextColor(pSpl->_cProgressTextColor);
@@ -2730,7 +2730,7 @@ namespace
/** SIMPLE, DONE */
const MetaFontAction* pA = static_cast<const MetaFontAction*>(pAction);
rPropertyHolders.Current().setFont(pA->GetFont());
Size aFontSize(pA->GetFont().GetSize());
Size aFontSize(pA->GetFont().GetFontSize());
if(0 == aFontSize.Height())
{
@@ -2745,7 +2745,7 @@ namespace
aFontSize = OutputDevice::LogicToLogic(
aFontSize, MAP_PIXEL, rPropertyHolders.Current().getMapUnit());
aCorrectedFont.SetSize(aFontSize);
aCorrectedFont.SetFontSize(aFontSize);
rPropertyHolders.Current().setFont(aCorrectedFont);
}
@@ -415,11 +415,11 @@ namespace drawinglayer
{
const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aRetval));
if(aUnscaledFontMetric.GetWidth() > 0)
if(aUnscaledFontMetric.GetAverageFontWidth() > 0)
{
const double fScaleFactor((double)nWidth / (double)nHeight);
const sal_uInt32 nScaledWidth(basegfx::fround((double)aUnscaledFontMetric.GetWidth() * fScaleFactor));
aRetval.SetWidth(nScaledWidth);
const sal_uInt32 nScaledWidth(basegfx::fround((double)aUnscaledFontMetric.GetAverageFontWidth() * fScaleFactor));
aRetval.SetAverageFontWidth(nScaledWidth);
}
}
#endif
@@ -453,7 +453,7 @@ namespace drawinglayer
// TODO: eKerning
// set FontHeight and init to no FontScaling
o_rSize.setY(rFont.GetSize().getHeight() > 0 ? rFont.GetSize().getHeight() : 0);
o_rSize.setY(rFont.GetFontSize().getHeight() > 0 ? rFont.GetFontSize().getHeight() : 0);
o_rSize.setX(o_rSize.getY());
#ifdef WIN32
@@ -462,15 +462,15 @@ namespace drawinglayer
// needs to do extra stuff to detect the correct width (since it's
// zero and not equal the font height) and its relationship to
// the height
if(rFont.GetSize().getWidth() > 0)
if(rFont.GetFontSize().getWidth() > 0)
{
vcl::Font aUnscaledFont(rFont);
aUnscaledFont.SetWidth(0);
aUnscaledFont.SetAverageFontWidth(0);
const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aUnscaledFont));
if(aUnscaledFontMetric.GetWidth() > 0)
if(aUnscaledFontMetric.GetAverageFontWidth() > 0)
{
const double fScaleFactor((double)rFont.GetSize().getWidth() / (double)aUnscaledFontMetric.GetWidth());
const double fScaleFactor((double)rFont.GetFontSize().getWidth() / (double)aUnscaledFontMetric.GetAverageFontWidth());
o_rSize.setX(fScaleFactor * o_rSize.getY());
}
}
@@ -479,9 +479,9 @@ namespace drawinglayer
// is easier achieved since width == height is interpreted as no
// scaling. Ergo, Width == 0 means width == height, and width != 0
// means the scaling is in the direct relation of width to height
if(rFont.GetSize().getWidth() > 0)
if(rFont.GetFontSize().getWidth() > 0)
{
o_rSize.setX((double)rFont.GetSize().getWidth());
o_rSize.setX((double)rFont.GetFontSize().getWidth());
}
#endif
return aRetval;
@@ -911,9 +911,9 @@ namespace drawinglayer
(sal_Int32)ceil(aRangeLogic.getMaxX()), (sal_Int32)ceil(aRangeLogic.getMaxY()));
pPDFControl->Location = aRectLogic;
Size aFontSize(pPDFControl->TextFont.GetSize());
Size aFontSize(pPDFControl->TextFont.GetFontSize());
aFontSize = OutputDevice::LogicToLogic(aFontSize, MapMode(MAP_POINT), mpOutputDevice->GetMapMode());
pPDFControl->TextFont.SetSize(aFontSize);
pPDFControl->TextFont.SetFontSize(aFontSize);
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::Form);
mpPDFExtOutDevData->CreateControl(*pPDFControl.get());
@@ -137,7 +137,7 @@ namespace drawinglayer
}
// Don't draw fonts without height
if( aFont.GetHeight() <= 0 )
if( aFont.GetFontHeight() <= 0 )
return;
// handle additional font attributes
+1 -1
View File
@@ -163,7 +163,7 @@ EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAt
void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* )
{
// Property is ignored
rFont.SetSize( Size( rFont.GetSize().Width(), static_cast<const SvxFontHeightItem*>(GetItem())->GetHeight() ) );
rFont.SetFontSize( Size( rFont.GetFontSize().Width(), static_cast<const SvxFontHeightItem*>(GetItem())->GetHeight() ) );
}
+1 -1
View File
@@ -2047,7 +2047,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_BKGCOLOR ) == SfxItemState::SET ) )
rFont.SetFillColor( static_cast<const SvxBackgroundColorItem&>(rSet.Get( EE_CHAR_BKGCOLOR )).GetValue() );
if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontHeight ) == SfxItemState::SET ) )
rFont.SetSize( Size( rFont.GetSize().Width(), static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich_FontHeight ) ).GetHeight() ) );
rFont.SetFontSize( Size( rFont.GetFontSize().Width(), static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich_FontHeight ) ).GetHeight() ) );
if ( bSearchInParent || ( rSet.GetItemState( nWhich_Weight ) == SfxItemState::SET ) )
rFont.SetWeight( static_cast<const SvxWeightItem&>(rSet.Get( nWhich_Weight )).GetWeight() );
if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_UNDERLINE ) == SfxItemState::SET ) )
+1 -1
View File
@@ -2566,7 +2566,7 @@ void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const SvxFont& rFont )
{
rSet.Put( SvxLanguageItem( rFont.GetLanguage(), EE_CHAR_LANGUAGE ) );
rSet.Put( SvxFontItem( rFont.GetFamilyType(), rFont.GetFamilyName(), OUString(), rFont.GetPitch(), rFont.GetCharSet(), EE_CHAR_FONTINFO ) );
rSet.Put( SvxFontHeightItem( rFont.GetSize().Height(), 100, EE_CHAR_FONTHEIGHT ) );
rSet.Put( SvxFontHeightItem( rFont.GetFontSize().Height(), 100, EE_CHAR_FONTHEIGHT ) );
rSet.Put( SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH ) );
rSet.Put( SvxShadowedItem( rFont.IsShadow(), EE_CHAR_SHADOW ) );
rSet.Put( SvxEscapementItem( rFont.GetEscapement(), rFont.GetPropr(), EE_CHAR_ESCAPEMENT ) );
+1 -1
View File
@@ -341,7 +341,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
nEsc *= 10; //HalPoints => Twips was embezzled in RTFITEM.CXX!
SvxFont aFont;
mpEditEngine->SeekCursor(aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont);
nEsc = nEsc * 100 / aFont.GetSize().Height();
nEsc = nEsc * 100 / aFont.GetFontSize().Height();
SvxEscapementItem aEscItem( (short) nEsc, static_cast<const SvxEscapementItem*>(pItem)->GetProportionalHeight(), EE_CHAR_ESCAPEMENT );
rSet.GetAttrSet().Put( aEscItem );
+14 -14
View File
@@ -836,7 +836,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
ImplInitDigitMode(GetRefDevice(), aTmpFont.GetLanguage());
if ( IsFixedCellHeight() )
nTextLineHeight = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetHeight() );
nTextLineHeight = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetFontHeight() );
else
nTextLineHeight = aTmpFont.GetPhysTxtSize( GetRefDevice(), OUString() ).Height();
// Metrics can be greater
@@ -1090,7 +1090,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
if ( ( aTmpFont.GetFixKerning() > 0 ) && ( ( nTmpPos + pPortion->GetLen() ) < pNode->Len() ) )
pPortion->GetSize().Width() += aTmpFont.GetFixKerning();
if ( IsFixedCellHeight() )
pPortion->GetSize().Height() = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetHeight() );
pPortion->GetSize().Height() = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetFontHeight() );
}
if ( bCalcCharPositions )
{
@@ -1304,7 +1304,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
ImplInitDigitMode(pRefDev, aTmpFont.GetLanguage());
if ( IsFixedCellHeight() )
aTextSize.Height() = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetHeight() );
aTextSize.Height() = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetFontHeight() );
else
aTextSize.Height() = aTmpFont.GetPhysTxtSize( pRefDev, OUString() ).Height();
pLine->SetHeight( (sal_uInt16)aTextSize.Height() );
@@ -1638,7 +1638,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn
TextPortion* pDummyPortion = new TextPortion( 0 );
pDummyPortion->GetSize() = aTmpFont.GetPhysTxtSize( pRefDev, OUString() );
if ( IsFixedCellHeight() )
pDummyPortion->GetSize().Height() = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetHeight() );
pDummyPortion->GetSize().Height() = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetFontHeight() );
pParaPortion->GetTextPortions().Append(pDummyPortion);
FormatterFontMetric aFormatterMetrics;
RecalcFormatterFontMetrics( aFormatterMetrics, aTmpFont );
@@ -2599,9 +2599,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
rFont.SetFamily( rFontItem.GetFamily() );
rFont.SetPitch( rFontItem.GetPitch() );
rFont.SetCharSet( rFontItem.GetCharSet() );
Size aSz( rFont.GetSize() );
Size aSz( rFont.GetFontSize() );
aSz.Height() = static_cast<const SvxFontHeightItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ) ) ).GetHeight();
rFont.SetSize( aSz );
rFont.SetFontSize( aSz );
rFont.SetWeight( static_cast<const SvxWeightItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ))).GetWeight() );
rFont.SetItalic( static_cast<const SvxPostureItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_ITALIC, nScriptType ))).GetPosture() );
rFont.SetLanguage( static_cast<const SvxLanguageItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ))).GetLanguage() );
@@ -2694,7 +2694,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
// Set the font as we want it to look like & reset the Propr attribute
// so that it is not counted twice.
Size aRealSz( aMetric.GetSize() );
Size aRealSz( aMetric.GetFontSize() );
rFont.SetPropr( 100 );
if ( aStatus.DoStretch() )
@@ -2750,7 +2750,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
aRealSz.Width() *= nRelWidth;
aRealSz.Width() /= 100;
}
rFont.SetSize( aRealSz );
rFont.SetFontSize( aRealSz );
// Font is not restored ...
}
@@ -2827,8 +2827,8 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics
if ( IsFixedCellHeight() )
{
nAscent = sal::static_int_cast< sal_uInt16 >( rFont.GetHeight() );
nDescent= sal::static_int_cast< sal_uInt16 >( ImplCalculateFontIndependentLineSpacing( rFont.GetHeight() ) - nAscent );
nAscent = sal::static_int_cast< sal_uInt16 >( rFont.GetFontHeight() );
nDescent= sal::static_int_cast< sal_uInt16 >( ImplCalculateFontIndependentLineSpacing( rFont.GetFontHeight() ) - nAscent );
}
else
{
@@ -2856,7 +2856,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics
{
// Now in consideration of Escape/Propr
// possibly enlarge Ascent or Descent
short nDiff = (short)(rFont.GetSize().Height()*rFont.GetEscapement()/100L);
short nDiff = (short)(rFont.GetFontSize().Height()*rFont.GetEscapement()/100L);
if ( rFont.GetEscapement() > 0 )
{
nAscent = (sal_uInt16) (((long)nAscent)*nPropr/100 + nDiff);
@@ -3368,7 +3368,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
// In case of high/low do it yourself:
if ( aTmpFont.GetEscapement() )
{
long nDiff = aTmpFont.GetSize().Height() * aTmpFont.GetEscapement() / 100L;
long nDiff = aTmpFont.GetFontSize().Height() * aTmpFont.GetEscapement() / 100L;
if ( !IsVertical() )
aOutPos.Y() -= nDiff;
else
@@ -3498,7 +3498,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
short _nEsc = aTmpFont.GetEscapement();
if( _nEsc )
{
long nShift = ((_nEsc*long(aTmpFont.GetSize().Height()))/ 100L);
long nShift = ((_nEsc*long(aTmpFont.GetFontSize().Height()))/ 100L);
if( !IsVertical() )
aRedLineTmpPos.Y() -= nShift;
else
@@ -3507,7 +3507,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
}
Color aOldColor( pOutDev->GetLineColor() );
pOutDev->SetLineColor( Color( GetColorConfig().GetColorValue( svtools::SPELL ).nColor ) );
lcl_DrawRedLines( pOutDev, aTmpFont.GetSize().Height(), aRedLineTmpPos, (size_t)nIndex, (size_t)nIndex + rTextPortion.GetLen(), pDXArray, pPortion->GetNode()->GetWrongList(), nOrientation, aOrigin, IsVertical(), rTextPortion.IsRightToLeft() );
lcl_DrawRedLines( pOutDev, aTmpFont.GetFontSize().Height(), aRedLineTmpPos, (size_t)nIndex, (size_t)nIndex + rTextPortion.GetLen(), pDXArray, pPortion->GetNode()->GetWrongList(), nOrientation, aOrigin, IsVertical(), rTextPortion.IsRightToLeft() );
pOutDev->SetLineColor( aOldColor );
}
}
+1 -1
View File
@@ -967,7 +967,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
SeekCursor( pNode, nPos, aFont );
MapMode aPntMode( MAP_POINT );
long nFontHeight = GetRefDevice()->LogicToLogic(
aFont.GetSize(), &GetRefMapMode(), &aPntMode ).Height();
aFont.GetFontSize(), &GetRefMapMode(), &aPntMode ).Height();
nFontHeight *=2; // Half Points
sal_uInt16 const nProp = static_cast<const SvxEscapementItem&>(rItem).GetProportionalHeight();
sal_uInt16 nProp100 = nProp*100; // For SWG-Token Prop in 100th percent.
+1 -1
View File
@@ -87,7 +87,7 @@ vcl::Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer )
{
sal_Int32 nHeight(0), nWidth(0);
rStream.ReadInt32( nHeight ); rStream.ReadInt32( nWidth ); Size aSize( nWidth, nHeight );
aFont.SetSize( aSize );
aFont.SetFontSize( aSize );
}
bool bTemp;
+4 -4
View File
@@ -321,8 +321,8 @@ void SvxFont::SetPhysFont( OutputDevice *pOut ) const
else
{
Font aNewFont( *this );
Size aSize( aNewFont.GetSize() );
aNewFont.SetSize( Size( aSize.Width() * nPropr / 100L,
Size aSize( aNewFont.GetFontSize() );
aNewFont.SetFontSize( Size( aSize.Width() * nPropr / 100L,
aSize.Height() * nPropr / 100L ) );
if ( !rCurrentFont.IsSameInstance( aNewFont ) )
pOut->SetFont( aNewFont );
@@ -460,7 +460,7 @@ void SvxFont::QuickDrawText( OutputDevice *pOut,
if ( nEsc )
{
long nDiff = GetSize().Height();
long nDiff = GetFontSize().Height();
nDiff *= nEsc;
nDiff /= 100;
@@ -518,7 +518,7 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter,
nTmpEsc = -20;
else
nTmpEsc = nEsc;
Size aSize = ( this->GetSize() );
Size aSize = ( this->GetFontSize() );
aPos.Y() -= ( ( nTmpEsc * long( aSize.Height() ) ) / 100L );
}
Font aOldFont( ChgPhysFont( pOut ) );
+2 -2
View File
@@ -889,12 +889,12 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
GetGlobalCharStretching(nStretchX, nStretchY);
sal_uInt16 nScale = pFmt->GetBulletRelSize() * nStretchY / 100;
sal_uLong nScaledLineHeight = aStdFont.GetSize().Height();
sal_uLong nScaledLineHeight = aStdFont.GetFontSize().Height();
nScaledLineHeight *= nScale*10;
nScaledLineHeight /= 1000;
aBulletFont.SetAlignment( ALIGN_BOTTOM );
aBulletFont.SetSize( Size( 0, nScaledLineHeight ) );
aBulletFont.SetFontSize( Size( 0, nScaledLineHeight ) );
bool bVertical = IsVertical();
aBulletFont.SetVertical( bVertical );
aBulletFont.SetOrientation( bVertical ? 2700 : 0 );
+3 -3
View File
@@ -42,7 +42,7 @@ void SvxUnoFontDescriptor::ConvertToFont( const awt::FontDescriptor& rDesc, vcl:
{
rFont.SetFamilyName( rDesc.Name );
rFont.SetStyleName( rDesc.StyleName );
rFont.SetSize( Size( rDesc.Width, rDesc.Height ) );
rFont.SetFontSize( Size( rDesc.Width, rDesc.Height ) );
rFont.SetFamily( (FontFamily)rDesc.Family );
rFont.SetCharSet( (rtl_TextEncoding)rDesc.CharSet );
rFont.SetPitch( (FontPitch)rDesc.Pitch );
@@ -59,8 +59,8 @@ void SvxUnoFontDescriptor::ConvertFromFont( const vcl::Font& rFont, awt::FontDes
{
rDesc.Name = rFont.GetFamilyName();
rDesc.StyleName = rFont.GetStyleName();
rDesc.Width = sal::static_int_cast< sal_Int16 >(rFont.GetSize().Width());
rDesc.Height = sal::static_int_cast< sal_Int16 >(rFont.GetSize().Height());
rDesc.Width = sal::static_int_cast< sal_Int16 >(rFont.GetFontSize().Width());
rDesc.Height = sal::static_int_cast< sal_Int16 >(rFont.GetFontSize().Height());
rDesc.Family = sal::static_int_cast< sal_Int16 >(rFont.GetFamilyType());
rDesc.CharSet = rFont.GetCharSet();
rDesc.Pitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitch());
+2 -2
View File
@@ -494,7 +494,7 @@ namespace pcr
SfxPoolItem** pCounter = _rppDefaults; // want to modify this without affecting the out param _rppDefaults
*pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamilyType(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_FONT);
*pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetHeight(), 100, CFID_HEIGHT);
*pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetFontHeight(), 100, CFID_HEIGHT);
*pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_WEIGHT);
*pCounter++ = new SvxPostureItem(aDefaultVCLFont.GetItalic(), CFID_POSTURE);
*pCounter++ = new SvxLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_LANGUAGE);
@@ -506,7 +506,7 @@ namespace pcr
*pCounter++ = new SvxEmphasisMarkItem(aDefaultVCLFont.GetEmphasisMark(), CFID_EMPHASIS);
*pCounter++ = new SvxFontItem(aDefaultVCLFont.GetFamilyType(), aDefaultVCLFont.GetFamilyName(), aDefaultVCLFont.GetStyleName(), aDefaultVCLFont.GetPitch(), aDefaultVCLFont.GetCharSet(), CFID_CJK_FONT);
*pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetHeight(), 100, CFID_CJK_HEIGHT);
*pCounter++ = new SvxFontHeightItem(aDefaultVCLFont.GetFontHeight(), 100, CFID_CJK_HEIGHT);
*pCounter++ = new SvxWeightItem(aDefaultVCLFont.GetWeight(), CFID_CJK_WEIGHT);
*pCounter++ = new SvxPostureItem(aDefaultVCLFont.GetItalic(), CFID_CJK_POSTURE);
*pCounter++ = new SvxLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_CJK_LANGUAGE);
@@ -931,7 +931,7 @@ void BubbleWindow::RecalcTextRects()
maTextRect.setHeight( 10 );
aTotalSize.setHeight( maTitleRect.GetHeight() +
aBoldFont.GetHeight() * 3 / 4 +
aBoldFont.GetFontHeight() * 3 / 4 +
maTextRect.GetHeight() +
3 * BUBBLE_BORDER + TIP_HEIGHT );
if ( aTotalSize.Height() > maMaxTextSize.Height() )
@@ -943,7 +943,7 @@ void BubbleWindow::RecalcTextRects()
bFinished = true;
}
maTitleRect.Move( 2*BUBBLE_BORDER, BUBBLE_BORDER + TIP_HEIGHT );
maTextRect.Move( 2*BUBBLE_BORDER, BUBBLE_BORDER + TIP_HEIGHT + maTitleRect.GetHeight() + aBoldFont.GetHeight() * 3 / 4 );
maTextRect.Move( 2*BUBBLE_BORDER, BUBBLE_BORDER + TIP_HEIGHT + maTitleRect.GetHeight() + aBoldFont.GetFontHeight() * 3 / 4 );
}
+5 -5
View File
@@ -600,17 +600,17 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon
double scale = 1.0;
// scale width if we have a stretched text
if( 0 != aFont.GetSize().Width() )
if( 0 != aFont.GetFontSize().Width() )
{
vcl::Font aTmpFont( aFont );
aTmpFont.SetWidth(0);
aTmpFont.SetAverageFontWidth(0);
mpVDev->SetFont( aTmpFont );
const FontMetric aMetric2( mpVDev->GetFontMetric() );
mpVDev->SetFont( aFont );
const long n1 = aFont.GetSize().Width();
const long n2 = aMetric2.GetSize().Width();
const long n1 = aFont.GetFontSize().Width();
const long n2 = aMetric2.GetFontSize().Width();
scale = (double)n1 / (double)n2;
}
@@ -618,7 +618,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon
m.translate( double(aPt.X() / scale), double(aPt.Y()) );
m.scale( scale, scale );
sal_Int16 nHeight = _Int16( map( Size( 0, aFont.GetHeight() ) ).Height() );
sal_Int16 nHeight = _Int16( map( Size( 0, aFont.GetFontHeight() ) ).Height() );
startTag( TAG_DEFINETEXT );
+2 -2
View File
@@ -480,8 +480,8 @@ sal_uInt16 FlashFont::getGlyph( sal_uInt16 nChar, VirtualDevice* pVDev )
for( n = 0; n < nSize; n++ )
{
Point aPoint( rPoly[n] );
aPoint.X() = static_cast<long>((double(aPoint.X()) * 1024.0 ) / double(aOldFont.GetHeight()));
aPoint.Y() = static_cast<long>((double(aPoint.Y()) * 1024.0 ) / double(aOldFont.GetHeight()));
aPoint.X() = static_cast<long>((double(aPoint.X()) * 1024.0 ) / double(aOldFont.GetFontHeight()));
aPoint.Y() = static_cast<long>((double(aPoint.Y()) * 1024.0 ) / double(aOldFont.GetFontHeight()));
rPoly[n] = aPoint;
}
Writer::Impl_addPolygon( maGlyphData, rPoly, true );
+2 -2
View File
@@ -2184,7 +2184,7 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
long nRotation = maFont.GetOrientation();
ImplWriteTextColor();
Size aSize = maFont.GetSize();
Size aSize = maFont.GetFontSize();
if ( maLastFont != maFont )
{
@@ -2198,7 +2198,7 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
ImplDefineFont( "Times", "Italic" );
maLastFont = maFont;
aSize = maFont.GetSize();
aSize = maFont.GetFontSize();
ImplWriteDouble( aSize.Height() );
mpPS->WriteCharPtr( "sf " );
}
+1 -1
View File
@@ -202,7 +202,7 @@ bool DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
aFont.SetColor(aColor);
aFont.SetTransparent(true);
aFont.SetFamily(FAMILY_SWISS);
aFont.SetSize(Size(0,nHeight));
aFont.SetFontSize(Size(0,nHeight));
aFont.SetAlignment(ALIGN_BASELINE);
aFont.SetOrientation(nAngle);
if (aActFont!=aFont) {
@@ -978,7 +978,7 @@ void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt1
if (pF!=nullptr)
aFont = pF->aFont;
aFont.SetColor(aAttr.aChrCol);
aFont.SetSize(Size(0,aAttr.aChrCellSize.Height()));
aFont.SetFontSize(Size(0,aAttr.aChrCellSize.Height()));
if ( aAttr.nChrAng != 0 )
aFont.SetOrientation(aAttr.nChrAng);
+2 -2
View File
@@ -1403,7 +1403,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode)
case 0x000d: // TxSize
{
pPict->ReadUInt16( nUSHORT );
aActFont.SetSize( Size( 0, (long)nUSHORT ) );
aActFont.SetFontSize( Size( 0, (long)nUSHORT ) );
eActMethod=PDM_UNDEFINED;
nDataSize=2;
}
@@ -1873,7 +1873,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aActFont.SetCharSet( GetTextEncoding());
aActFont.SetFamily(FAMILY_SWISS);
aActFont.SetSize(Size(0,12));
aActFont.SetFontSize(Size(0,12));
aActFont.SetAlignment(ALIGN_BASELINE);
aHRes = aVRes = Fraction( 1, 1 );
+1 -1
View File
@@ -2153,7 +2153,7 @@ bool SdrPowerPointImport::ReadFontCollection()
aFont.SetFamilyName( pFont->aName );
aFont.SetFamily( pFont->eFamily );
aFont.SetPitch( pFont->ePitch );
aFont.SetHeight( 100 );
aFont.SetFontHeight( 100 );
// following block is necessary, because our old PowerPoint export did not set the
// correct charset
+3 -3
View File
@@ -1074,14 +1074,14 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
{
if (w == 0)
break;
long nNewHeight = aFont.GetHeight() * nTextWidth / w;
if( nNewHeight == aFont.GetHeight() )
long nNewHeight = aFont.GetFontHeight() * nTextWidth / w;
if( nNewHeight == aFont.GetFontHeight() )
{
nNewHeight--;
if( nNewHeight <= 0 )
break;
}
aFont.SetHeight( nNewHeight );
aFont.SetFontHeight( nNewHeight );
pDev->SetFont( aFont );
}
long nTextHeight = pDev->GetTextHeight();
+1 -1
View File
@@ -195,7 +195,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
ScopedVclPtrInstance< VirtualDevice > pVDev;
vcl::Font aFont( rFont );
aFont.SetSize( Size( 0, nFontEM ) );
aFont.SetFontSize( Size( 0, nFontEM ) );
aFont.SetAlignment( ALIGN_BASELINE );
pVDev->SetMapMode( MAP_100TH_MM );
+8 -8
View File
@@ -298,7 +298,7 @@ void SVGAttributeWriter::SetFontAttr( const vcl::Font& rFont )
// Font Size
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontSize,
OUString::number( rFont.GetHeight() ) + "px" );
OUString::number( rFont.GetFontHeight() ) + "px" );
// Font Style
if( rFont.GetItalic() != ITALIC_NONE )
@@ -475,9 +475,9 @@ void SVGTextWriter::implSetCurrentFont()
maCurrentFont = mpVDev->GetFont();
Size aSz;
implMap( Size( 0, maCurrentFont.GetHeight() ), aSz );
implMap( Size( 0, maCurrentFont.GetFontHeight() ), aSz );
maCurrentFont.SetHeight( aSz.Height() );
maCurrentFont.SetFontHeight( aSz.Height() );
}
else
{
@@ -730,12 +730,12 @@ void SVGTextWriter::addFontAttributes( bool bIsTextContainer )
if( maCurrentFont != maParentFont )
{
const OUString& rsCurFontName = maCurrentFont.GetFamilyName();
long int nCurFontSize = maCurrentFont.GetHeight();
long int nCurFontSize = maCurrentFont.GetFontHeight();
FontItalic eCurFontItalic = maCurrentFont.GetItalic();
FontWeight eCurFontWeight = maCurrentFont.GetWeight();
const OUString& rsParFontName = maParentFont.GetFamilyName();
long int nParFontSize = maParentFont.GetHeight();
long int nParFontSize = maParentFont.GetFontHeight();
FontItalic eParFontItalic = maParentFont.GetItalic();
FontWeight eParFontWeight = maParentFont.GetWeight();
@@ -1606,7 +1606,7 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
{
sId += ".bp";
BulletListItemInfo& aBulletListItemInfo = maBulletListItemMap[ sId ];
aBulletListItemInfo.nFontSize = rFont.GetHeight();
aBulletListItemInfo.nFontSize = rFont.GetFontHeight();
aBulletListItemInfo.aColor = aTextColor;
aBulletListItemInfo.aPos = maTextPos;
aBulletListItemInfo.cBulletChar = mcBulletChar;
@@ -3592,9 +3592,9 @@ vcl::Font SVGActionWriter::ImplSetCorrectFontHeight() const
vcl::Font aFont( mpVDev->GetFont() );
Size aSz;
ImplMap( Size( 0, aFont.GetHeight() ), aSz );
ImplMap( Size( 0, aFont.GetFontHeight() ), aSz );
aFont.SetHeight( aSz.Height() );
aFont.SetFontHeight( aSz.Height() );
return aFont;
}
@@ -440,7 +440,7 @@ namespace frm
m_pVScroll->SetVisibleSize( aViewportPlaygroundLogic.Height() );
// the default height of a text line ....
long nFontHeight = m_pEngine->GetStandardFont(0).GetSize().Height();
long nFontHeight = m_pEngine->GetStandardFont(0).GetFontSize().Height();
// ... is the scroll size for the vertical scrollbar
m_pVScroll->SetLineSize( nFontHeight );
// the viewport width, minus one line, is the page scroll size
@@ -452,7 +452,7 @@ namespace frm
{
m_pHScroll->SetVisibleSize( aViewportPlaygroundLogic.Width() );
long nFontWidth = m_pEngine->GetStandardFont(0).GetSize().Width();
long nFontWidth = m_pEngine->GetStandardFont(0).GetFontSize().Width();
if ( !nFontWidth )
{
m_pViewport->Push( PushFlags::FONT );
+2 -2
View File
@@ -39,9 +39,9 @@ StructListBox::StructListBox(vcl::Window* pParent, WinBits nBits ):
bActiveFlag=false;
vcl::Font aFont( GetFont() );
Size aSize = aFont.GetSize();
Size aSize = aFont.GetFontSize();
aSize.Height() -= 2;
aFont.SetSize( aSize );
aFont.SetFontSize( aSize );
SetFont( aFont );
}
@@ -270,7 +270,7 @@ sal_Int32 ComplexToolbarController::getFontSizePixel( const vcl::Window* pWindow
const vcl::Font& rFont = rSettings.GetAppFont();
// Calculate height of the application font used by window
sal_Int32 nHeight = sal_Int32( rFont.GetHeight() );
sal_Int32 nHeight = sal_Int32( rFont.GetFontHeight() );
::Size aPixelSize = pWindow->LogicToPixel( ::Size( 0, nHeight ), MAP_APPFONT );
return aPixelSize.Height();
}
+6 -6
View File
@@ -113,12 +113,12 @@ public:
void SetTransparent( bool bTransparent );
void SetSize( const Size& );
const Size& GetSize() const;
void SetHeight( long nHeight );
long GetHeight() const;
void SetWidth( long nWidth );
long GetWidth() const;
void SetFontSize( const Size& );
const Size& GetFontSize() const;
void SetFontHeight( long nHeight );
long GetFontHeight() const;
void SetAverageFontWidth( long nWidth );
long GetAverageFontWidth() const;
// Prefer LanguageTag over LanguageType
void SetLanguageTag( const LanguageTag & );
+1 -1
View File
@@ -82,7 +82,7 @@ inline std::basic_ostream<charT, traits> & operator <<(
{
stream << "{"
<< "name=" << "\"" << rMetric.GetFamilyName() << "\""
<< ",size=(" << rMetric.GetSize().Width() << "," << rMetric.GetSize().Height() << ")"
<< ",size=(" << rMetric.GetFontSize().Width() << "," << rMetric.GetFontSize().Height() << ")"
<< ",ascent=" << rMetric.GetAscent()
<< ",descent=" << rMetric.GetDescent()
<< ",intLeading=" << rMetric.GetInternalLeading()
+1 -1
View File
@@ -518,7 +518,7 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat
{
vcl::Font aBaseFont( Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont() );
SvxFont aFont( VCLUnoHelper::CreateFont( _xReportControlFormat->getFontDescriptor(), aBaseFont ) );
aFont.SetHeight( OutputDevice::LogicToLogic( Size( 0, (sal_Int32)aFont.GetHeight() ), MAP_POINT, MAP_TWIP ).Height());
aFont.SetFontHeight( OutputDevice::LogicToLogic( Size( 0, (sal_Int32)aFont.GetFontHeight() ), MAP_POINT, MAP_TWIP ).Height());
aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) );
aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) );
aFont.SetColor( _xReportControlFormat->getCharColor() );
+2 -2
View File
@@ -239,7 +239,7 @@ namespace
aFontItem.PutValue( uno::makeAny( aControlFont ), 0 );
_rItemSet.Put(aFontItem);
_rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetHeight()), MAP_POINT, MAP_TWIP).Height(),100,_nFontHeight));
_rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetFontHeight()), MAP_POINT, MAP_TWIP).Height(),100,_nFontHeight));
lang::Locale aLocale;
switch(_nWhich)
{
@@ -389,7 +389,7 @@ namespace
if ( SfxItemState::SET == _rItemSet.GetItemState( _nFontHeight,true,&pItem) && dynamic_cast< const SvxFontHeightItem *>( pItem ) != nullptr)
{
const SvxFontHeightItem* pFontItem = static_cast<const SvxFontHeightItem*>(pItem);
aNewFont.SetHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MAP_TWIP, MAP_POINT).Height());
aNewFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MAP_TWIP, MAP_POINT).Height());
}
if ( SfxItemState::SET == _rItemSet.GetItemState( _nPosture,true,&pItem) && dynamic_cast< const SvxPostureItem *>( pItem ) != nullptr)
{
+2 -2
View File
@@ -191,11 +191,11 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
pPattern = pDoc->GetPattern(0,0,1);
vcl::Font aFont;
pPattern->GetFont(aFont,SC_AUTOCOL_RAW);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetSize().getHeight());
CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetFontSize().getHeight());
CPPUNIT_ASSERT_EQUAL_MESSAGE("font color should be black", COL_AUTO, aFont.GetColor().GetColor());
pPattern = pDoc->GetPattern(0,1,1);
pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, aFont.GetSize().getHeight());
CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, aFont.GetFontSize().getHeight());
pPattern = pDoc->GetPattern(0,2,1);
pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be italic", ITALIC_NORMAL, aFont.GetItalic());
+2 -2
View File
@@ -304,7 +304,7 @@ long ScColumn::GetNeededSize(
if ( bBreak && !rOptions.bTotalSize )
{
// limit size for line break
long nCmp = pDev->GetFont().GetSize().Height() * SC_ROT_BREAK_FACTOR;
long nCmp = pDev->GetFont().GetFontSize().Height() * SC_ROT_BREAK_FACTOR;
if ( nHeight > nCmp )
nHeight = nCmp;
}
@@ -485,7 +485,7 @@ long ScColumn::GetNeededSize(
if ( bBreak && !rOptions.bTotalSize )
{
// limit size for line break
long nCmp = aOldFont.GetSize().Height() * SC_ROT_BREAK_FACTOR;
long nCmp = aOldFont.GetFontSize().Height() * SC_ROT_BREAK_FACTOR;
if ( nValue > nCmp )
nValue = nCmp;
}
+2 -2
View File
@@ -399,11 +399,11 @@ void ScPatternAttr::GetFont(
aDestMode.SetScaleY( aFractOne );
aEffSize = OutputDevice::LogicToLogic( aSize, aSrcMode, aDestMode );
}
rFont.SetSize( aEffSize );
rFont.SetFontSize( aEffSize );
}
else /* if pOutDev != NULL */
{
rFont.SetSize( Size( 0, (long) nFontHeight ) );
rFont.SetFontSize( Size( 0, (long) nFontHeight ) );
}
// determine effective font color
+1 -1
View File
@@ -203,7 +203,7 @@ void XclFontData::FillFromVclFont( const vcl::Font& rFont )
maColor = rFont.GetColor();
SetScUnderline( rFont.GetUnderline() );
mnEscapem = EXC_FONTESC_NONE;
SetScHeight( rFont.GetSize().Height() );
SetScHeight( rFont.GetFontSize().Height() );
SetScWeight( rFont.GetWeight() );
SetScFamily( rFont.GetFamilyType() );
SetFontEncoding( rFont.GetCharSet() );
@@ -315,7 +315,7 @@ static inline void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropN
static void lcl_FillFontAttributes( Sequence< PropertyValue >& rSeq, const vcl::Font& rFont )
{
SvxFontItem aFontItem( rFont.GetFamilyType(), rFont.GetFamilyName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), ATTR_FONT );
SvxFontHeightItem aHeightItem( rFont.GetSize().Height(), 100, ATTR_FONT_HEIGHT );
SvxFontHeightItem aHeightItem( rFont.GetFontSize().Height(), 100, ATTR_FONT_HEIGHT );
SvxLanguageItem aLangItem( rFont.GetLanguage(), ATTR_FONT_LANGUAGE );
sal_Int32 nIndex = lcl_ExpandSequence( rSeq, 7 );
+1 -1
View File
@@ -1384,7 +1384,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh)
// always use application font, so a font with cjk chars can be installed
vcl::Font aAppFont = GetFont();
aTextFont = aAppFont;
aTextFont.SetSize(PixelToLogic(aAppFont.GetSize(), MAP_TWIP)); // AppFont is in pixels
aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MAP_TWIP)); // AppFont is in pixels
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+6 -6
View File
@@ -89,7 +89,7 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(vcl::Window* pParent, ScDocument* pDo
sal_Int32 nScaleFactor = GetDPIScaleFactor();
const sal_uInt16 nPopupFontHeight = 12 * nScaleFactor;
maLabelFont = rStyle.GetLabelFont();
maLabelFont.SetHeight(nPopupFontHeight);
maLabelFont.SetFontHeight(nPopupFontHeight);
}
ScMenuFloatingWindow::~ScMenuFloatingWindow()
@@ -361,14 +361,14 @@ void ScMenuFloatingWindow::drawMenuItem(vcl::RenderContext& rRenderContext, size
DecorationView aDecoView(&rRenderContext);
long nXOffset = 5;
long nYOffset = (aSize.Height() - maLabelFont.GetHeight())/2;
long nYOffset = (aSize.Height() - maLabelFont.GetFontHeight())/2;
rRenderContext. DrawCtrlText(Point(aPos.X()+nXOffset, aPos.Y() + nYOffset), maMenuItems[nPos].maText, 0,
maMenuItems[nPos].maText.getLength(),
maMenuItems[nPos].mbEnabled ? DrawTextFlags::Mnemonic : DrawTextFlags::Disable);
if (maMenuItems[nPos].mpSubMenuWin)
{
long nFontHeight = maLabelFont.GetHeight();
long nFontHeight = maLabelFont.GetFontHeight();
Point aMarkerPos = aPos;
aMarkerPos.Y() += aSize.Height() / 2 - nFontHeight / 4 + 1;
aMarkerPos.X() += aSize.Width() - nFontHeight + nFontHeight / 4;
@@ -723,8 +723,8 @@ void ScMenuFloatingWindow::getMenuItemPosSize(size_t nPos, Point& rPos, Size& rS
const sal_uInt16 nLeftMargin = 5;
const sal_uInt16 nTopMargin = 5;
const sal_uInt16 nMenuItemHeight = static_cast<sal_uInt16>(maLabelFont.GetHeight()*1.8);
const sal_uInt16 nSepHeight = static_cast<sal_uInt16>(maLabelFont.GetHeight()*0.8);
const sal_uInt16 nMenuItemHeight = static_cast<sal_uInt16>(maLabelFont.GetFontHeight()*1.8);
const sal_uInt16 nSepHeight = static_cast<sal_uInt16>(maLabelFont.GetFontHeight()*0.8);
Point aPos1(nLeftMargin, nTopMargin);
rPos = aPos1;
@@ -939,7 +939,7 @@ void ScCheckListMenuWindow::getSectionPosSize(
const long nSingleItemBtnAreaHeight = 32 * nScaleFactor; // height of the middle area below the list box where the single-action buttons are.
const long nBottomBtnAreaHeight = 50 * nScaleFactor; // height of the bottom area where the OK and Cancel buttons are.
const long nBtnWidth = 90 * nScaleFactor;
const long nLabelHeight = getLabelFont().GetHeight();
const long nLabelHeight = getLabelFont().GetFontHeight();
const long nBtnHeight = nLabelHeight * 2;
const long nBottomMargin = 10 * nScaleFactor;
const long nMenuListMargin = 5 * nScaleFactor;
+1 -1
View File
@@ -123,7 +123,7 @@ void ScDPFieldButton::draw()
vcl::Font aAttrFont;
static_cast<const ScPatternAttr&>(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).
GetFont( aAttrFont, SC_AUTOCOL_BLACK, mpOutDev, &maZoomY );
aTextFont.SetSize( aAttrFont.GetSize() );
aTextFont.SetFontSize( aAttrFont.GetFontSize() );
}
mpOutDev->SetFont(aTextFont);
mpOutDev->SetTextColor(mpStyle->GetButtonTextColor());
+2 -2
View File
@@ -227,7 +227,7 @@ void ScCsvGrid::InitColors()
void ScCsvGrid::InitFonts()
{
maMonoFont = OutputDevice::GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::NONE );
maMonoFont.SetSize( Size( maMonoFont.GetSize().Width(), maHeaderFont.GetSize().Height() ) );
maMonoFont.SetFontSize( Size( maMonoFont.GetFontSize().Width(), maHeaderFont.GetFontSize().Height() ) );
/* *** Set edit engine defaults ***
maMonoFont for Latin script, smaller default font for Asian and Complex script. */
@@ -245,7 +245,7 @@ void ScCsvGrid::InitFonts()
aDefSet.Put( aComplexItem );
// set Asian/Complex font size to height of character in Latin font
sal_uLong nFontHt = static_cast< sal_uLong >( maMonoFont.GetSize().Height() );
sal_uLong nFontHt = static_cast< sal_uLong >( maMonoFont.GetFontSize().Height() );
aDefSet.Put( SvxFontHeightItem( nFontHt, 100, EE_CHAR_FONTHEIGHT_CJK ) );
aDefSet.Put( SvxFontHeightItem( nFontHt, 100, EE_CHAR_FONTHEIGHT_CTL ) );
+9 -9
View File
@@ -116,7 +116,7 @@ void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font
if ( pCurData )
{
rFont = rCJKFont = rCTLFont = GetFont();
Size aFontSize( rFont.GetSize().Width(), 10 * GetDPIScaleFactor() );
Size aFontSize( rFont.GetFontSize().Width(), 10 * GetDPIScaleFactor() );
const SvxFontItem* pFontItem = static_cast<const SvxFontItem*> (pCurData->GetItem( nIndex, ATTR_FONT ));
const SvxWeightItem* pWeightItem = static_cast<const SvxWeightItem*> (pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT ));
@@ -145,14 +145,14 @@ void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font
#define SETONALLFONTS( MethodName, Value ) \
rFont.MethodName( Value ); rCJKFont.MethodName( Value ); rCTLFont.MethodName( Value );
SETONALLFONTS( SetUnderline, (FontLineStyle)pUnderlineItem->GetValue() )
SETONALLFONTS( SetOverline, (FontLineStyle)pOverlineItem->GetValue() )
SETONALLFONTS( SetStrikeout, (FontStrikeout)pCrossedOutItem->GetValue() )
SETONALLFONTS( SetOutline, pContourItem->GetValue() )
SETONALLFONTS( SetShadow, pShadowedItem->GetValue() )
SETONALLFONTS( SetColor, aColor )
SETONALLFONTS( SetSize, aFontSize )
SETONALLFONTS( SetTransparent, true )
SETONALLFONTS( SetUnderline, (FontLineStyle)pUnderlineItem->GetValue() )
SETONALLFONTS( SetOverline, (FontLineStyle)pOverlineItem->GetValue() )
SETONALLFONTS( SetStrikeout, (FontStrikeout)pCrossedOutItem->GetValue() )
SETONALLFONTS( SetOutline, pContourItem->GetValue() )
SETONALLFONTS( SetShadow, pShadowedItem->GetValue() )
SETONALLFONTS( SetColor, aColor )
SETONALLFONTS( SetFontSize, aFontSize )
SETONALLFONTS( SetTransparent, true )
#undef SETONALLFONTS
}
@@ -81,9 +81,9 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
Color aOldFillColor = pDev->GetFillColor();
vcl::Font aFont(OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne));
Size aSize = aFont.GetSize();
Size aSize = aFont.GetFontSize();
aSize.Height() = nRectHeight*3/5;
aFont.SetSize( aSize );
aFont.SetFontSize( aSize );
long nTLX = aBLPos.X() + 5, nTLY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
long nTRX = aBLPos.X() + nRectWidth * 7 / 9 - 15, nTRY = aBLPos.Y() + ( nRectHeight - nItemId )/2;
+3 -3
View File
@@ -109,7 +109,7 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const Rectangle& rInnerP
// everything else from application font
vcl::Font aAppFont = pDev->GetSettings().GetStyleSettings().GetAppFont();
aAppFont.SetSize( aAttrFont.GetSize() );
aAppFont.SetFontSize( aAttrFont.GetFontSize() );
aAppFont.SetAlignment( ALIGN_TOP );
pDev->SetFont( aAppFont );
@@ -1281,14 +1281,14 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
else
{
// find right font size for DrawText
aFont.SetSize( Size( 0,100 ) );
aFont.SetFontSize( Size( 0,100 ) );
rRenderContext.SetFont( aFont );
Size aSize100(rRenderContext.GetTextWidth( aThisPageStr ), rRenderContext.GetTextHeight() );
// 40% of width or 60% of height
long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width();
long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height();
aFont.SetSize( Size( 0,std::min(nSizeX,nSizeY) ) );
aFont.SetFontSize( Size( 0,std::min(nSizeX,nSizeY) ) );
rRenderContext.SetFont( aFont );
// centered output with DrawText
+2 -2
View File
@@ -235,9 +235,9 @@ void ScDrawStringsVars::SetShrinkScale( long nScale, SvtScriptType nScript )
aFraction *= pOutput->aZoomY;
vcl::Font aTmpFont;
pPattern->GetFont( aTmpFont, SC_AUTOCOL_RAW, pFmtDevice, &aFraction, pCondSet, nScript );
long nNewHeight = aTmpFont.GetHeight();
long nNewHeight = aTmpFont.GetFontHeight();
if ( nNewHeight > 0 )
aFont.SetHeight( nNewHeight );
aFont.SetFontHeight( nNewHeight );
// set font and dependent variables as in SetPattern
+1 -1
View File
@@ -348,7 +348,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
const StyleSettings& rStyleSettings = pFrameWin->GetSettings().GetStyleSettings();
sal_Int32 nTabWidth = pFrameWin->GetFont().GetHeight() + WIDTH_MARGIN;
sal_Int32 nTabWidth = pFrameWin->GetFont().GetFontHeight() + WIDTH_MARGIN;
if ( aViewData.GetHSplitMode() != SC_SPLIT_NONE )
{
+2 -2
View File
@@ -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);
+3 -3
View File
@@ -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 );
}
+1 -1
View File
@@ -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();
@@ -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 );
}
}
+1 -1
View File
@@ -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 )));
+2 -2
View File
@@ -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() );
+4 -4
View File
@@ -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;
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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());
+3 -3
View File
@@ -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 );
+2 -2
View File
@@ -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(
+1 -1
View File
@@ -46,7 +46,7 @@ namespace {
void SetMessageFont(vcl::RenderContext& rRenderContext)
{
vcl::Font aFont(rRenderContext.GetFont());
aFont.SetHeight(aFont.GetHeight() * 1.3);
aFont.SetFontHeight(aFont.GetFontHeight() * 1.3);
rRenderContext.SetFont(aFont);
}
+3 -3
View File
@@ -298,7 +298,7 @@ void BackingWindow::initControls()
// setup nice colors
mpCreateLabel->SetControlForeground(maButtonsTextColor);
vcl::Font aFont(mpCreateLabel->GetSettings().GetStyleSettings().GetLabelFont());
aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier));
mpCreateLabel->SetControlFont(aFont);
mpHelpButton->SetControlForeground(maButtonsTextColor);
@@ -347,7 +347,7 @@ void BackingWindow::setupButton( PushButton* pButton )
{
// the buttons should have a bit bigger font
vcl::Font aFont(pButton->GetSettings().GetStyleSettings().GetPushButtonFont());
aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier));
pButton->SetControlFont(aFont);
// color that fits the theme
@@ -358,7 +358,7 @@ void BackingWindow::setupButton( PushButton* pButton )
void BackingWindow::setupButton( MenuButton* pButton )
{
vcl::Font aFont(pButton->GetSettings().GetStyleSettings().GetPushButtonFont());
aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
aFont.SetFontSize(Size(0, aFont.GetFontSize().Height() * fMultiplier));
pButton->SetControlFont(aFont);
// color that fits the theme
@@ -152,8 +152,8 @@ RehearseTimingsActivity::RehearseTimingsActivity( const SlideShowContext& rConte
mbActive(false),
mbDrawPressed(false)
{
maFont.SetHeight( maFont.GetHeight() * 2 );
maFont.SetWidth( maFont.GetWidth() * 2 );
maFont.SetFontHeight( maFont.GetFontHeight() * 2 );
maFont.SetAverageFontWidth( maFont.GetAverageFontWidth() * 2 );
maFont.SetAlignment( ALIGN_BASELINE );
maFont.SetColor( COL_BLACK );
+1 -1
View File
@@ -98,7 +98,7 @@ public:
void SetBorderWidth(long nWidth) { nBorderWidth = nWidth; }
long GetBorderWidth() const;
long GetDefaultBorderWidth() const { return GetSize().Height() / 20 ; }
long GetDefaultBorderWidth() const { return GetFontSize().Height() / 20 ; }
void FreezeBorderWidth() { nBorderWidth = GetDefaultBorderWidth(); }
SmFace & operator = (const SmFace &rFace);
+1 -1
View File
@@ -892,7 +892,7 @@ void SmMathConfig::LoadFormat()
}
++pVal;
aFnt.SetSize( pFormat->GetBaseSize() );
aFnt.SetFontSize( pFormat->GetBaseSize() );
pFormat->SetFont( i, aFnt, bUseDefaultFont );
}
+5 -5
View File
@@ -266,7 +266,7 @@ void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
rRenderContext.SetBackground(Wallpaper(aBackColor));
vcl::Font aFont(maFont);
aFont.SetSize(Size(0, 24 * rRenderContext.GetDPIScaleFactor()));
aFont.SetFontSize(Size(0, 24 * rRenderContext.GetDPIScaleFactor()));
aFont.SetAlignment(ALIGN_TOP);
rRenderContext.SetFont(aFont);
rRenderContext.SetTextColor(aTextColor);
@@ -362,7 +362,7 @@ SmFontDialog::SmFontDialog(vcl::Window * pParent, OutputDevice *pFntListDevice,
{
m_pFontBox->InsertEntry( aFontList.GetFontName(i).GetFamilyName() );
}
maFont.SetSize(Size(0, 24));
maFont.SetFontSize(Size(0, 24));
maFont.SetWeight(WEIGHT_NORMAL);
maFont.SetItalic(ITALIC_NONE);
maFont.SetFamily(FAMILY_DONTKNOW);
@@ -1152,7 +1152,7 @@ void SmShowSymbolSetWindow::Paint(vcl::RenderContext& rRenderContext, const Rect
// taking a FontSize which is a bit smaller (compared to nLen) in order to have a buffer
// (hopefully enough for left and right, too)
aFont.SetSize(Size(0, nLen - (nLen / 3)));
aFont.SetFontSize(Size(0, nLen - (nLen / 3)));
rRenderContext.SetFont(aFont);
// keep text color
rRenderContext.SetTextColor(aTxtColor);
@@ -1385,7 +1385,7 @@ void SmShowSymbol::ApplySettings(vcl::RenderContext& /*rRenderContext*/ )
void SmShowSymbol::setFontSize(vcl::Font &rFont) const
{
rFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3));
rFont.SetFontSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3));
}
void SmShowSymbol::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect)
@@ -1687,7 +1687,7 @@ void SmShowChar::SetSymbol( const SmSym *pSym )
void SmShowChar::SetSymbol( sal_UCS4 cChar, const vcl::Font &rFont )
{
vcl::Font aFont( rFont );
aFont.SetSize( Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3) );
aFont.SetFontSize( Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3) );
aFont.SetAlignment(ALIGN_BASELINE);
SetFont(aFont);
aFont.SetTransparent(true);
+1 -2
View File
@@ -1307,8 +1307,7 @@ void SmXMLExport::ExportFont(const SmNode *pNode, int nLevel)
//value specified in points.
//Must fix StarMath to retain the original pt values
Fraction aTemp = Sm100th_mmToPts(pFontNode->GetFont().
GetSize().Height());
Fraction aTemp = Sm100th_mmToPts(pFontNode->GetFont().GetFontSize().Height());
if (pFontNode->GetSizeType() == FontSizeType::MINUS)
aTemp-=aFrac;
+27 -27
View File
@@ -172,7 +172,7 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
rSize.GetDenominator());
long nHeight = (long)aVal;
aFntSize = GetFont().GetSize();
aFntSize = GetFont().GetFontSize();
aFntSize.Width() = 0;
switch(nType)
{
@@ -686,7 +686,7 @@ void SmTableNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
// make distance depend on font size
long nDist = +(rFormat.GetDistance(DIS_VERTICAL)
* GetFont().GetSize().Height()) / 100L;
* GetFont().GetFontSize().Height()) / 100L;
if (nSize < 1)
return;
@@ -794,7 +794,7 @@ void SmLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
}
// make distance depend on font size
long nDist = (rFormat.GetDistance(DIS_HORIZONTAL) * GetFont().GetSize().Height()) / 100L;
long nDist = (rFormat.GetDistance(DIS_HORIZONTAL) * GetFont().GetFontSize().Height()) / 100L;
if (!IsUseExtraSpaces())
nDist = 0;
@@ -852,7 +852,7 @@ void SmUnHorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
RHA_CENTER, RVA_BASELINE);
// add a bit space between operator and argument
// (worst case -{1 over 2} where - and over have almost no space inbetween)
long nDelta = pOper->GetFont().GetSize().Height() / 20;
long nDelta = pOper->GetFont().GetFontSize().Height() / 20;
if (bIsPostfix)
aPos.X() += nDelta;
else
@@ -926,7 +926,7 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
nVerOffset;
GetHeightVerOffset(*pBody, nHeight, nVerOffset);
nHeight += rFormat.GetDistance(DIS_ROOT)
* GetFont().GetSize().Height() / 100L;
* GetFont().GetFontSize().Height() / 100L;
// font specialist advised to change the width first
pRootSym->AdaptToY(rDev, nHeight);
@@ -1086,7 +1086,7 @@ void SmBinVerNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
pNum ->Arrange(rDev, rFormat);
pDenom->Arrange(rDev, rFormat);
long nFontHeight = GetFont().GetSize().Height(),
long nFontHeight = GetFont().GetFontSize().Height(),
nExtLen = nFontHeight * rFormat.GetDistance(DIS_FRACTION) / 100L,
nThick = nFontHeight * rFormat.GetDistance(DIS_STROKEWIDTH) / 100L,
nWidth = std::max(pNum->GetItalicWidth(), pDenom->GetItalicWidth()),
@@ -1403,7 +1403,7 @@ void SmSubSupNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
SmNode *pBody = GetBody();
OSL_ENSURE(pBody, "Sm: NULL pointer");
long nOrigHeight = pBody->GetFont().GetSize().Height();
long nOrigHeight = pBody->GetFont().GetFontSize().Height();
pBody->Arrange(rDev, rFormat);
@@ -1436,7 +1436,7 @@ void SmSubSupNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
// prevent sub-/supscripts from diminishing in size
// (as would be in "a_{1_{2_{3_4}}}")
if (GetFont().GetSize().Height() > rFormat.GetBaseSize().Height() / 3)
if (GetFont().GetFontSize().Height() > rFormat.GetBaseSize().Height() / 3)
{
sal_uInt16 nIndex = (eSubSup == CSUB || eSubSup == CSUP) ?
SIZ_LIMITS : SIZ_INDEX;
@@ -1614,7 +1614,7 @@ void SmBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
(GetScaleMode() == SCALE_HEIGHT || bIsScaleNormal),
bIsABS = GetToken().eType == TABS;
long nFaceHeight = GetFont().GetSize().Height();
long nFaceHeight = GetFont().GetFontSize().Height();
// determine oversize in %
sal_uInt16 nPerc = 0;
@@ -1644,8 +1644,8 @@ void SmBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
// if wanted, scale the braces to the wanted size
if (bScale)
{
Size aTmpSize (pLeft->GetFont().GetSize());
OSL_ENSURE(pRight->GetFont().GetSize() == aTmpSize,
Size aTmpSize (pLeft->GetFont().GetFontSize());
OSL_ENSURE(pRight->GetFont().GetFontSize() == aTmpSize,
"Sm : different font sizes");
aTmpSize.Width() = std::min((long) nBraceHeight * 60L / 100L,
rFormat.GetBaseSize().Height() * 3L / 2L);
@@ -1716,7 +1716,7 @@ void SmBracebodyNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
// scale separators to required height and arrange them
bool bScale = GetScaleMode() == SCALE_HEIGHT || rFormat.IsScaleNormalBrackets();
long nHeight = bScale ? aRefRect.GetHeight() : GetFont().GetSize().Height();
long nHeight = bScale ? aRefRect.GetHeight() : GetFont().GetFontSize().Height();
sal_uInt16 nIndex = GetScaleMode() == SCALE_HEIGHT ?
DIS_BRACKETSIZE : DIS_NORMALBRACKETSIZE;
sal_uInt16 nPerc = rFormat.GetDistance(nIndex);
@@ -1730,7 +1730,7 @@ void SmBracebodyNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
}
// horizontal distance between argument and brackets or separators
long nDist = GetFont().GetSize().Height()
long nDist = GetFont().GetFontSize().Height()
* rFormat.GetDistance(DIS_BRACKETSPACE) / 100L;
SmNode *pLeft = GetSubNode(0);
@@ -1784,7 +1784,7 @@ void SmVerticalBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
// determine the relative position and the distances between each other
RectPos eRectPos;
long nFontHeight = pBody->GetFont().GetSize().Height();
long nFontHeight = pBody->GetFont().GetFontSize().Height();
long nDistBody = nFontHeight * rFormat.GetDistance(DIS_ORNAMENTSIZE),
nDistScript = nFontHeight;
if (GetToken().eType == TOVERBRACE)
@@ -1834,7 +1834,7 @@ long SmOperNode::CalcSymbolHeight(const SmNode &rSymbol,
const SmFormat &rFormat) const
// returns the font height to be used for operator-symbol
{
long nHeight = GetFont().GetSize().Height();
long nHeight = GetFont().GetFontSize().Height();
SmTokenType eTmpType = GetToken().eType;
if (eTmpType == TLIM || eTmpType == TLIMINF || eTmpType == TLIMSUP)
@@ -1868,12 +1868,12 @@ void SmOperNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
SmNode *pSymbol = GetSymbol();
pSymbol->SetSize(Fraction(CalcSymbolHeight(*pSymbol, rFormat),
pSymbol->GetFont().GetSize().Height()));
pSymbol->GetFont().GetFontSize().Height()));
pBody->Arrange(rDev, rFormat);
pOper->Arrange(rDev, rFormat);
long nOrigHeight = GetFont().GetSize().Height(),
long nOrigHeight = GetFont().GetFontSize().Height(),
nDist = nOrigHeight
* rFormat.GetDistance(DIS_OPERATORSPACE) / 100L;
@@ -1942,7 +1942,7 @@ void SmAttributNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
default :
eVerAlign = RVA_ATTRIBUT_HI;
if (pBody->GetType() == NATTRIBUT)
nDist = GetFont().GetSize().Height()
nDist = GetFont().GetFontSize().Height()
* rFormat.GetDistance(DIS_ORNAMENTSPACE) / 100L;
}
Point aPos = pAttr->AlignTo(*pBody, RectPos::Attribute, RHA_CENTER, eVerAlign);
@@ -2206,7 +2206,7 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
aPoly.SetPoint(aPointA, 0);
aPoly.SetPoint(aPointB, 1);
long nThick = GetFont().GetSize().Height()
long nThick = GetFont().GetFontSize().Height()
* rFormat.GetDistance(DIS_STROKEWIDTH) / 100L;
nWidth = nThick + 2 * nBorderwidth;
@@ -2265,7 +2265,7 @@ void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nHeight)
void SmRectangleNode::Arrange(OutputDevice &rDev, const SmFormat &/*rFormat*/)
{
long nFontHeight = GetFont().GetSize().Height();
long nFontHeight = GetFont().GetFontSize().Height();
long nWidth = aToSize.Width(),
nHeight = aToSize.Height();
if (nHeight == 0)
@@ -2507,7 +2507,7 @@ void SmMatrixNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
}
// norm distance from which the following two are calculated
const long nNormDist = 3 * GetFont().GetSize().Height();
const long nNormDist = 3 * GetFont().GetFontSize().Height();
// define horizontal and vertical minimal distances that separate
// the elements
@@ -2606,7 +2606,7 @@ SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken)
void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, sal_uLong nWidth)
{
// Since there is no function to do this, we try to approximate it:
Size aFntSize (GetFont().GetSize());
Size aFntSize (GetFont().GetFontSize());
//! however the result is a bit better with 'nWidth' as initial font width
aFntSize.Width() = nWidth;
@@ -2629,7 +2629,7 @@ void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, sal_uLong nWidth)
void SmMathSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight)
{
GetFont().FreezeBorderWidth();
Size aFntSize (GetFont().GetSize());
Size aFntSize (GetFont().GetFontSize());
// Since we only want to scale the height, we might have
// to determine the font width in order to keep it
@@ -2637,7 +2637,7 @@ void SmMathSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight)
{
rDev.Push(PushFlags::FONT | PushFlags::MAPMODE);
rDev.SetFont(GetFont());
aFntSize.Width() = rDev.GetFontMetric().GetSize().Width();
aFntSize.Width() = rDev.GetFontMetric().GetFontSize().Width();
rDev.Pop();
}
OSL_ENSURE(aFntSize.Width() != 0, "Sm: ");
@@ -2668,7 +2668,7 @@ void SmMathSymbolNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocSh
GetFont() = rFormat.GetFont(GetFontDesc());
// use same font size as is used for variables
GetFont().SetSize( rFormat.GetFont( FNT_VARIABLE ).GetSize() );
GetFont().SetSize( rFormat.GetFont( FNT_VARIABLE ).GetFontSize() );
OSL_ENSURE(GetFont().GetCharSet() == RTL_TEXTENCODING_SYMBOL ||
GetFont().GetCharSet() == RTL_TEXTENCODING_UNICODE,
@@ -2866,7 +2866,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
GetFont() = rFormat.GetFont(FNT_VARIABLE);
}
// use same font size as is used for variables
GetFont().SetSize( rFormat.GetFont( FNT_VARIABLE ).GetSize() );
GetFont().SetSize( rFormat.GetFont( FNT_VARIABLE ).GetFontSize() );
// Actually only WEIGHT_NORMAL and WEIGHT_BOLD should occur... However, the sms-file also
// contains e.g. 'WEIGHT_ULTRALIGHT'. Consequently, compare here with '>' instead of '!='.
@@ -3016,7 +3016,7 @@ void SmBlankNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
// make distance depend on the font height
// (so that it increases when scaling (e.g. size *2 {a ~ b})
long nDist = GetFont().GetSize().Height() / 10L,
long nDist = GetFont().GetFontSize().Height() / 10L,
nSpace = nNum * nDist;
// get a SmRect with Baseline and all the bells and whistles
+4 -4
View File
@@ -135,7 +135,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat,
const FontMetric aFM (rDev.GetFontMetric());
bool bIsMath = aFM.GetFamilyName().equalsIgnoreAsciiCase( FONTNAME_MATH );
bool bAllowSmaller = bIsMath && !SmIsMathAlpha(rText);
const long nFontHeight = rDev.GetFont().GetSize().Height();
const long nFontHeight = rDev.GetFont().GetFontSize().Height();
nBorderWidth = nBorder;
bHasAlignInfo = true;
@@ -185,7 +185,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat,
long nDist = 0;
if (pFormat)
nDist = (rDev.GetFont().GetSize().Height()
nDist = (rDev.GetFont().GetFontSize().Height()
* pFormat->GetDistance(DIS_ORNAMENTSIZE)) / 100L;
nHiAttrFence = aGlyphRect.TopLeft().Y() - 1 - nBorderWidth - nDist;
@@ -620,14 +620,14 @@ bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev,
// use scale factor when calling GetTextBoundRect to counter
// negative effects from antialiasing which may otherwise result
// in significant incorrect bounding rectangles for some characters.
Size aFntSize = aFnt.GetSize();
Size aFntSize = aFnt.GetFontSize();
// Workaround to avoid HUGE font sizes and resulting problems
long nScaleFactor = 1;
while( aFntSize.Height() > 2000 * nScaleFactor )
nScaleFactor *= 2;
aFnt.SetSize( Size( aFntSize.Width() / nScaleFactor, aFntSize.Height() / nScaleFactor ) );
aFnt.SetFontSize( Size( aFntSize.Width() / nScaleFactor, aFntSize.Height() / nScaleFactor ) );
pGlyphDev->SetFont(aFnt);
long nTextWidth = rDev.GetTextWidth(rText);
+1 -1
View File
@@ -458,7 +458,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
{
const SmFace rOld = aFormat.GetFont((*ppEntries)->mnMemberId);
SmFace aSet( sFontName, rOld.GetSize() );
SmFace aSet( sFontName, rOld.GetFontSize() );
aSet.SetBorderWidth( rOld.GetBorderWidth() );
aSet.SetAlignment( ALIGN_BASELINE );
aFormat.SetFont( (*ppEntries)->mnMemberId, aSet );
+3 -3
View File
@@ -233,7 +233,7 @@ bool IsBold( const vcl::Font &rFont )
void SmFace::Impl_Init()
{
SetSize( GetSize() );
SetSize( GetFontSize() );
SetTransparent( true );
SetAlignment( ALIGN_BASELINE );
SetColor( COL_AUTO );
@@ -254,7 +254,7 @@ void SmFace::SetSize(const Size& rSize)
//! bodies (eg stack{...} with many entries).
//! Of course this is holds only if characters are used and not polygons.
Font::SetSize(aSize);
Font::SetFontSize(aSize);
}
@@ -278,7 +278,7 @@ SmFace & operator *= (SmFace &rFace, const Fraction &rFrac)
// scales the width and height of 'rFace' by 'rFrac' and returns a
// reference to 'rFace'.
// It's main use is to make scaling fonts look easier.
{ const Size &rFaceSize = rFace.GetSize();
{ const Size &rFaceSize = rFace.GetFontSize();
rFace.SetSize(Size(Fraction(rFaceSize.Width()) *= rFrac,
Fraction(rFaceSize.Height()) *= rFrac));
+4 -4
View File
@@ -1149,14 +1149,14 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
aFont.SetAlignment(ALIGN_TOP);
aFont.SetWeight(WEIGHT_BOLD);
aFont.SetSize(aSize650);
aFont.SetFontSize(aSize650);
aFont.SetColor( Color(COL_BLACK) );
rOutDev.SetFont(aFont);
Size aTitleSize (GetTextSize(rOutDev, GetDoc()->GetTitle(), aOutRect.GetWidth() - 200));
aFont.SetWeight(WEIGHT_NORMAL);
aFont.SetSize(aSize600);
aFont.SetFontSize(aSize600);
rOutDev.SetFont(aFont);
Size aDescSize (GetTextSize(rOutDev, GetDoc()->GetComment(), aOutRect.GetWidth() - 200));
@@ -1168,7 +1168,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
// output title
aFont.SetWeight(WEIGHT_BOLD);
aFont.SetSize(aSize650);
aFont.SetFontSize(aSize650);
rOutDev.SetFont(aFont);
Point aPoint(aOutRect.Left() + (aOutRect.GetWidth() - aTitleSize.Width()) / 2,
aOutRect.Top());
@@ -1178,7 +1178,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
// output description
aFont.SetWeight(WEIGHT_NORMAL);
aFont.SetSize(aSize600);
aFont.SetFontSize(aSize600);
rOutDev.SetFont(aFont);
aPoint.X() = aOutRect.Left() + (aOutRect.GetWidth() - aDescSize.Width()) / 2;
aPoint.Y() = aOutRect.Top();
+2 -2
View File
@@ -301,10 +301,10 @@ DayOfWeek Calendar::ImplGetWeekStart() const
void Calendar::ImplGetWeekFont( vcl::Font& rFont ) const
{
// weeknumber is displayed in WEEKNUMBER_HEIGHT%-Fontheight
Size aFontSize = rFont.GetSize();
Size aFontSize = rFont.GetFontSize();
aFontSize.Height() *= WEEKNUMBER_HEIGHT;
aFontSize.Height() /= 100;
rFont.SetSize( aFontSize );
rFont.SetFontSize( aFontSize );
rFont.SetWeight( WEIGHT_NORMAL );
}

Some files were not shown because too many files have changed in this diff Show More