2007-11-10 23:29:25 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
|
|
|
|
* See license.txt for license info
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
2007-11-01 23:23:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Drawing;
|
2008-11-25 17:16:57 +00:00
|
|
|
|
using OpenTK.Graphics.Text;
|
2007-11-01 23:23:19 +00:00
|
|
|
|
|
2008-03-08 14:38:10 +00:00
|
|
|
|
namespace OpenTK.Graphics
|
2007-11-01 23:23:19 +00:00
|
|
|
|
{
|
2007-11-06 13:30:25 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines the interface for a TextPrinter.
|
|
|
|
|
/// </summary>
|
2009-02-12 17:41:09 +00:00
|
|
|
|
public interface ITextPrinter : IDisposable
|
2007-11-01 23:23:19 +00:00
|
|
|
|
{
|
2009-02-12 23:10:09 +00:00
|
|
|
|
#region Print
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Prints text using the specified color and layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to print.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to print text.</param>
|
|
|
|
|
/// <param name="color">The System.Drawing.Color that will be used to print text.</param>
|
2008-11-26 21:49:05 +00:00
|
|
|
|
void Print(string text, Font font, Color color);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Prints text using the specified color and layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to print.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to print text.</param>
|
|
|
|
|
/// <param name="color">The System.Drawing.Color that will be used to print text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
void Print(string text, Font font, Color color, RectangleF rect);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Prints text using the specified color and layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to print.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to print text.</param>
|
|
|
|
|
/// <param name="color">The System.Drawing.Color that will be used to print text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to print text.</param>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
void Print(string text, Font font, Color color, RectangleF rect, TextPrinterOptions options);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Prints text using the specified color and layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to print.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to print text.</param>
|
|
|
|
|
/// <param name="color">The System.Drawing.Color that will be used to print text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to print text.</param>
|
|
|
|
|
/// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to print text.</param>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
void Print(string text, Font font, Color color, RectangleF rect, TextPrinterOptions options, TextAlignment alignment);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Prints text using the specified color and layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to print.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to print text.</param>
|
|
|
|
|
/// <param name="color">The System.Drawing.Color that will be used to print text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to print text.</param>
|
|
|
|
|
/// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to print text.</param>
|
|
|
|
|
/// <param name="direction">The OpenTK.Graphics.TextDirection that will be used to print text.</param>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
void Print(string text, Font font, Color color, RectangleF rect, TextPrinterOptions options, TextAlignment alignment, TextDirection direction);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Measure
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Measures text using the specified layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to measure.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
|
2008-11-25 17:16:57 +00:00
|
|
|
|
TextExtents Measure(string text, Font font);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Measures text using the specified layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to measure.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
|
|
|
|
|
/// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
TextExtents Measure(string text, Font font, RectangleF rect);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Measures text using the specified layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to measure.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
|
|
|
|
|
/// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to measure text.</param>
|
|
|
|
|
/// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
TextExtents Measure(string text, Font font, RectangleF rect, TextPrinterOptions options);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Measures text using the specified layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to measure.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
|
|
|
|
|
/// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to measure text.</param>
|
|
|
|
|
/// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
TextExtents Measure(string text, Font font, RectangleF rect, TextPrinterOptions options, TextAlignment alignment);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Measures text using the specified layout options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="text">The System.String to measure.</param>
|
|
|
|
|
/// <param name="font">The System.Drawing.Font that will be used to measure text.</param>
|
|
|
|
|
/// <param name="rect">The System.Drawing.Rectangle that defines the bounds for text layout.</param>
|
|
|
|
|
/// <param name="options">The OpenTK.Graphics.TextPrinterOptions that will be used to measure text.</param>
|
|
|
|
|
/// <param name="alignment">The OpenTK.Graphics.TextAlignment that will be used to measure text.</param>
|
|
|
|
|
/// <param name="direction">The OpenTK.Graphics.TextDirection that will be used to measure text.</param>
|
|
|
|
|
/// <returns>An OpenTK.Graphics.TextExtents instance that contains the results of the measurement.</returns>
|
2009-02-12 22:50:05 +00:00
|
|
|
|
TextExtents Measure(string text, Font font, RectangleF rect, TextPrinterOptions options, TextAlignment alignment, TextDirection direction);
|
2008-11-25 18:17:30 +00:00
|
|
|
|
|
2009-02-12 23:10:09 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Obsolete
|
|
|
|
|
|
|
|
|
|
[Obsolete]
|
|
|
|
|
void Begin();
|
|
|
|
|
|
|
|
|
|
[Obsolete]
|
|
|
|
|
void End();
|
|
|
|
|
|
2008-11-25 18:17:30 +00:00
|
|
|
|
[Obsolete("Use TextPrinter.Print instead")]
|
|
|
|
|
void Draw(TextHandle handle);
|
|
|
|
|
|
|
|
|
|
[Obsolete("Use TextPrinter.Print instead")]
|
|
|
|
|
void Draw(string text, TextureFont font);
|
|
|
|
|
|
|
|
|
|
[Obsolete("Use TextPrinter.Print instead")]
|
|
|
|
|
void Prepare(string text, TextureFont font, out TextHandle handle);
|
2009-02-12 23:10:09 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
2007-11-01 23:23:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|