1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_rendering_FontMetrics_idl__
24#define __com_sun_star_rendering_FontMetrics_idl__
25
26module com { module sun { module star { module rendering {
27
28/** Metrics global to the font, i.e. not specific to single
29    glyphs. The font height is defined as
30    ascent+descent+internalLeading, and therefore not explicitely
31    included here.<p>
32
33    Please note that when querying FontMetrics from an XCanvasFont
34    interface, all values here are given relative to the font cell
35    size. That means, the referenceCharWidth and/or
36    ascent+descent+internalLeading will approximately (rounded to
37    integer device resolution, or exactly, if fractional font
38    rendering is enabled) match the referenceAdvancement/cellSize
39    members of the FontRequest for which the XCanvasFont was
40    queried. Please be aware that the values returned in this
41    structure only map one-to-one to device pixel, if the combined
42    rendering transformation for text output equals the identity
43    transformation. Otherwise, the text output (and thus the resulting
44    metrics) will be subject to that transformation. Depending on the
45    underlying font technology, actual device output might be off by
46    up to one device pixel from the transformed metrics.
47
48    @since OpenOffice 2.0
49 */
50published struct FontMetrics
51{
52    /// Ascent (above the baseline) part of the font.
53    double		Ascent;
54
55    //-------------------------------------------------------------------------
56
57    /// Descent (below the baseline) part of the font.
58    double		Descent;
59
60    //-------------------------------------------------------------------------
61
62    /// Extra space above ascent
63    double		InternalLeading;
64
65    //-------------------------------------------------------------------------
66
67    /** Extra space outside the font cells.<p>
68
69        It should not contain ink marks and is typically used
70        by the font designer to modify the line distance.<p>
71     */
72    double		ExternalLeading;
73
74    //-------------------------------------------------------------------------
75
76    /** This value specifies the reference character width of the
77        font.<p>
78
79        It's roughly equivalent to the average width of all
80        characters, and if one needs a font with double character
81        width, the referenceCharSize should be doubled.<p>
82     */
83    double          ReferenceCharSize;
84
85    //-------------------------------------------------------------------------
86
87    /** Specifies the offset to be added to the baseline when drawing
88        underlined text.
89     */
90    double          UnderlineOffset;
91
92    //-------------------------------------------------------------------------
93
94    /** Specifies the offset to be added to the baseline when striking
95        through the text.
96     */
97    double		StrikeThroughOffset;
98
99};
100
101}; }; }; };
102
103#endif
104