#pragma once
//==========================================================================//
// File:	 Font.hpp														//
// Project:  GameOS					                                        //
// Contents: Font-drawing routines											//
//--------------------------------------------------------------------------//
// Date      Who    Modification                                            //
// 11/15/97  JTR    Created													//
//																			//
//--------------------------------------------------------------------------//
// Copyright (C) 2000, Microsoft, Inc.										//
// All Rights reserved worldwide                                            //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL              //
//==========================================================================//
#include "Surface.hpp"
//
// 2d font API
//
void gosScript_CreateFont( HGOSFONT* font, const char* path, DWORD width, DWORD height, bool prop );
DWORD gosScript_FontGetWidth(HGOSFONT fnt);
DWORD gosScript_FontGetHeight(HGOSFONT fnt);
void gosScript_TextSelectFont(HGOSFONT fnt);
void gosScript_TextSetLocation(DWORD x, DWORD y );
void gosScript_TextSetSurface( HGOSSURFACE hsurf );
void gosScript_TextGetSurfaceAndLocation( HGOSSURFACE* hsurf, DWORD* x, DWORD* y );
void gosScript_DestroyFont( HGOSFONT* font );
void gosScript_TextOut( const char* text, ... );
void gosScript_TextOutN( DWORD count, const char* text, ... );
void gosScript_FontSetForegroundColor( HGOSFONT hfont, DWORD color );
DWORD gosScript_FontGetForegroundColor( HGOSFONT hfont );
void gosScript_FontSetBackgroundColor( HGOSFONT hfont, DWORD color );
DWORD gosScript_FontGetBackgroundColor( HGOSFONT hfont );
void gosScript_TextSetMargins( CUBE* borders );
void gosScript_TextGetMargins( CUBE* borders );
void gosScript_TextSetWrapMode( gosEnum_TextWrap meth );
gosEnum_TextWrap gos_GetSetWrapMode();


class Font : public Surface
{
	public:
		signed long
			m_pointSizeX,
			m_pointSizeY;
		signed long
			m_backgroundColor,
			m_foregroundColor;
		bool
			m_foregroundColorSet,
			m_backgroundColorSet,
			m_isProportional;
		char m_characterWidth[96];
	public:
		Font
		(
			const char * path, 
			DWORD width, 
			DWORD height, 
			bool proportional
		);

		~Font();

		void
			SetForegroundColor(DWORD color);
		
		void
			SetBackgroundColor(DWORD color);

		void
			DetermineSpacings();

		void
			TextOut(const char * str);
		void 
			TextOutByWord(const char * str);
		void
			TextOut(DWORD count, const char * str);
		void
			TextBlit(CUBE * rect_in, int x, int y, HGOSSURFACE dst);
		DWORD 
			GetStringPixelWidth(const char * string);
};

