LibreOffice Module vcl (master) 1
impfontmetricdata.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sal/config.h>
23
24#include <vcl/dllapi.h>
25#include <tools/long.hxx>
26#include <tools/ref.hxx>
27#include "fontattributes.hxx"
28
29#include <vector>
30
33
34class OutputDevice;
35namespace vcl::font
36{
37class FontSelectPattern;
38}
40
42{
43public:
45
46 // font instance attributes from the font request
47 tools::Long GetWidth() const { return mnWidth; }
48 Degree10 GetOrientation() const { return mnOrientation; }
49
50 void SetWidth(tools::Long nWidth) { mnWidth=nWidth; }
51 void SetOrientation(Degree10 nOrientation) { mnOrientation=nOrientation; }
52
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; }
61
62 void SetSlant(int nSlant) { mnSlant=nSlant; }
63 void SetMinKashida( tools::Long nMinKashida ) { mnMinKashida=nMinKashida; }
64
65 // font attributes queried from the font instance
66 bool IsFullstopCentered() const { return mbFullstopCentered; }
67 tools::Long GetBulletOffset() const { return mnBulletOffset; }
68
69 void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; }
70
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; }
97
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);
103
104private:
105 bool ImplInitTextLineSizeHarfBuzz(LogicalFontInstance *pFontInstance);
106 bool ShouldUseWinMetrics(int, int, int, int, int, int) const;
107
108 // font instance attributes from the font request
109 tools::Long mnHeight; // Font size
110 tools::Long mnWidth; // Reference Width
111 Degree10 mnOrientation; // Rotation in 1/10 degrees
112
113 // font metrics measured for the font instance
116 tools::Long mnIntLeading; // Internal Leading
117 tools::Long mnExtLeading; // External Leading
118 int mnSlant; // Slant (Italic/Oblique)
119 tools::Long mnMinKashida; // Minimal width of kashida (Arabic)
120 tools::Long mnHangingBaseline; // Offset of hanging baseline to Romn baseline
121
122 // font attributes queried from the font instance
124 tools::Long mnBulletOffset; // Offset to position non-print character
125
126 // font metrics that are usually derived from the measurements
127 tools::Long mnUnderlineSize; // Lineheight of Underline
128 tools::Long mnUnderlineOffset; // Offset from Underline to Baseline
129 tools::Long mnBUnderlineSize; // Height of bold underline
130 tools::Long mnBUnderlineOffset; // Offset from bold underline to baseline
131 tools::Long mnDUnderlineSize; // Height of double underline
132 tools::Long mnDUnderlineOffset1; // Offset from double underline to baseline
133 tools::Long mnDUnderlineOffset2; // Offset from double underline to baseline
134 tools::Long mnWUnderlineSize; // Height of WaveLine underline
135 tools::Long mnWUnderlineOffset; // Offset from WaveLine underline to baseline, but centrered to WaveLine
136 tools::Long mnAboveUnderlineSize; // Height of single underline (for Vertical Right)
137 tools::Long mnAboveUnderlineOffset; // Offset from single underline to baseline (for Vertical Right)
138 tools::Long mnAboveBUnderlineSize; // Height of bold underline (for Vertical Right)
139 tools::Long mnAboveBUnderlineOffset; // Offset from bold underline to baseline (for Vertical Right)
140 tools::Long mnAboveDUnderlineSize; // Height of double underline (for Vertical Right)
141 tools::Long mnAboveDUnderlineOffset1; // Offset from double underline to baseline (for Vertical Right)
142 tools::Long mnAboveDUnderlineOffset2; // Offset from double underline to baseline (for Vertical Right)
143 tools::Long mnAboveWUnderlineSize; // Height of WaveLine-strike-out (for Vertical Right)
144 tools::Long mnAboveWUnderlineOffset; // Offset from WaveLine-strike-out to baseline, but centrered to the WaveLine (for Vertical Right)
145 tools::Long mnStrikeoutSize; // Height of single strike-out
146 tools::Long mnStrikeoutOffset; // Offset from single strike-out to baseline
147 tools::Long mnBStrikeoutSize; // Height of bold strike-out
148 tools::Long mnBStrikeoutOffset; // Offset of bold strike-out to baseline
149 tools::Long mnDStrikeoutSize; // Height of double strike-out
150 tools::Long mnDStrikeoutOffset1; // Offset of double strike-out to baseline
151 tools::Long mnDStrikeoutOffset2; // Offset of double strike-out to baseline
152
153};
154
155/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long GetInternalLeading() const
tools::Long GetMinKashida() const
tools::Long mnAboveBUnderlineOffset
tools::Long GetAboveUnderlineOffset() const
tools::Long GetExternalLeading() const
tools::Long GetAboveWavelineUnderlineSize() const
void SetOrientation(Degree10 nOrientation)
tools::Long mnDUnderlineOffset1
tools::Long mnDStrikeoutOffset2
tools::Long GetAboveUnderlineSize() const
tools::Long mnAboveUnderlineSize
tools::Long mnBStrikeoutOffset
tools::Long mnAboveUnderlineOffset
tools::Long mnAboveWUnderlineSize
tools::Long GetAboveDoubleUnderlineSize() const
tools::Long GetAscent() const
tools::Long GetAboveBoldUnderlineOffset() const
tools::Long GetDoubleStrikeoutOffset2() const
tools::Long GetStrikeoutSize() const
tools::Long mnDStrikeoutOffset1
tools::Long GetHangingBaseline() const
tools::Long mnAboveDUnderlineSize
tools::Long GetDoubleUnderlineSize() const
tools::Long mnWUnderlineOffset
void SetWidth(tools::Long nWidth)
tools::Long mnBUnderlineOffset
bool IsFullstopCentered() const
tools::Long GetBoldUnderlineOffset() const
tools::Long GetBoldStrikeoutOffset() const
tools::Long GetBoldStrikeoutSize() const
tools::Long GetAboveDoubleUnderlineOffset2() const
tools::Long GetDoubleUnderlineOffset2() const
void SetMinKashida(tools::Long nMinKashida)
tools::Long mnAboveWUnderlineOffset
void SetSlant(int nSlant)
tools::Long GetWidth() const
void SetFullstopCenteredFlag(bool bFullstopCentered)
tools::Long GetDoubleStrikeoutOffset1() const
tools::Long GetWavelineUnderlineOffset() const
tools::Long mnAboveDUnderlineOffset2
tools::Long GetAboveWavelineUnderlineOffset() const
tools::Long GetAboveBoldUnderlineSize() const
tools::Long mnAboveBUnderlineSize
Degree10 GetOrientation() const
tools::Long GetAboveDoubleUnderlineOffset1() const
tools::Long GetWavelineUnderlineSize() const
tools::Long mnAboveDUnderlineOffset1
tools::Long GetUnderlineOffset() const
tools::Long GetBoldUnderlineSize() const
tools::Long GetDescent() const
tools::Long GetDoubleStrikeoutSize() const
tools::Long mnDUnderlineOffset2
tools::Long GetUnderlineSize() const
tools::Long GetStrikeoutOffset() const
tools::Long GetDoubleUnderlineOffset1() const
tools::Long GetBulletOffset() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
tools::SvRef< ImplFontMetricData > ImplFontMetricDataRef
long Long
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
double mnWidth