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