bump product version to 6.4.0.3
[LibreOffice.git] / vcl / inc / impfontmetricdata.hxx
blob6250c9155436e6b04d9cb8ec878811d6b6b891ed
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
21 #define INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
23 #include <vcl/dllapi.h>
24 #include <tools/ref.hxx>
25 #include "fontattributes.hxx"
26 #include "sft.hxx"
28 #include <vector>
30 class ImplFontMetricData;
31 typedef tools::SvRef<ImplFontMetricData> ImplFontMetricDataRef;
33 class OutputDevice;
34 class FontSelectPattern;
35 class LogicalFontInstance;
37 class VCL_DLLPUBLIC ImplFontMetricData : public FontAttributes, public SvRefBase
39 public:
40 explicit ImplFontMetricData( const FontSelectPattern& );
42 // font instance attributes from the font request
43 long GetWidth() const { return mnWidth; }
44 short GetOrientation() const { return mnOrientation; }
46 void SetWidth(long nWidth) { mnWidth=nWidth; }
47 void SetOrientation(short nOrientation) { mnOrientation=nOrientation; }
49 // font metrics measured for the font instance
50 long GetAscent() const { return mnAscent; }
51 long GetDescent() const { return mnDescent; }
52 long GetInternalLeading() const { return mnIntLeading; }
53 long GetExternalLeading() const { return mnExtLeading; }
54 int GetSlant() const { return mnSlant; }
55 long GetMinKashida() const { return mnMinKashida; }
57 void SetSlant(int nSlant) { mnSlant=nSlant; }
58 void SetMinKashida( long nMinKashida ) { mnMinKashida=nMinKashida; }
60 // font attributes queried from the font instance
61 bool IsFullstopCentered() const { return mbFullstopCentered; }
62 long GetBulletOffset() const { return mnBulletOffset; }
64 void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; }
66 // font metrics that are usually derived from the measurements
67 long GetUnderlineSize() const { return mnUnderlineSize; }
68 long GetUnderlineOffset() const { return mnUnderlineOffset; }
69 long GetBoldUnderlineSize() const { return mnBUnderlineSize; }
70 long GetBoldUnderlineOffset() const { return mnBUnderlineOffset; }
71 long GetDoubleUnderlineSize() const { return mnDUnderlineSize; }
72 long GetDoubleUnderlineOffset1() const { return mnDUnderlineOffset1; }
73 long GetDoubleUnderlineOffset2() const { return mnDUnderlineOffset2; }
74 long GetWavelineUnderlineSize() const { return mnWUnderlineSize; }
75 long GetWavelineUnderlineOffset() const { return mnWUnderlineOffset; }
76 long GetAboveUnderlineSize() const { return mnAboveUnderlineSize; }
77 long GetAboveUnderlineOffset() const { return mnAboveUnderlineOffset; }
78 long GetAboveBoldUnderlineSize() const { return mnAboveBUnderlineSize; }
79 long GetAboveBoldUnderlineOffset() const { return mnAboveBUnderlineOffset; }
80 long GetAboveDoubleUnderlineSize() const { return mnAboveDUnderlineSize; }
81 long GetAboveDoubleUnderlineOffset1() const { return mnAboveDUnderlineOffset1; }
82 long GetAboveDoubleUnderlineOffset2() const { return mnAboveDUnderlineOffset2; }
83 long GetAboveWavelineUnderlineSize() const { return mnAboveWUnderlineSize; }
84 long GetAboveWavelineUnderlineOffset() const { return mnAboveWUnderlineOffset; }
85 long GetStrikeoutSize() const { return mnStrikeoutSize; }
86 long GetStrikeoutOffset() const { return mnStrikeoutOffset; }
87 long GetBoldStrikeoutSize() const { return mnBStrikeoutSize; }
88 long GetBoldStrikeoutOffset() const { return mnBStrikeoutOffset; }
89 long GetDoubleStrikeoutSize() const { return mnDStrikeoutSize; }
90 long GetDoubleStrikeoutOffset1() const { return mnDStrikeoutOffset1; }
91 long GetDoubleStrikeoutOffset2() const { return mnDStrikeoutOffset2; }
93 void ImplInitTextLineSize( const OutputDevice* pDev );
94 void ImplInitAboveTextLineSize();
95 void ImplInitFlags( const OutputDevice* pDev );
96 void ImplCalcLineSpacing(LogicalFontInstance *pFontInstance);
98 private:
99 bool ShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo);
101 // font instance attributes from the font request
102 long const mnHeight; // Font size
103 long mnWidth; // Reference Width
104 short mnOrientation; // Rotation in 1/10 degrees
106 // font metrics measured for the font instance
107 long mnAscent; // Ascent
108 long mnDescent; // Descent
109 long mnIntLeading; // Internal Leading
110 long mnExtLeading; // External Leading
111 int mnSlant; // Slant (Italic/Oblique)
112 long mnMinKashida; // Minimal width of kashida (Arabic)
114 // font attributes queried from the font instance
115 bool mbFullstopCentered;
116 long mnBulletOffset; // Offset to position non-print character
118 // font metrics that are usually derived from the measurements
119 long mnUnderlineSize; // Lineheight of Underline
120 long mnUnderlineOffset; // Offset from Underline to Baseline
121 long mnBUnderlineSize; // Height of bold underline
122 long mnBUnderlineOffset; // Offset from bold underline to baseline
123 long mnDUnderlineSize; // Height of double underline
124 long mnDUnderlineOffset1; // Offset from double underline to baseline
125 long mnDUnderlineOffset2; // Offset from double underline to baseline
126 long mnWUnderlineSize; // Height of WaveLine underline
127 long mnWUnderlineOffset; // Offset from WaveLine underline to baseline, but centrered to WaveLine
128 long mnAboveUnderlineSize; // Height of single underline (for Vertical Right)
129 long mnAboveUnderlineOffset; // Offset from single underline to baseline (for Vertical Right)
130 long mnAboveBUnderlineSize; // Height of bold underline (for Vertical Right)
131 long mnAboveBUnderlineOffset; // Offset from bold underline to baseline (for Vertical Right)
132 long mnAboveDUnderlineSize; // Height of double underline (for Vertical Right)
133 long mnAboveDUnderlineOffset1; // Offset from double underline to baseline (for Vertical Right)
134 long mnAboveDUnderlineOffset2; // Offset from double underline to baseline (for Vertical Right)
135 long mnAboveWUnderlineSize; // Height of WaveLine-strike-out (for Vertical Right)
136 long mnAboveWUnderlineOffset; // Offset from WaveLine-strike-out to baseline, but centrered to the WaveLine (for Vertical Right)
137 long mnStrikeoutSize; // Height of single strike-out
138 long mnStrikeoutOffset; // Offset from single strike-out to baseline
139 long mnBStrikeoutSize; // Height of bold strike-out
140 long mnBStrikeoutOffset; // Offset of bold strike-out to baseline
141 long mnDStrikeoutSize; // Height of double strike-out
142 long mnDStrikeoutOffset1; // Offset of double strike-out to baseline
143 long mnDStrikeoutOffset2; // Offset of double strike-out to baseline
147 #endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */