Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1452 chris 1
#region --- License ---
2
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
3
 * See license.txt for license info
4
 */
5
#endregion
6
 
7
using System;
8
using System.Collections.Generic;
9
using System.Text;
10
using System.Drawing;
11
using OpenTK.Graphics.Text;
12
 
13
namespace OpenTK.Graphics
14
{
15
    /// <summary>
16
    /// Defines the interface for a TextPrinter.
17
    /// </summary>
18
    public interface ITextPrinter : IDisposable
19
    {
20
        #region Print
21
 
22
        /// <summary>
23
        /// Prints text using the specified color and layout options.
24
        /// </summary>
25
        /// <param name="text">The System.String to print.</param>
26
        /// <param name="font">The System.Drawing.Font that will be used to print text.</param>
27
        /// <param name="color">The System.Drawing.Color that will be used to print text.</param>
28
        void Print(string text, Font font, Color color);
29
 
30
        /// <summary>
31
        /// Prints text using the specified color and layout options.
32
        /// </summary>
33
        /// <param name="text">The System.String to print.</param>
34
        /// <param name="font">The System.Drawing.Font that will be used to print text.</param>
35
        /// <param name="color">The System.Drawing.Color that will be used to print text.</param>
36
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
37
        void Print(string text, Font font, Color color, RectangleF rect);
38
 
39
        /// <summary>
40
        /// Prints text using the specified color and layout options.
41
        /// </summary>
42
        /// <param name="text">The System.String to print.</param>
43
        /// <param name="font">The System.Drawing.Font that will be used to print text.</param>
44
        /// <param name="color">The System.Drawing.Color that will be used to print text.</param>
45
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
46
        /// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to print text.</param>
47
        void Print(string text, Font font, Color color, RectangleF rect, TextPrinterOptions options);
48
 
49
        /// <summary>
50
        /// Prints text using the specified color and layout options.
51
        /// </summary>
52
        /// <param name="text">The System.String to print.</param>
53
        /// <param name="font">The System.Drawing.Font that will be used to print text.</param>
54
        /// <param name="color">The System.Drawing.Color that will be used to print text.</param>
55
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
56
        /// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to print text.</param>
57
        /// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to print text.</param>
58
        void Print(string text, Font font, Color color, RectangleF rect, TextPrinterOptions options, TextAlignment alignment);
59
 
60
        /// <summary>
61
        /// Prints text using the specified color and layout options.
62
        /// </summary>
63
        /// <param name="text">The System.String to print.</param>
64
        /// <param name="font">The System.Drawing.Font that will be used to print text.</param>
65
        /// <param name="color">The System.Drawing.Color that will be used to print text.</param>
66
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
67
        /// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to print text.</param>
68
        /// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to print text.</param>
69
        /// <param name="direction">The OpenTK.Graphics.TextDirection that will be used to print text.</param>
70
        void Print(string text, Font font, Color color, RectangleF rect, TextPrinterOptions options, TextAlignment alignment, TextDirection direction);
71
 
72
        #endregion
73
 
74
        #region Measure
75
 
76
        /// <summary>
77
        /// Measures text using the specified layout options.
78
        /// </summary>
79
        /// <param name="text">The System.String to measure.</param>
80
        /// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
81
        /// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
82
        TextExtents Measure(string text, Font font);
83
 
84
        /// <summary>
85
        /// Measures text using the specified layout options.
86
        /// </summary>
87
        /// <param name="text">The System.String to measure.</param>
88
        /// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
89
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
90
        /// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
91
        TextExtents Measure(string text, Font font, RectangleF rect);
92
 
93
        /// <summary>
94
        /// Measures text using the specified layout options.
95
        /// </summary>
96
        /// <param name="text">The System.String to measure.</param>
97
        /// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
98
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
99
        /// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
100
        /// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
101
        TextExtents Measure(string text, Font font, RectangleF rect, TextPrinterOptions options);
102
 
103
        /// <summary>
104
        /// Measures text using the specified layout options.
105
        /// </summary>
106
        /// <param name="text">The System.String to measure.</param>
107
        /// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
108
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
109
        /// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
110
        /// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to measure text.</param>
111
        /// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
112
        TextExtents Measure(string text, Font font, RectangleF rect, TextPrinterOptions options, TextAlignment alignment);
113
 
114
        /// <summary>
115
        /// Measures text using the specified layout options.
116
        /// </summary>
117
        /// <param name="text">The System.String to measure.</param>
118
        /// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
119
        /// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
120
        /// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
121
        /// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to measure text.</param>
122
        /// <param name="direction">The OpenTK.Graphics.TextDirection that will be used to measure text.</param>
123
        /// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
124
        TextExtents Measure(string text, Font font, RectangleF rect, TextPrinterOptions options, TextAlignment alignment, TextDirection direction);
125
 
126
        #endregion
127
 
128
        #region Begin
129
 
130
        /// <summary>
131
        /// Sets up a resolution-dependent orthographic projection.
132
        /// </summary>
133
        void Begin();
134
 
135
        #endregion
136
 
137
        #region End
138
 
139
        /// <summary>
140
        /// Restores the projection and modelview matrices to their previous state.
141
        /// </summary>
142
        void End();
143
 
144
        #endregion
145
 
146
        #region Obsolete
147
 
148
        [Obsolete("Use TextPrinter.Print instead")]
149
        void Draw(TextHandle handle);
150
 
151
        [Obsolete("Use TextPrinter.Print instead")]
152
        void Draw(string text, TextureFont font);
153
 
154
        [Obsolete("Use TextPrinter.Print instead")]
155
        void Prepare(string text, TextureFont font, out TextHandle handle);
156
 
157
        #endregion
158
    }
159
}