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