using System;
using System.IO;
namespace Orvid.Graphics.FontSupport
{
///
/// This class represents a font manager.
/// It's a font manager's job to load,
/// draw, and keep track of fonts.
///
public abstract class FontManager
{
///
/// Current font manager.
///
private static FontManager instance;
///
/// The current font manager.
///
public static FontManager Instance
{
get { return instance; }
}
///
/// The static constructor which sets-up the default font manager.
///
static FontManager()
{
instance = new DefaultFontManager();
}
///
/// The default constructor.
///
public FontManager()
{
instance = this;
}
///
/// The name of the FontManager.
///
public abstract string Name { get; }
///
/// The known fonts.
///
public abstract Font[] Fonts { get; }
///
/// Get the FontMetrics for the specified font.
///
/// Font to get the metrics for.
/// The FontMetrics for the specified font.
public abstract FontMetrics GetFontMetrics(Font font);
///
/// Draw the specified Text, using the specified Font,
/// in the specified Color, within the specified Bounds,
/// at the specified Location, and on the specified image,
/// making sure to take the transform into account.
///
/// The Image to draw on.
/// The BoundingBox to clip to.
/// The Transform to apply.
/// The String to draw.
/// The Font to draw in.
/// The Location to draw at.
/// The Color to draw in.
public abstract void DrawText(Image i, BoundingBox clip, AffineTransform trans, String s, Font f, Vec2 Loc, Pixel p);
///
/// Loads a font from the specified stream.
///
/// The format of the font.
/// The Stream to load from.
/// The loaded font.
public abstract Font LoadFont(int format, Stream s);
#warning TODO: Remove the need for the format parameter.
}
}