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