nss: upgrade to release 3.73
[LibreOffice.git] / vcl / inc / impfontmetricdata.hxx
bloba1d5db86bd8ce85e8f2d844c59588f80fcaf5ff3
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/long.hxx>
25 #include <tools/ref.hxx>
26 #include "fontattributes.hxx"
27 #include "sft.hxx"
29 #include <vector>
31 class ImplFontMetricData;
32 typedef tools::SvRef<ImplFontMetricData> ImplFontMetricDataRef;
34 class OutputDevice;
35 class FontSelectPattern;
36 class LogicalFontInstance;
38 class VCL_DLLPUBLIC ImplFontMetricData : public FontAttributes, public SvRefBase
40 public:
41 explicit ImplFontMetricData( const FontSelectPattern& );
43 // font instance attributes from the font request
44 tools::Long GetWidth() const { return mnWidth; }
45 Degree10 GetOrientation() const { return mnOrientation; }
47 void SetWidth(tools::Long nWidth) { mnWidth=nWidth; }
48 void SetOrientation(Degree10 nOrientation) { mnOrientation=nOrientation; }
50 // font metrics measured for the font instance
51 tools::Long GetAscent() const { return mnAscent; }
52 tools::Long GetDescent() const { return mnDescent; }
53 tools::Long GetInternalLeading() const { return mnIntLeading; }
54 tools::Long GetExternalLeading() const { return mnExtLeading; }
55 int GetSlant() const { return mnSlant; }
56 tools::Long GetMinKashida() const { return mnMinKashida; }
58 void SetSlant(int nSlant) { mnSlant=nSlant; }
59 void SetMinKashida( tools::Long nMinKashida ) { mnMinKashida=nMinKashida; }
61 // font attributes queried from the font instance
62 bool IsFullstopCentered() const { return mbFullstopCentered; }
63 tools::Long GetBulletOffset() const { return mnBulletOffset; }
65 void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; }
67 // font metrics that are usually derived from the measurements
68 tools::Long GetUnderlineSize() const { return mnUnderlineSize; }
69 tools::Long GetUnderlineOffset() const { return mnUnderlineOffset; }
70 tools::Long GetBoldUnderlineSize() const { return mnBUnderlineSize; }
71 tools::Long GetBoldUnderlineOffset() const { return mnBUnderlineOffset; }
72 tools::Long GetDoubleUnderlineSize() const { return mnDUnderlineSize; }
73 tools::Long GetDoubleUnderlineOffset1() const { return mnDUnderlineOffset1; }
74 tools::Long GetDoubleUnderlineOffset2() const { return mnDUnderlineOffset2; }
75 tools::Long GetWavelineUnderlineSize() const { return mnWUnderlineSize; }
76 tools::Long GetWavelineUnderlineOffset() const { return mnWUnderlineOffset; }
77 tools::Long GetAboveUnderlineSize() const { return mnAboveUnderlineSize; }
78 tools::Long GetAboveUnderlineOffset() const { return mnAboveUnderlineOffset; }
79 tools::Long GetAboveBoldUnderlineSize() const { return mnAboveBUnderlineSize; }
80 tools::Long GetAboveBoldUnderlineOffset() const { return mnAboveBUnderlineOffset; }
81 tools::Long GetAboveDoubleUnderlineSize() const { return mnAboveDUnderlineSize; }
82 tools::Long GetAboveDoubleUnderlineOffset1() const { return mnAboveDUnderlineOffset1; }
83 tools::Long GetAboveDoubleUnderlineOffset2() const { return mnAboveDUnderlineOffset2; }
84 tools::Long GetAboveWavelineUnderlineSize() const { return mnAboveWUnderlineSize; }
85 tools::Long GetAboveWavelineUnderlineOffset() const { return mnAboveWUnderlineOffset; }
86 tools::Long GetStrikeoutSize() const { return mnStrikeoutSize; }
87 tools::Long GetStrikeoutOffset() const { return mnStrikeoutOffset; }
88 tools::Long GetBoldStrikeoutSize() const { return mnBStrikeoutSize; }
89 tools::Long GetBoldStrikeoutOffset() const { return mnBStrikeoutOffset; }
90 tools::Long GetDoubleStrikeoutSize() const { return mnDStrikeoutSize; }
91 tools::Long GetDoubleStrikeoutOffset1() const { return mnDStrikeoutOffset1; }
92 tools::Long GetDoubleStrikeoutOffset2() const { return mnDStrikeoutOffset2; }
94 void ImplInitTextLineSize( const OutputDevice* pDev );
95 void ImplInitAboveTextLineSize();
96 void ImplInitFlags( const OutputDevice* pDev );
97 void ImplCalcLineSpacing(LogicalFontInstance *pFontInstance);
99 private:
100 bool ShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo);
102 // font instance attributes from the font request
103 tools::Long mnHeight; // Font size
104 tools::Long mnWidth; // Reference Width
105 Degree10 mnOrientation; // Rotation in 1/10 degrees
107 // font metrics measured for the font instance
108 tools::Long mnAscent; // Ascent
109 tools::Long mnDescent; // Descent
110 tools::Long mnIntLeading; // Internal Leading
111 tools::Long mnExtLeading; // External Leading
112 int mnSlant; // Slant (Italic/Oblique)
113 tools::Long mnMinKashida; // Minimal width of kashida (Arabic)
115 // font attributes queried from the font instance
116 bool mbFullstopCentered;
117 tools::Long mnBulletOffset; // Offset to position non-print character
119 // font metrics that are usually derived from the measurements
120 tools::Long mnUnderlineSize; // Lineheight of Underline
121 tools::Long mnUnderlineOffset; // Offset from Underline to Baseline
122 tools::Long mnBUnderlineSize; // Height of bold underline
123 tools::Long mnBUnderlineOffset; // Offset from bold underline to baseline
124 tools::Long mnDUnderlineSize; // Height of double underline
125 tools::Long mnDUnderlineOffset1; // Offset from double underline to baseline
126 tools::Long mnDUnderlineOffset2; // Offset from double underline to baseline
127 tools::Long mnWUnderlineSize; // Height of WaveLine underline
128 tools::Long mnWUnderlineOffset; // Offset from WaveLine underline to baseline, but centrered to WaveLine
129 tools::Long mnAboveUnderlineSize; // Height of single underline (for Vertical Right)
130 tools::Long mnAboveUnderlineOffset; // Offset from single underline to baseline (for Vertical Right)
131 tools::Long mnAboveBUnderlineSize; // Height of bold underline (for Vertical Right)
132 tools::Long mnAboveBUnderlineOffset; // Offset from bold underline to baseline (for Vertical Right)
133 tools::Long mnAboveDUnderlineSize; // Height of double underline (for Vertical Right)
134 tools::Long mnAboveDUnderlineOffset1; // Offset from double underline to baseline (for Vertical Right)
135 tools::Long mnAboveDUnderlineOffset2; // Offset from double underline to baseline (for Vertical Right)
136 tools::Long mnAboveWUnderlineSize; // Height of WaveLine-strike-out (for Vertical Right)
137 tools::Long mnAboveWUnderlineOffset; // Offset from WaveLine-strike-out to baseline, but centrered to the WaveLine (for Vertical Right)
138 tools::Long mnStrikeoutSize; // Height of single strike-out
139 tools::Long mnStrikeoutOffset; // Offset from single strike-out to baseline
140 tools::Long mnBStrikeoutSize; // Height of bold strike-out
141 tools::Long mnBStrikeoutOffset; // Offset of bold strike-out to baseline
142 tools::Long mnDStrikeoutSize; // Height of double strike-out
143 tools::Long mnDStrikeoutOffset1; // Offset of double strike-out to baseline
144 tools::Long mnDStrikeoutOffset2; // Offset of double strike-out to baseline
148 #endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */