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 #include "sft.hxx"
29 
30 #include <vector>
31 
34 
35 class OutputDevice;
36 namespace vcl::font
37 {
38 class FontSelectPattern;
39 }
41 
43 {
44 public:
46 
47  // font instance attributes from the font request
48  tools::Long GetWidth() const { return mnWidth; }
49  Degree10 GetOrientation() const { return mnOrientation; }
50 
51  void SetWidth(tools::Long nWidth) { mnWidth=nWidth; }
52  void SetOrientation(Degree10 nOrientation) { mnOrientation=nOrientation; }
53 
54  // font metrics measured for the font instance
55  tools::Long GetAscent() const { return mnAscent; }
56  tools::Long GetDescent() const { return mnDescent; }
57  tools::Long GetInternalLeading() const { return mnIntLeading; }
58  tools::Long GetExternalLeading() const { return mnExtLeading; }
59  int GetSlant() const { return mnSlant; }
60  tools::Long GetMinKashida() const { return mnMinKashida; }
61  tools::Long GetHangingBaseline() const { return mnHangingBaseline; }
62 
63  void SetSlant(int nSlant) { mnSlant=nSlant; }
64  void SetMinKashida( tools::Long nMinKashida ) { mnMinKashida=nMinKashida; }
65 
66  // font attributes queried from the font instance
67  bool IsFullstopCentered() const { return mbFullstopCentered; }
68  tools::Long GetBulletOffset() const { return mnBulletOffset; }
69 
70  void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; }
71 
72  // font metrics that are usually derived from the measurements
73  tools::Long GetUnderlineSize() const { return mnUnderlineSize; }
74  tools::Long GetUnderlineOffset() const { return mnUnderlineOffset; }
75  tools::Long GetBoldUnderlineSize() const { return mnBUnderlineSize; }
76  tools::Long GetBoldUnderlineOffset() const { return mnBUnderlineOffset; }
77  tools::Long GetDoubleUnderlineSize() const { return mnDUnderlineSize; }
78  tools::Long GetDoubleUnderlineOffset1() const { return mnDUnderlineOffset1; }
79  tools::Long GetDoubleUnderlineOffset2() const { return mnDUnderlineOffset2; }
80  tools::Long GetWavelineUnderlineSize() const { return mnWUnderlineSize; }
81  tools::Long GetWavelineUnderlineOffset() const { return mnWUnderlineOffset; }
82  tools::Long GetAboveUnderlineSize() const { return mnAboveUnderlineSize; }
83  tools::Long GetAboveUnderlineOffset() const { return mnAboveUnderlineOffset; }
84  tools::Long GetAboveBoldUnderlineSize() const { return mnAboveBUnderlineSize; }
85  tools::Long GetAboveBoldUnderlineOffset() const { return mnAboveBUnderlineOffset; }
86  tools::Long GetAboveDoubleUnderlineSize() const { return mnAboveDUnderlineSize; }
87  tools::Long GetAboveDoubleUnderlineOffset1() const { return mnAboveDUnderlineOffset1; }
88  tools::Long GetAboveDoubleUnderlineOffset2() const { return mnAboveDUnderlineOffset2; }
89  tools::Long GetAboveWavelineUnderlineSize() const { return mnAboveWUnderlineSize; }
90  tools::Long GetAboveWavelineUnderlineOffset() const { return mnAboveWUnderlineOffset; }
91  tools::Long GetStrikeoutSize() const { return mnStrikeoutSize; }
92  tools::Long GetStrikeoutOffset() const { return mnStrikeoutOffset; }
93  tools::Long GetBoldStrikeoutSize() const { return mnBStrikeoutSize; }
94  tools::Long GetBoldStrikeoutOffset() const { return mnBStrikeoutOffset; }
95  tools::Long GetDoubleStrikeoutSize() const { return mnDStrikeoutSize; }
96  tools::Long GetDoubleStrikeoutOffset1() const { return mnDStrikeoutOffset1; }
97  tools::Long GetDoubleStrikeoutOffset2() const { return mnDStrikeoutOffset2; }
98 
99  void ImplInitTextLineSize( const OutputDevice* pDev );
100  void ImplInitAboveTextLineSize();
101  void ImplInitFlags( const OutputDevice* pDev );
102  void ImplCalcLineSpacing(LogicalFontInstance *pFontInstance);
103  void ImplInitBaselines(LogicalFontInstance *pFontInstance);
104 
105 private:
106  bool ShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo) 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
115  tools::Long mnDescent; // Descent
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 GetAboveBoldUnderlineSize() const
tools::Long GetUnderlineSize() const
tools::Long mnDStrikeoutOffset2
tools::Long mnAboveWUnderlineSize
void SetMinKashida(tools::Long nMinKashida)
tools::Long GetBoldUnderlineOffset() const
tools::Long mnAboveDUnderlineSize
tools::Long GetBoldStrikeoutSize() const
tools::Long GetAboveWavelineUnderlineSize() const
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
tools::Long GetAboveUnderlineOffset() const
long Long
tools::Long GetWavelineUnderlineSize() const
tools::Long mnBUnderlineOffset
tools::Long mnAboveWUnderlineOffset
tools::Long mnDUnderlineOffset1
tools::Long GetStrikeoutOffset() const
tools::Long GetInternalLeading() const
tools::Long mnDStrikeoutOffset1
tools::Long GetAboveDoubleUnderlineOffset1() const
tools::Long mnWUnderlineOffset
tools::Long mnAboveUnderlineSize
tools::Long GetUnderlineOffset() const
tools::Long mnAboveUnderlineOffset
tools::Long GetDescent() const
tools::Long GetHangingBaseline() const
tools::Long mnAboveDUnderlineOffset1
tools::Long GetDoubleStrikeoutOffset1() const
tools::Long GetAscent() const
tools::Long GetBulletOffset() const
void SetWidth(tools::Long nWidth)
tools::Long GetBoldStrikeoutOffset() const
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:175
tools::Long mnAboveBUnderlineOffset
tools::Long GetDoubleUnderlineSize() const
tools::Long GetAboveDoubleUnderlineOffset2() const
tools::Long GetDoubleUnderlineOffset2() const
tools::Long mnDUnderlineOffset2
void SetSlant(int nSlant)
tools::Long GetAboveWavelineUnderlineOffset() const
tools::Long GetAboveUnderlineSize() const
tools::Long GetStrikeoutSize() const
tools::Long GetExternalLeading() const
tools::Long GetBoldUnderlineSize() const
tools::Long GetMinKashida() const
tools::Long mnAboveDUnderlineOffset2
tools::Long GetAboveDoubleUnderlineSize() const
bool IsFullstopCentered() const
Degree10 GetOrientation() const
Sun Font Tools.
double mnWidth
tools::Long GetWidth() const
void SetOrientation(Degree10 nOrientation)
tools::Long GetDoubleStrikeoutSize() const
tools::Long mnAboveBUnderlineSize
tools::Long mnBStrikeoutOffset
tools::Long GetWavelineUnderlineOffset() const
tools::Long GetAboveBoldUnderlineOffset() const
tools::SvRef< ImplFontMetricData > ImplFontMetricDataRef
tools::Long GetDoubleStrikeoutOffset2() const
tools::Long GetDoubleUnderlineOffset1() const
Return value of GetTTGlobalFontInfo()
Definition: sft.hxx:147
void SetFullstopCenteredFlag(bool bFullstopCentered)