AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
IzPlatformFont.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #if !defined(_CIZ_PLATFORM_FONT_H_)
00015 #define _CIZ_PLATFORM_FONT_H_
00016 
00017 #include "CzPlatform.h"
00018 
00019 #define PLATFORM_FONT       PLATFORM->getFont() 
00020 
00021 enum eCzFontFlags
00022 {
00023     CzFontFlags_None = 0, 
00024     CzFontFlags_NoWrap = 1, 
00025 };
00026 
00027 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00028 //
00029 // IzPlatformFont
00030 //
00031 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00032 class IzPlatformFont
00033 {
00034     // Properties
00035 protected:
00036     bool        Initialised;
00037 public:
00038     bool        isInitialised() const   { return Initialised; }
00039     // Properties end
00040 public:
00041     virtual int Init() = 0;
00042     virtual void Release() = 0;
00043 
00044     // Font creation / loading
00045     virtual CzFontHandle    CreateTTFontFromBuffer(void* memory_buffer, int memory_buffer_size, float point_size) = 0;
00046     virtual void            DestroyFont(CzFontHandle font) = 0;
00047 
00048     // Prepared text
00049     virtual CzFontPreparedText  CreatePreparedText() = 0;                               // Creates buffer to be used to prepare text
00050     virtual void            DestroyPreparedText(CzFontPreparedText data) = 0;
00051     virtual bool            PrepareText(CzFontPreparedText prep, const char* text) = 0; // Prepares rendering optimised text data using the current font
00052     virtual int             GetTextHeight(CzFontPreparedText data) = 0;
00053     virtual int             GetTextWidth(CzFontPreparedText data) = 0;
00054 
00055     // General font methods
00056     virtual void            SetCurrentFont(CzFontHandle font) = 0;
00057     virtual void            SetCurrentFontFlags(eCzFontFlags flags) = 0;
00058     virtual void            SetCurrentFontRect(const CzIRect& rc) = 0;
00059     virtual void            SetCurrentFontAlignment(eCzAlignH horiz, eCzAlignV vert) = 0;
00060     
00061 };
00062 
00063 
00064 #endif  // _CIZ_PLATFORM_FONT_H_