XIII
Class XIIIFontInfo

source: C:\XIII\XIII\Classes\XIIIFontInfo.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--XIII.XIIIFontInfo
Direct Known Subclasses:None

class XIIIFontInfo
extends Engine.Info

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 font SavedFont[7]
 float SavedWidth[7]
 MediumFont, fSmallFont


Function Summary
 font GetBigFont(float Width)
 font GetHugeFont(float Width)
 font GetMediumFont(float Width)
 font GetSmallFont(float Width)
 font GetSmallestFont(float Width)
 font GetStaticBigFont(float Width)
 font GetStaticHugeFont(float Width)
 font GetStaticMediumFont(float Width)
 font GetStaticSmallFont(float Width)
 font GetStaticSmallestFont(float Width)



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class XIIIFontInfo extends Info;
00005	
00006	//#exec OBJ LOAD FILE="..\Textures\PS2Fonts.utx" PACKAGE=PS2Fonts
00007	/*
00008	#exec new TrueTypeFontFactory Name=Tahoma30 FontName="Tahoma" Height=30 AntiAlias=1 CharactersPerPage=128
00009	#exec new TrueTypeFontFactory Name=Tahoma20 FontName="Tahoma" Height=20 AntiAlias=1 CharactersPerPage=128
00010	#exec new TrueTypeFontFactory Name=Tahoma14 FontName="Tahoma" Height=14 AntiAlias=1 CharactersPerPage=128
00011	
00012	#exec new TrueTypeFontFactory Name=C30 FontName="Comic sans MS" Height=30 AntiAlias=1 CharactersPerPage=128
00013	#exec new TrueTypeFontFactory Name=C20 FontName="Comic sans MS" Height=20 AntiAlias=1 CharactersPerPage=128
00014	#exec new TrueTypeFontFactory Name=C14 FontName="Comic sans MS" Height=14 AntiAlias=1 CharactersPerPage=128
00015	*/
00016	/*
00017	#exec new TrueTypeFontFactory Name=C30 FontName="DigitalStrip" Height=35 AntiAlias=1 CharactersPerPage=32
00018	#exec new TrueTypeFontFactory Name=C20 FontName="DigitalStrip" Height=25 AntiAlias=1 CharactersPerPage=64
00019	#exec new TrueTypeFontFactory Name=C14 FontName="DigitalStrip" Height=15 AntiAlias=1 CharactersPerPage=256
00020	*/
00021	/*
00022	#exec new TrueTypeFontFactory Name=C30 FontName="Lucida Console" Height=35 AntiAlias=1 CharactersPerPage=32
00023	#exec new TrueTypeFontFactory Name=C20 FontName="Lucida Console" Height=25 AntiAlias=1 CharactersPerPage=64
00024	#exec new TrueTypeFontFactory Name=C14 FontName="Lucida Console" Height=15 AntiAlias=1 CharactersPerPage=256
00025	*/
00026	/*
00027	#exec new TrueTypeFontFactory Name=PoliceF30 FontName="franciscan regular" Height=45 AntiAlias=1 CharactersPerPage=16
00028	#exec new TrueTypeFontFactory Name=PoliceF20 FontName="franciscan regular" Height=35 AntiAlias=1 CharactersPerPage=64
00029	#exec new TrueTypeFontFactory Name=PoliceF14 FontName="franciscan regular" Height=25 AntiAlias=1 CharactersPerPage=128
00030	*/
00031	
00032	var font HugeFont, BigFont, MediumFont, fSmallFont;
00033	var float SavedWidth[7];
00034	var font SavedFont[7];
00035	
00036	function font GetHugeFont(float Width)
00037	{
00038	    if ( (SavedFont[6] != None) && (Width == SavedWidth[6]) )
00039	      return SavedFont[6];
00040	
00041	    SavedWidth[6] = Width;
00042	    SavedFont[6] = GetStaticHugeFont(Width);
00043	    return SavedFont[6];
00044	}
00045	
00046	static function font GetStaticHugeFont(float Width)
00047	{
00048	    if (Width < 480)
00049	      return Default.MediumFont;
00050	    else if (Width < 640)
00051	      return Default.BigFont;
00052	    else
00053	      return Default.HugeFont;
00054	}
00055	
00056	function font GetBigFont(float Width)
00057	{
00058	    if ( (SavedFont[5] != None) && (Width == SavedWidth[5]) )
00059	      return SavedFont[5];
00060	
00061	    SavedWidth[5] = Width;
00062	    SavedFont[5] = GetStaticBigFont(Width);
00063	    return SavedFont[5];
00064	}
00065	
00066	static function font GetStaticBigFont(float Width)
00067	{
00068	    if (Width < 480)
00069	      return Default.MediumFont;
00070	    else if (Width < 768)
00071	      return Default.BigFont;
00072	    else
00073	      return Default.HugeFont;
00074	}
00075	
00076	function font GetMediumFont(float Width)
00077	{
00078	    if ( (SavedFont[4] != None) && (Width == SavedWidth[4]) )
00079	      return SavedFont[4];
00080	
00081	    SavedWidth[4] = Width;
00082	    SavedFont[4] = GetStaticMediumFont(Width);
00083	    return SavedFont[4];
00084	}
00085	
00086	static function font GetStaticMediumFont(float Width)
00087	{
00088	    if (Width < 480)
00089	      return default.fSmallFont;
00090	    else if (Width < 768)
00091	      return Default.MediumFont;
00092	    else
00093	      return Default.BigFont;
00094	}
00095	
00096	function font GetSmallFont(float Width)
00097	{
00098	    if ( (SavedFont[3] != None) && (Width == SavedWidth[3]) )
00099	      return SavedFont[3];
00100	
00101	    SavedWidth[3] = Width;
00102	    SavedFont[3] = GetStaticSmallFont(Width);
00103	    return SavedFont[3];
00104	}
00105	
00106	static function font GetStaticSmallFont(float Width)
00107	{
00108	    if (Width < 480)
00109	      return default.fSmallFont;
00110	    else
00111	      return Default.MediumFont;
00112	}
00113	
00114	function font GetSmallestFont(float Width)
00115	{
00116	    return default.fSmallFont;
00117	}
00118	
00119	static function font GetStaticSmallestFont(float Width)
00120	{
00121	    return default.fSmallFont;
00122	}
00123	
00124	
00125	
00126	defaultproperties
00127	{
00128	     HugeFont=Font'XIIIFonts.PoliceF20'
00129	     BigFont=Font'XIIIFonts.PoliceF16'
00130	     MediumFont=Font'XIIIFonts.XIIIConsoleFont'
00131	     fSmallFont=Font'XIIIFonts.XIIISmallFont'
00132	}

End Source Code