diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-12 14:47:34 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-12 05:36:04 +0000 |
commit | b4b0cc2a5eef42434444e51fda4a13fc48183aa0 (patch) | |
tree | 1061efa135f480b37c90879d7c049872d0e738eb /vcl/inc | |
parent | 414c5c5aee8692614e4e5a5f97d11bea157bcaef (diff) |
vcl: resplit FontAttributes from ImplFontMetricData
The change I made in commit 7b974e056df3 ("vcl: merge
ImplFontMetricData with ImplFontAttributes") was... ill-advised. For
starters, there really needs to be this split as FontSelectPattern
needs it, and PhysicalFontFace only requires the font attributes, not
the metric data.
So the merge was unfortunately, in my mind, a failure and I'm manually
backing it out now.
Change-Id: Iac38f0815f984541e2f55099c965376dd88eeb43
Reviewed-on: https://gerrit.libreoffice.org/21380
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/cairotextrender.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/fontattributes.hxx | 144 | ||||
-rw-r--r-- | vcl/inc/fontinstance.hxx | 9 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/impfontmetricdata.hxx | 182 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 5 | ||||
-rw-r--r-- | vcl/inc/salgdi.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/textrender.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/genpspgraphics.h | 3 | ||||
-rw-r--r-- | vcl/inc/unx/glyphcache.hxx | 15 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 3 |
12 files changed, 212 insertions, 164 deletions
diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx index fdd719b0f85c..027d88570104 100644 --- a/vcl/inc/cairotextrender.hxx +++ b/vcl/inc/cairotextrender.hxx @@ -33,6 +33,7 @@ class ImplLayoutArgs; class ServerFontLayout; class PhysicalFontCollection; class PhysicalFontFace; +class ImplFontMetricData; typedef struct _cairo cairo_t; class VCL_DLLPUBLIC CairoFontsCache @@ -89,7 +90,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx index 9ff1b7c34445..63ab8c3d5757 100644 --- a/vcl/inc/fontattributes.hxx +++ b/vcl/inc/fontattributes.hxx @@ -34,9 +34,6 @@ class FontSelectPattern; class FontAttributes { public: - explicit FontAttributes(); - explicit FontAttributes( const FontSelectPattern& ); - // device independent font functions const OUString& GetFamilyName() const { return maFamilyName; } FontFamily GetFamilyType() const { return meFamily; } @@ -97,99 +94,6 @@ public: void SetSubsettableFlag( bool bSubsettable ) { mbSubsettable = bSubsettable; } void SetOrientationFlag( bool bCanRotate ) { mbOrientation = bCanRotate; } - // Font metrics below - - // font instance attributes from the font request - long GetWidth() { return mnWidth; } - short GetOrientation() { return mnOrientation; } - - void SetWidth(long nWidth) { mnWidth=nWidth; } - void SetOrientation(short nOrientation) { mnOrientation=nOrientation; } - - // font metrics measured for the font instance - long GetAscent() { return mnAscent; } - long GetDescent() { return mnDescent; } - long GetInternalLeading() { return mnIntLeading; } - long GetExternalLeading() { return mnExtLeading; } - int GetSlant() { return mnSlant; } - long GetMinKashida() { return mnMinKashida; } - - void SetAscent(long nAscent) { mnAscent=nAscent; } - void SetDescent(long nDescent) { mnDescent=nDescent; } - void SetInternalLeading(long nIntLeading) { mnIntLeading = nIntLeading; } - void SetExternalLeading(long nExtLeading) { mnExtLeading = nExtLeading; } - void SetSlant(int nSlant) { mnSlant=nSlant; } - void SetMinKashida( long nMinKashida ) { mnMinKashida=nMinKashida; } - - // font attributes queried from the font instance - bool IsScalable() { return mbScalableFont; } - bool IsTrueTypeFont() { return mbTrueTypeFont; } - bool IsKernable() { return mbKernableFont; } - bool IsFullstopCentered() { return mbFullstopCentered; } - long GetBulletOffset() { return mnBulletOffset; } - - void SetScalableFlag(bool bScalable) { mbScalableFont = bScalable; } - void SetTrueTypeFlag(bool bTrueTypeFont) { mbTrueTypeFont = bTrueTypeFont; } - void SetKernableFlag(bool bKernable) { mbKernableFont = bKernable; } - void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; } - void SetBulletOffset(long nBulletOffset) { mnBulletOffset = nBulletOffset; } - - // font metrics that are usually derived from the measurements - long GetUnderlineSize() { return mnUnderlineSize; } - long GetUnderlineOffset() { return mnUnderlineOffset; } - long GetBoldUnderlineSize() { return mnBUnderlineSize; } - long GetBoldUnderlineOffset() { return mnBUnderlineOffset; } - long GetDoubleUnderlineSize() { return mnDUnderlineSize; } - long GetDoubleUnderlineOffset1() { return mnDUnderlineOffset1; } - long GetDoubleUnderlineOffset2() { return mnDUnderlineOffset2; } - long GetWavelineUnderlineSize() { return mnWUnderlineSize; } - long GetWavelineUnderlineOffset() { return mnWUnderlineOffset; } - long GetAboveUnderlineSize() { return mnAboveUnderlineSize; } - long GetAboveUnderlineOffset() { return mnAboveUnderlineOffset; } - long GetAboveBoldUnderlineSize() { return mnAboveBUnderlineSize; } - long GetAboveBoldUnderlineOffset() { return mnAboveBUnderlineOffset; } - long GetAboveDoubleUnderlineSize() { return mnAboveDUnderlineSize; } - long GetAboveDoubleUnderlineOffset1() { return mnAboveDUnderlineOffset1; } - long GetAboveDoubleUnderlineOffset2() { return mnAboveDUnderlineOffset2; } - long GetAboveWavelineUnderlineSize() { return mnAboveWUnderlineSize; } - long GetAboveWavelineUnderlineOffset() { return mnAboveWUnderlineOffset; } - long GetStrikeoutSize() { return mnStrikeoutSize; } - long GetStrikeoutOffset() { return mnStrikeoutOffset; } - long GetBoldStrikeoutSize() { return mnBStrikeoutSize; } - long GetBoldStrikeoutOffset() { return mnBStrikeoutOffset; } - long GetDoubleStrikeoutSize() { return mnDStrikeoutSize; } - long GetDoubleStrikeoutOffset1() { return mnDStrikeoutOffset1; } - long GetDoubleStrikeoutOffset2() { return mnDStrikeoutOffset2; } - - void SetUnderlineSize( long nUnderlineSize ) { mnUnderlineSize = nUnderlineSize; } - void SetUnderlineOffset( long nUnderlineOffset ) { mnUnderlineOffset = nUnderlineOffset; } - void SetBoldUnderlineSize( long nBUnderlineSize ) { mnBUnderlineSize = nBUnderlineSize; } - void SetBoldUnderlineOffset( long nBUnderlineOffset ) { mnBUnderlineOffset = nBUnderlineOffset; } - void SetDoubleUnderlineSize( long nDUnderlineSize ) { mnDUnderlineSize = nDUnderlineSize; } - void SetDoubleUnderlineOffset1( long nDUnderlineOffset1 ) { mnDUnderlineOffset1 = nDUnderlineOffset1; } - void SetDoubleUnderlineOffset2( long nDUnderlineOffset2 ) { mnDUnderlineOffset2 = nDUnderlineOffset2; } - void SetWavelineUnderlineSize( long nWUnderlineSize ) { mnWUnderlineSize = nWUnderlineSize; } - void SetWavelineUnderlineOffset( long nWUnderlineOffset ) { mnWUnderlineOffset = nWUnderlineOffset; } - void SetAboveUnderlineSize( long nAboveUnderlineSize ) { mnAboveUnderlineSize = nAboveUnderlineSize; } - void SetAboveUnderlineOffset( long nAboveUnderlineOffset ) { mnAboveUnderlineOffset = nAboveUnderlineOffset; } - void SetAboveBoldUnderlineSize( long nAboveBUnderlineSize ) { mnAboveBUnderlineSize = nAboveBUnderlineSize; } - void SetAboveBoldUnderlineOffset( long nAboveBUnderlineOffset ) { mnAboveBUnderlineOffset = nAboveBUnderlineOffset; } - void SetAboveDoubleUnderlineSize( long nAboveDUnderlineSize ) { mnAboveDUnderlineSize = nAboveDUnderlineSize; } - void SetAboveDoubleUnderlineOffset1( long nAboveDUnderlineOffset1 ) { mnAboveDUnderlineOffset1 = nAboveDUnderlineOffset1; } - void SetAboveDoubleUnderlineOffset2( long nAboveDUnderlineOffset2 ) { mnAboveDUnderlineOffset2 = nAboveDUnderlineOffset2; } - void SetAboveWavelineUnderlineSize( long nAboveWUnderlineSize ) { mnAboveWUnderlineSize = nAboveWUnderlineSize; } - void SetAboveWavelineUnderlineOffset( long nAboveWUnderlineOffset ) { mnAboveWUnderlineOffset = nAboveWUnderlineOffset; } - void SetStrikeoutSize( long nStrikeoutSize ) { mnStrikeoutSize = nStrikeoutSize; } - void SetStrikeoutOffset( long nStrikeoutOffset ) { mnStrikeoutOffset = nStrikeoutOffset; } - void SetBoldStrikeoutSize( long nBStrikeoutSize ) { mnBStrikeoutSize = nBStrikeoutSize; } - void SetBoldStrikeoutOffset( long nBStrikeoutOffset ) { mnBStrikeoutOffset = nBStrikeoutOffset; } - void SetDoubleStrikeoutSize( long nDStrikeoutSize ) { mnDStrikeoutSize = nDStrikeoutSize; } - void SetDoubleStrikeoutOffset1( long nDStrikeoutOffset1 ) { mnDStrikeoutOffset1 = nDStrikeoutOffset1; } - void SetDoubleStrikeoutOffset2( long nDStrikeoutOffset2 ) { mnDStrikeoutOffset2 = nDStrikeoutOffset2; } - - void ImplInitTextLineSize( const OutputDevice* pDev ); - void ImplInitAboveTextLineSize(); - private: // device independent variables OUString maFamilyName; // Font Family Name @@ -209,54 +113,6 @@ private: bool mbSubsettable; // true: a subset of the font can be created bool mbEmbeddable; // true: the font can be embedded - // Font metrics below - - // font instance attributes from the font request - long mnWidth; // Reference Width - short mnOrientation; // Rotation in 1/10 degrees - - // font metrics measured for the font instance - long mnAscent; // Ascent - long mnDescent; // Descent - long mnIntLeading; // Internal Leading - long mnExtLeading; // External Leading - int mnSlant; // Slant (Italic/Oblique) - long mnMinKashida; // Minimal width of kashida (Arabic) - - // font attributes queried from the font instance - bool mbScalableFont; - bool mbTrueTypeFont; - bool mbKernableFont; - bool mbFullstopCentered; - long mnBulletOffset; // Offset to position non-print character - - // font metrics that are usually derived from the measurements - long mnUnderlineSize; // Lineheight of Underline - long mnUnderlineOffset; // Offset from Underline to Baseline - long mnBUnderlineSize; // Height of bold underline - long mnBUnderlineOffset; // Offset from bold underline to baseline - long mnDUnderlineSize; // Height of double underline - long mnDUnderlineOffset1; // Offset from double underline to baseline - long mnDUnderlineOffset2; // Offset from double underline to baseline - long mnWUnderlineSize; // Height of WaveLine underline - long mnWUnderlineOffset; // Offset from WaveLine underline to baseline, but centrered to WaveLine - long mnAboveUnderlineSize; // Height of single underline (for Vertical Right) - long mnAboveUnderlineOffset; // Offset from single underline to baseline (for Vertical Right) - long mnAboveBUnderlineSize; // Height of bold underline (for Vertical Right) - long mnAboveBUnderlineOffset; // Offset from bold underline to baseline (for Vertical Right) - long mnAboveDUnderlineSize; // Height of double underline (for Vertical Right) - long mnAboveDUnderlineOffset1; // Offset from double underline to baseline (for Vertical Right) - long mnAboveDUnderlineOffset2; // Offset from double underline to baseline (for Vertical Right) - long mnAboveWUnderlineSize; // Height of WaveLine-strike-out (for Vertical Right) - long mnAboveWUnderlineOffset; // Offset from WaveLine-strike-out to baseline, but centrered to the WaveLine (for Vertical Right) - long mnStrikeoutSize; // Height of single strike-out - long mnStrikeoutOffset; // Offset from single strike-out to baseline - long mnBStrikeoutSize; // Height of bold strike-out - long mnBStrikeoutOffset; // Offset of bold strike-out to baseline - long mnDStrikeoutSize; // Height of double strike-out - long mnDStrikeoutOffset1; // Offset of double strike-out to baseline - long mnDStrikeoutOffset2; // Offset of double strike-out to baseline - }; #endif // INCLUDED_VCL_INC_FONTATTRIBUTES_HXX diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx index c790a92f1924..54a74d0e3637 100644 --- a/vcl/inc/fontinstance.hxx +++ b/vcl/inc/fontinstance.hxx @@ -25,6 +25,7 @@ #include "fontselect.hxx" #include "fontattributes.hxx" +#include "impfontmetricdata.hxx" #include <unordered_map> @@ -41,16 +42,16 @@ public: public: // TODO: make data members private ImplFontCache * mpFontCache; - FontSelectPattern maFontSelData; // FontSelectionData - FontAttributes maFontAttributes; // Font attributes - const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol + FontSelectPattern maFontSelData; // FontSelectionData + ImplFontMetricData maFontMetric; // Font attributes + const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol long mnLineHeight; sal_uLong mnRefCount; sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont() short mnOwnOrientation; // text angle if lower layers don't rotate text themselves short mnOrientation; // text angle in 3600 system - bool mbInit; // true if maFontAttributes member is valid + bool mbInit; // true if maFontMetric member is valid void AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName ); bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, OUString* pFontName ) const; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index cb04f7b09a7d..e88701d83d77 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -29,6 +29,7 @@ #include "salgdi.hxx" #include "sallayout.hxx" #include "svpcairotextrender.hxx" +#include "impfontmetricdata.hxx" #ifdef IOS #define SvpSalGraphics AquaSalGraphics @@ -121,7 +122,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx new file mode 100644 index 000000000000..2ccee0dc2a57 --- /dev/null +++ b/vcl/inc/impfontmetricdata.hxx @@ -0,0 +1,182 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX +#define INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX + +#include <sal/types.h> +#include <i18nlangtag/lang.h> +#include <unotools/fontdefs.hxx> +#include <vcl/dllapi.h> +#include <vcl/vclenum.hxx> + +#include "fontselect.hxx" +#include "fontattributes.hxx" + +class OutputDevice; +class FontSelectPattern; + +class ImplFontMetricData : public FontAttributes +{ +public: + explicit ImplFontMetricData( const FontSelectPattern& ); + + // font instance attributes from the font request + long GetWidth() { return mnWidth; } + short GetOrientation() { return mnOrientation; } + + void SetWidth(long nWidth) { mnWidth=nWidth; } + void SetOrientation(short nOrientation) { mnOrientation=nOrientation; } + + // font metrics measured for the font instance + long GetAscent() { return mnAscent; } + long GetDescent() { return mnDescent; } + long GetInternalLeading() { return mnIntLeading; } + long GetExternalLeading() { return mnExtLeading; } + int GetSlant() { return mnSlant; } + long GetMinKashida() { return mnMinKashida; } + + void SetAscent(long nAscent) { mnAscent=nAscent; } + void SetDescent(long nDescent) { mnDescent=nDescent; } + void SetInternalLeading(long nIntLeading) { mnIntLeading = nIntLeading; } + void SetExternalLeading(long nExtLeading) { mnExtLeading = nExtLeading; } + void SetSlant(int nSlant) { mnSlant=nSlant; } + void SetMinKashida( long nMinKashida ) { mnMinKashida=nMinKashida; } + + // font attributes queried from the font instance + bool IsScalable() { return mbScalableFont; } + bool IsTrueTypeFont() { return mbTrueTypeFont; } + bool IsKernable() { return mbKernableFont; } + bool IsFullstopCentered() { return mbFullstopCentered; } + long GetBulletOffset() { return mnBulletOffset; } + + void SetScalableFlag(bool bScalable) { mbScalableFont = bScalable; } + void SetTrueTypeFlag(bool bTrueTypeFont) { mbTrueTypeFont = bTrueTypeFont; } + void SetKernableFlag(bool bKernable) { mbKernableFont = bKernable; } + void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; } + void SetBulletOffset(long nBulletOffset) { mnBulletOffset = nBulletOffset; } + + // font metrics that are usually derived from the measurements + long GetUnderlineSize() { return mnUnderlineSize; } + long GetUnderlineOffset() { return mnUnderlineOffset; } + long GetBoldUnderlineSize() { return mnBUnderlineSize; } + long GetBoldUnderlineOffset() { return mnBUnderlineOffset; } + long GetDoubleUnderlineSize() { return mnDUnderlineSize; } + long GetDoubleUnderlineOffset1() { return mnDUnderlineOffset1; } + long GetDoubleUnderlineOffset2() { return mnDUnderlineOffset2; } + long GetWavelineUnderlineSize() { return mnWUnderlineSize; } + long GetWavelineUnderlineOffset() { return mnWUnderlineOffset; } + long GetAboveUnderlineSize() { return mnAboveUnderlineSize; } + long GetAboveUnderlineOffset() { return mnAboveUnderlineOffset; } + long GetAboveBoldUnderlineSize() { return mnAboveBUnderlineSize; } + long GetAboveBoldUnderlineOffset() { return mnAboveBUnderlineOffset; } + long GetAboveDoubleUnderlineSize() { return mnAboveDUnderlineSize; } + long GetAboveDoubleUnderlineOffset1() { return mnAboveDUnderlineOffset1; } + long GetAboveDoubleUnderlineOffset2() { return mnAboveDUnderlineOffset2; } + long GetAboveWavelineUnderlineSize() { return mnAboveWUnderlineSize; } + long GetAboveWavelineUnderlineOffset() { return mnAboveWUnderlineOffset; } + long GetStrikeoutSize() { return mnStrikeoutSize; } + long GetStrikeoutOffset() { return mnStrikeoutOffset; } + long GetBoldStrikeoutSize() { return mnBStrikeoutSize; } + long GetBoldStrikeoutOffset() { return mnBStrikeoutOffset; } + long GetDoubleStrikeoutSize() { return mnDStrikeoutSize; } + long GetDoubleStrikeoutOffset1() { return mnDStrikeoutOffset1; } + long GetDoubleStrikeoutOffset2() { return mnDStrikeoutOffset2; } + + void SetUnderlineSize( long nUnderlineSize ) { mnUnderlineSize = nUnderlineSize; } + void SetUnderlineOffset( long nUnderlineOffset ) { mnUnderlineOffset = nUnderlineOffset; } + void SetBoldUnderlineSize( long nBUnderlineSize ) { mnBUnderlineSize = nBUnderlineSize; } + void SetBoldUnderlineOffset( long nBUnderlineOffset ) { mnBUnderlineOffset = nBUnderlineOffset; } + void SetDoubleUnderlineSize( long nDUnderlineSize ) { mnDUnderlineSize = nDUnderlineSize; } + void SetDoubleUnderlineOffset1( long nDUnderlineOffset1 ) { mnDUnderlineOffset1 = nDUnderlineOffset1; } + void SetDoubleUnderlineOffset2( long nDUnderlineOffset2 ) { mnDUnderlineOffset2 = nDUnderlineOffset2; } + void SetWavelineUnderlineSize( long nWUnderlineSize ) { mnWUnderlineSize = nWUnderlineSize; } + void SetWavelineUnderlineOffset( long nWUnderlineOffset ) { mnWUnderlineOffset = nWUnderlineOffset; } + void SetAboveUnderlineSize( long nAboveUnderlineSize ) { mnAboveUnderlineSize = nAboveUnderlineSize; } + void SetAboveUnderlineOffset( long nAboveUnderlineOffset ) { mnAboveUnderlineOffset = nAboveUnderlineOffset; } + void SetAboveBoldUnderlineSize( long nAboveBUnderlineSize ) { mnAboveBUnderlineSize = nAboveBUnderlineSize; } + void SetAboveBoldUnderlineOffset( long nAboveBUnderlineOffset ) { mnAboveBUnderlineOffset = nAboveBUnderlineOffset; } + void SetAboveDoubleUnderlineSize( long nAboveDUnderlineSize ) { mnAboveDUnderlineSize = nAboveDUnderlineSize; } + void SetAboveDoubleUnderlineOffset1( long nAboveDUnderlineOffset1 ) { mnAboveDUnderlineOffset1 = nAboveDUnderlineOffset1; } + void SetAboveDoubleUnderlineOffset2( long nAboveDUnderlineOffset2 ) { mnAboveDUnderlineOffset2 = nAboveDUnderlineOffset2; } + void SetAboveWavelineUnderlineSize( long nAboveWUnderlineSize ) { mnAboveWUnderlineSize = nAboveWUnderlineSize; } + void SetAboveWavelineUnderlineOffset( long nAboveWUnderlineOffset ) { mnAboveWUnderlineOffset = nAboveWUnderlineOffset; } + void SetStrikeoutSize( long nStrikeoutSize ) { mnStrikeoutSize = nStrikeoutSize; } + void SetStrikeoutOffset( long nStrikeoutOffset ) { mnStrikeoutOffset = nStrikeoutOffset; } + void SetBoldStrikeoutSize( long nBStrikeoutSize ) { mnBStrikeoutSize = nBStrikeoutSize; } + void SetBoldStrikeoutOffset( long nBStrikeoutOffset ) { mnBStrikeoutOffset = nBStrikeoutOffset; } + void SetDoubleStrikeoutSize( long nDStrikeoutSize ) { mnDStrikeoutSize = nDStrikeoutSize; } + void SetDoubleStrikeoutOffset1( long nDStrikeoutOffset1 ) { mnDStrikeoutOffset1 = nDStrikeoutOffset1; } + void SetDoubleStrikeoutOffset2( long nDStrikeoutOffset2 ) { mnDStrikeoutOffset2 = nDStrikeoutOffset2; } + + void ImplInitTextLineSize( const OutputDevice* pDev ); + void ImplInitAboveTextLineSize(); + +private: + // font instance attributes from the font request + long mnWidth; // Reference Width + short mnOrientation; // Rotation in 1/10 degrees + + // font metrics measured for the font instance + long mnAscent; // Ascent + long mnDescent; // Descent + long mnIntLeading; // Internal Leading + long mnExtLeading; // External Leading + int mnSlant; // Slant (Italic/Oblique) + long mnMinKashida; // Minimal width of kashida (Arabic) + + // font attributes queried from the font instance + bool mbScalableFont; + bool mbTrueTypeFont; + bool mbKernableFont; + bool mbFullstopCentered; + long mnBulletOffset; // Offset to position non-print character + + // font metrics that are usually derived from the measurements + long mnUnderlineSize; // Lineheight of Underline + long mnUnderlineOffset; // Offset from Underline to Baseline + long mnBUnderlineSize; // Height of bold underline + long mnBUnderlineOffset; // Offset from bold underline to baseline + long mnDUnderlineSize; // Height of double underline + long mnDUnderlineOffset1; // Offset from double underline to baseline + long mnDUnderlineOffset2; // Offset from double underline to baseline + long mnWUnderlineSize; // Height of WaveLine underline + long mnWUnderlineOffset; // Offset from WaveLine underline to baseline, but centrered to WaveLine + long mnAboveUnderlineSize; // Height of single underline (for Vertical Right) + long mnAboveUnderlineOffset; // Offset from single underline to baseline (for Vertical Right) + long mnAboveBUnderlineSize; // Height of bold underline (for Vertical Right) + long mnAboveBUnderlineOffset; // Offset from bold underline to baseline (for Vertical Right) + long mnAboveDUnderlineSize; // Height of double underline (for Vertical Right) + long mnAboveDUnderlineOffset1; // Offset from double underline to baseline (for Vertical Right) + long mnAboveDUnderlineOffset2; // Offset from double underline to baseline (for Vertical Right) + long mnAboveWUnderlineSize; // Height of WaveLine-strike-out (for Vertical Right) + long mnAboveWUnderlineOffset; // Offset from WaveLine-strike-out to baseline, but centrered to the WaveLine (for Vertical Right) + long mnStrikeoutSize; // Height of single strike-out + long mnStrikeoutOffset; // Offset from single strike-out to baseline + long mnBStrikeoutSize; // Height of bold strike-out + long mnBStrikeoutOffset; // Offset of bold strike-out to baseline + long mnDStrikeoutSize; // Height of double strike-out + long mnDStrikeoutOffset1; // Offset of double strike-out to baseline + long mnDStrikeoutOffset2; // Offset of double strike-out to baseline + +}; + +#endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 03ef055d1feb..a9628459edf6 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -39,6 +39,7 @@ #include <vcl/metric.hxx> #include "fontinstance.hxx" +#include "impfontmetricdata.hxx" #include "PhysicalFontFace.hxx" #include "salgdi.hxx" @@ -94,7 +95,7 @@ public: SalLayout* GetTextLayout( void ) const; - void GetFontAttributes( FontAttributes& ) const; + void GetFontMetric( ImplFontMetricData& ) const; bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const; bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const; @@ -338,7 +339,7 @@ public: // set the font virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; // get the current font's metrics - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override; // get the repertoire of the current font virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 039e45f07fc9..ca2251f19be3 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -29,6 +29,8 @@ #include <vcl/salnativewidgets.hxx> #include <vcl/metric.hxx> +#include "impfontmetricdata.hxx" + #include "salgdiimpl.hxx" #include "salglyphid.hxx" #include "sallayout.hxx" @@ -145,7 +147,7 @@ public: void ReleaseFonts() { SetFont( nullptr, 0 ); } // get the current font's metrics - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel = 0 ) = 0; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0; // get the repertoire of the current font virtual const FontCharMapPtr GetFontCharMap() const = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 11a38cbae896..2c0bf7fc9406 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -31,6 +31,7 @@ #include <config_cairo_canvas.h> class ImplLayoutArgs; +class ImplFontMetricData; class ServerFontLayout; class PhysicalFontCollection; class PhysicalFontFace; @@ -42,7 +43,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) = 0; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) = 0; - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) = 0; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) = 0; virtual const FontCharMapPtr GetFontCharMap() const = 0; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0; virtual void GetDevFontList( PhysicalFontCollection* ) = 0; diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index 860f15bd794b..850270cb3e13 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -37,6 +37,7 @@ class ServerFont; class FontAttributes; class SalInfoPrinter; class GlyphCache; +class ImplFontMetricData; class VCL_DLLPUBLIC GenPspGraphics : public SalGraphics { @@ -92,7 +93,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index da8f29c57608..463c2592e811 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -35,6 +35,7 @@ #include <fontinstance.hxx> #include <sallayout.hxx> #include "fontattributes.hxx" +#include "impfontmetricdata.hxx" #include <unordered_map> @@ -127,18 +128,18 @@ class GlyphData public: GlyphData() : mnLruValue(0) {} - const GlyphMetric& GetMetric() const { return maFontAttributes; } + const GlyphMetric& GetMetric() const { return maGlyphMetric; } - void SetSize( const Size& s) { maFontAttributes.SetSize( s ); } - void SetOffset( int nX, int nY ) { maFontAttributes.SetOffset( nX, nY ); } - void SetDelta( int nX, int nY ) { maFontAttributes.SetDelta( nX, nY ); } - void SetCharWidth( long nW ) { maFontAttributes.SetCharWidth( nW ); } + void SetSize( const Size& s) { maGlyphMetric.SetSize( s ); } + void SetOffset( int nX, int nY ) { maGlyphMetric.SetOffset( nX, nY ); } + void SetDelta( int nX, int nY ) { maGlyphMetric.SetDelta( nX, nY ); } + void SetCharWidth( long nW ) { maGlyphMetric.SetCharWidth( nW ); } void SetLruValue( int n ) const { mnLruValue = n; } long GetLruValue() const { return mnLruValue;} private: - GlyphMetric maFontAttributes; + GlyphMetric maGlyphMetric; // used by GlyphCache for cache LRU algorithm mutable long mnLruValue; @@ -161,7 +162,7 @@ public: const FontSelectPattern& GetFontSelData() const { return maFontSelData; } - void FetchFontAttributes( FontAttributes&, long& rFactor ) const; + void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const; const unsigned char* GetTable( const char* pName, sal_uLong* pLength ); int GetEmUnits() const { return maFaceFT->units_per_EM;} double GetStretch() { return mfStretch; } diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 68a3bcecfdff..9f5b3819dc0e 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -112,7 +112,7 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override; virtual const FontCharMapPtr GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 83b5f39fb7a4..8b894020fa87 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -46,6 +46,7 @@ class OpenGLTexture; class PhysicalFontCollection; class SalGraphicsImpl; class WinOpenGLSalGraphicsImpl; +class ImplFontMetricData; #define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000) #define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff) @@ -361,7 +362,7 @@ public: // set the font virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel ) override; // get the current font's metrics - virtual void GetFontAttributes( FontAttributes*, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) override; // get the repertoire of the current font virtual const FontCharMapPtr GetFontCharMap() const override; // get the layout capabilities of the current font |