2 * Copyright (c) 2007-2009 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
26 namespace DirectWrite
\r
29 /// Contains the metrics associated with text after layout. All coordinates are in device independent pixels (DIPs).
\r
31 public value class TextMetrics
\r
34 TextMetrics ( float left, float top, float width, float widthIncludingTrailingWhitespace,
\r
35 float height, float layoutWidth, float layoutHeight, int maximumBidiReorderingDepth, int lineCount )
\r
40 WidthIncludingTrailingWhitespace = widthIncludingTrailingWhitespace;
\r
42 LayoutWidth = layoutWidth;
\r
43 LayoutHeight = layoutHeight;
\r
44 MaximumBidiReorderingDepth = maximumBidiReorderingDepth;
\r
45 LineCount = lineCount;
\r
49 /// A value that indicates the left-most point of formatted text
\r
50 /// relative to the layout box, while excluding any glyph overhang.
\r
52 property float Left;
\r
55 /// A value that indicates the top-most point of formatted text
\r
56 /// relative to the layout box, while excluding any glyph overhang.
\r
61 /// A value that indicates the width of the formatted text, while
\r
62 /// ignoring trailing whitespace at the end of each line.
\r
64 property float Width;
\r
67 /// The width of the formatted text, taking into account the
\r
68 /// trailing whitespace at the end of each line.
\r
70 property float WidthIncludingTrailingWhitespace;
\r
73 /// The height of the formatted text. The height of an empty string
\r
74 /// is set to the same value as that of the default font.
\r
76 property float Height;
\r
79 /// The initial width given to the layout. It can be either larger
\r
80 /// or smaller than the text content width, depending on whether
\r
81 /// the text was wrapped.
\r
83 property float LayoutWidth;
\r
86 /// Initial height given to the layout. Depending on the length of
\r
87 /// the text, it may be larger or smaller than the text content
\r
90 property float LayoutHeight;
\r
93 /// The maximum reordering count of any line of text, used to
\r
94 /// calculate the most number of hit-testing boxes needed. If the
\r
95 /// layout has no bidirectional text, or no text at all, the
\r
96 /// minimum level is 1.
\r
98 property int MaximumBidiReorderingDepth;
\r
101 /// Total number of lines.
\r
103 property int LineCount;
\r