1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
21 #define INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
23 #include <vcl/dllapi.h>
24 #include <tools/ref.hxx>
25 #include "fontattributes.hxx"
30 class ImplFontMetricData
;
31 typedef tools::SvRef
<ImplFontMetricData
> ImplFontMetricDataRef
;
34 class FontSelectPattern
;
36 class VCL_DLLPUBLIC ImplFontMetricData
: public FontAttributes
, public SvRefBase
39 explicit ImplFontMetricData( const FontSelectPattern
& );
41 // font instance attributes from the font request
42 long GetWidth() const { return mnWidth
; }
43 short GetOrientation() const { return mnOrientation
; }
45 void SetWidth(long nWidth
) { mnWidth
=nWidth
; }
46 void SetOrientation(short nOrientation
) { mnOrientation
=nOrientation
; }
48 // font metrics measured for the font instance
49 long GetAscent() const { return mnAscent
; }
50 long GetDescent() const { return mnDescent
; }
51 long GetInternalLeading() const { return mnIntLeading
; }
52 long GetExternalLeading() const { return mnExtLeading
; }
53 int GetSlant() const { return mnSlant
; }
54 long GetMinKashida() const { return mnMinKashida
; }
56 void SetSlant(int nSlant
) { mnSlant
=nSlant
; }
57 void SetMinKashida( long nMinKashida
) { mnMinKashida
=nMinKashida
; }
59 // font attributes queried from the font instance
60 bool IsFullstopCentered() const { return mbFullstopCentered
; }
61 long GetBulletOffset() const { return mnBulletOffset
; }
63 void SetFullstopCenteredFlag(bool bFullstopCentered
) { mbFullstopCentered
= bFullstopCentered
; }
65 // font metrics that are usually derived from the measurements
66 long GetUnderlineSize() const { return mnUnderlineSize
; }
67 long GetUnderlineOffset() const { return mnUnderlineOffset
; }
68 long GetBoldUnderlineSize() const { return mnBUnderlineSize
; }
69 long GetBoldUnderlineOffset() const { return mnBUnderlineOffset
; }
70 long GetDoubleUnderlineSize() const { return mnDUnderlineSize
; }
71 long GetDoubleUnderlineOffset1() const { return mnDUnderlineOffset1
; }
72 long GetDoubleUnderlineOffset2() const { return mnDUnderlineOffset2
; }
73 long GetWavelineUnderlineSize() const { return mnWUnderlineSize
; }
74 long GetWavelineUnderlineOffset() const { return mnWUnderlineOffset
; }
75 long GetAboveUnderlineSize() const { return mnAboveUnderlineSize
; }
76 long GetAboveUnderlineOffset() const { return mnAboveUnderlineOffset
; }
77 long GetAboveBoldUnderlineSize() const { return mnAboveBUnderlineSize
; }
78 long GetAboveBoldUnderlineOffset() const { return mnAboveBUnderlineOffset
; }
79 long GetAboveDoubleUnderlineSize() const { return mnAboveDUnderlineSize
; }
80 long GetAboveDoubleUnderlineOffset1() const { return mnAboveDUnderlineOffset1
; }
81 long GetAboveDoubleUnderlineOffset2() const { return mnAboveDUnderlineOffset2
; }
82 long GetAboveWavelineUnderlineSize() const { return mnAboveWUnderlineSize
; }
83 long GetAboveWavelineUnderlineOffset() const { return mnAboveWUnderlineOffset
; }
84 long GetStrikeoutSize() const { return mnStrikeoutSize
; }
85 long GetStrikeoutOffset() const { return mnStrikeoutOffset
; }
86 long GetBoldStrikeoutSize() const { return mnBStrikeoutSize
; }
87 long GetBoldStrikeoutOffset() const { return mnBStrikeoutOffset
; }
88 long GetDoubleStrikeoutSize() const { return mnDStrikeoutSize
; }
89 long GetDoubleStrikeoutOffset1() const { return mnDStrikeoutOffset1
; }
90 long GetDoubleStrikeoutOffset2() const { return mnDStrikeoutOffset2
; }
92 void ImplInitTextLineSize( const OutputDevice
* pDev
);
93 void ImplInitAboveTextLineSize();
94 void ImplInitFlags( const OutputDevice
* pDev
);
95 void ImplCalcLineSpacing(const std::vector
<uint8_t>& rHhea
,
96 const std::vector
<uint8_t>& rOS_2
,
100 bool ShouldUseWinMetrics(vcl::TTGlobalFontInfo
& rInfo
);
102 // font instance attributes from the font request
103 long mnHeight
; // Font size
104 long mnWidth
; // Reference Width
105 short mnOrientation
; // Rotation in 1/10 degrees
107 // font metrics measured for the font instance
108 long mnAscent
; // Ascent
109 long mnDescent
; // Descent
110 long mnIntLeading
; // Internal Leading
111 long mnExtLeading
; // External Leading
112 int mnSlant
; // Slant (Italic/Oblique)
113 long mnMinKashida
; // Minimal width of kashida (Arabic)
115 // font attributes queried from the font instance
116 bool mbFullstopCentered
;
117 long mnBulletOffset
; // Offset to position non-print character
119 // font metrics that are usually derived from the measurements
120 long mnUnderlineSize
; // Lineheight of Underline
121 long mnUnderlineOffset
; // Offset from Underline to Baseline
122 long mnBUnderlineSize
; // Height of bold underline
123 long mnBUnderlineOffset
; // Offset from bold underline to baseline
124 long mnDUnderlineSize
; // Height of double underline
125 long mnDUnderlineOffset1
; // Offset from double underline to baseline
126 long mnDUnderlineOffset2
; // Offset from double underline to baseline
127 long mnWUnderlineSize
; // Height of WaveLine underline
128 long mnWUnderlineOffset
; // Offset from WaveLine underline to baseline, but centrered to WaveLine
129 long mnAboveUnderlineSize
; // Height of single underline (for Vertical Right)
130 long mnAboveUnderlineOffset
; // Offset from single underline to baseline (for Vertical Right)
131 long mnAboveBUnderlineSize
; // Height of bold underline (for Vertical Right)
132 long mnAboveBUnderlineOffset
; // Offset from bold underline to baseline (for Vertical Right)
133 long mnAboveDUnderlineSize
; // Height of double underline (for Vertical Right)
134 long mnAboveDUnderlineOffset1
; // Offset from double underline to baseline (for Vertical Right)
135 long mnAboveDUnderlineOffset2
; // Offset from double underline to baseline (for Vertical Right)
136 long mnAboveWUnderlineSize
; // Height of WaveLine-strike-out (for Vertical Right)
137 long mnAboveWUnderlineOffset
; // Offset from WaveLine-strike-out to baseline, but centrered to the WaveLine (for Vertical Right)
138 long mnStrikeoutSize
; // Height of single strike-out
139 long mnStrikeoutOffset
; // Offset from single strike-out to baseline
140 long mnBStrikeoutSize
; // Height of bold strike-out
141 long mnBStrikeoutOffset
; // Offset of bold strike-out to baseline
142 long mnDStrikeoutSize
; // Height of double strike-out
143 long mnDStrikeoutOffset1
; // Offset of double strike-out to baseline
144 long mnDStrikeoutOffset2
; // Offset of double strike-out to baseline
148 #endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */