1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_rendering_FontMetrics_idl__
28#define __com_sun_star_rendering_FontMetrics_idl__
29
30module com { module sun { module star { module rendering {
31
32/** Metrics global to the font, i.e. not specific to single
33    glyphs. The font height is defined as
34    ascent+descent+internalLeading, and therefore not explicitely
35    included here.<p>
36
37    Please note that when querying FontMetrics from an XCanvasFont
38    interface, all values here are given relative to the font cell
39    size. That means, the referenceCharWidth and/or
40    ascent+descent+internalLeading will approximately (rounded to
41    integer device resolution, or exactly, if fractional font
42    rendering is enabled) match the referenceAdvancement/cellSize
43    members of the FontRequest for which the XCanvasFont was
44    queried. Please be aware that the values returned in this
45    structure only map one-to-one to device pixel, if the combined
46    rendering transformation for text output equals the identity
47    transformation. Otherwise, the text output (and thus the resulting
48    metrics) will be subject to that transformation. Depending on the
49    underlying font technology, actual device output might be off by
50    up to one device pixel from the transformed metrics.
51
52    @since OOo 2.0
53 */
54published struct FontMetrics
55{
56    /// Ascent (above the baseline) part of the font.
57    double		Ascent;
58
59    //-------------------------------------------------------------------------
60
61    /// Descent (below the baseline) part of the font.
62    double		Descent;
63
64    //-------------------------------------------------------------------------
65
66    /// Extra space above ascent
67    double		InternalLeading;
68
69    //-------------------------------------------------------------------------
70
71    /** Extra space outside the font cells.<p>
72
73        It should not contain ink marks and is typically used
74        by the font designer to modify the line distance.<p>
75     */
76    double		ExternalLeading;
77
78    //-------------------------------------------------------------------------
79
80    /** This value specifies the reference character width of the
81        font.<p>
82
83        It's roughly equivalent to the average width of all
84        characters, and if one needs a font with double character
85        width, the referenceCharSize should be doubled.<p>
86     */
87    double          ReferenceCharSize;
88
89    //-------------------------------------------------------------------------
90
91    /** Specifies the offset to be added to the baseline when drawing
92        underlined text.
93     */
94    double          UnderlineOffset;
95
96    //-------------------------------------------------------------------------
97
98    /** Specifies the offset to be added to the baseline when striking
99        through the text.
100     */
101    double		StrikeThroughOffset;
102
103};
104
105}; }; }; };
106
107#endif
108