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 #ifndef INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
21 #define INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
22 
23 #include <vcl/dllapi.h>
24 #include <tools/long.hxx>
25 #include <tools/ref.hxx>
26 #include "fontattributes.hxx"
27 #include "sft.hxx"
28 
29 #include <vector>
30 
33 
34 class OutputDevice;
35 class FontSelectPattern;
37 
39 {
40 public:
41  explicit ImplFontMetricData( const FontSelectPattern& );
42 
43  // font instance attributes from the font request
44  tools::Long GetWidth() const { return mnWidth; }
45  Degree10 GetOrientation() const { return mnOrientation; }
46 
47  void SetWidth(tools::Long nWidth) { mnWidth=nWidth; }
48  void SetOrientation(Degree10 nOrientation) { mnOrientation=nOrientation; }
49 
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; }
57 
58  void SetSlant(int nSlant) { mnSlant=nSlant; }
59  void SetMinKashida( tools::Long nMinKashida ) { mnMinKashida=nMinKashida; }
60 
61  // font attributes queried from the font instance
62  bool IsFullstopCentered() const { return mbFullstopCentered; }
63  tools::Long GetBulletOffset() const { return mnBulletOffset; }
64 
65  void SetFullstopCenteredFlag(bool bFullstopCentered) { mbFullstopCentered = bFullstopCentered; }
66 
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; }
93 
94  void ImplInitTextLineSize( const OutputDevice* pDev );
95  void ImplInitAboveTextLineSize();
96  void ImplInitFlags( const OutputDevice* pDev );
97  void ImplCalcLineSpacing(LogicalFontInstance *pFontInstance);
98 
99 private:
100  bool ShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo);
101 
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
106 
107  // font metrics measured for the font instance
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)
114 
115  // font attributes queried from the font instance
117  tools::Long mnBulletOffset; // Offset to position non-print character
118 
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
145 
146 };
147 
148 #endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
149 
150 /* 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 mnAboveDUnderlineOffset1
tools::Long GetDoubleStrikeoutOffset1() const
tools::Long GetAscent() const
tools::Long GetBulletOffset() const
void SetWidth(tools::Long nWidth)
tools::Long GetBoldStrikeoutOffset() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:303
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)