LibreOffice Module vcl (master) 1
FontMetricData.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
31class FontMetricData;
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 double GetMinKashida() const { return mnMinKashida; }
60 tools::Long GetHangingBaseline() const { return mnHangingBaseline; }
61
62 void SetSlant(int nSlant) { mnSlant=nSlant; }
63 void SetMinKashida(double 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 ShouldNotUseUnderlineMetrics() const;
106 bool ImplInitTextLineSizeHarfBuzz(LogicalFontInstance *pFontInstance);
107 bool ShouldUseWinMetrics(int, int, int, int, int, int) const;
108
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
113
114 // font metrics measured for the font instance
117 tools::Long mnIntLeading; // Internal Leading
118 tools::Long mnExtLeading; // External Leading
119 int mnSlant; // Slant (Italic/Oblique)
120 double mnMinKashida; // Minimal width of kashida (Arabic)
121 tools::Long mnHangingBaseline; // Offset of hanging baseline to Romn baseline
122
123 // font attributes queried from the font instance
125 tools::Long mnBulletOffset; // Offset to position non-print character
126
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
153
154};
155
156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::SvRef< FontMetricData > FontMetricDataRef
double GetMinKashida() const
tools::Long GetUnderlineOffset() const
tools::Long mnDUnderlineSize
tools::Long mnAboveUnderlineSize
tools::Long GetDoubleUnderlineSize() const
tools::Long GetExternalLeading() const
tools::Long mnUnderlineSize
tools::Long GetDescent() const
tools::Long GetBoldUnderlineOffset() const
tools::Long GetWavelineUnderlineSize() const
tools::Long mnAboveDUnderlineSize
tools::Long mnStrikeoutSize
void SetSlant(int nSlant)
void SetOrientation(Degree10 nOrientation)
tools::Long GetStrikeoutSize() const
tools::Long GetDoubleStrikeoutOffset2() const
void SetMinKashida(double nMinKashida)
tools::Long mnWUnderlineSize
tools::Long GetBoldUnderlineSize() const
tools::Long mnBUnderlineOffset
tools::Long mnAboveUnderlineOffset
tools::Long mnAboveBUnderlineOffset
tools::Long mnAboveDUnderlineOffset2
tools::Long mnDStrikeoutOffset1
tools::Long GetAboveWavelineUnderlineSize() const
tools::Long GetStrikeoutOffset() const
void SetFullstopCenteredFlag(bool bFullstopCentered)
tools::Long GetUnderlineSize() const
tools::Long GetAboveBoldUnderlineOffset() const
tools::Long mnBulletOffset
tools::Long GetInternalLeading() const
tools::Long mnAboveWUnderlineSize
tools::Long GetAboveBoldUnderlineSize() const
tools::Long GetAboveDoubleUnderlineSize() const
tools::Long mnBStrikeoutSize
tools::Long mnDStrikeoutSize
tools::Long GetBoldStrikeoutOffset() const
tools::Long mnBUnderlineSize
tools::Long GetAboveDoubleUnderlineOffset1() const
tools::Long mnIntLeading
tools::Long GetAboveDoubleUnderlineOffset2() const
tools::Long mnAboveWUnderlineOffset
tools::Long mnExtLeading
tools::Long mnWUnderlineOffset
int GetSlant() const
Degree10 GetOrientation() const
tools::Long mnWidth
tools::Long mnDStrikeoutOffset2
tools::Long mnDUnderlineOffset1
tools::Long GetAscent() const
tools::Long GetWidth() const
tools::Long mnStrikeoutOffset
tools::Long mnAboveDUnderlineOffset1
bool IsFullstopCentered() const
Degree10 mnOrientation
tools::Long mnHeight
tools::Long GetAboveUnderlineOffset() const
tools::Long mnBStrikeoutOffset
tools::Long mnDescent
tools::Long mnHangingBaseline
void SetWidth(tools::Long nWidth)
tools::Long GetAboveWavelineUnderlineOffset() const
tools::Long GetWavelineUnderlineOffset() const
tools::Long GetDoubleStrikeoutSize() const
tools::Long mnUnderlineOffset
tools::Long GetDoubleStrikeoutOffset1() const
tools::Long GetDoubleUnderlineOffset1() const
tools::Long GetAboveUnderlineSize() const
tools::Long GetBoldStrikeoutSize() const
tools::Long GetHangingBaseline() const
tools::Long mnAboveBUnderlineSize
tools::Long mnAscent
tools::Long GetDoubleUnderlineOffset2() const
tools::Long mnDUnderlineOffset2
tools::Long GetBulletOffset() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
long Long
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
double mnWidth