00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects Software Inc 00008 * 123 Front Street West, Suite 1401 00009 * Toronto, Ontario 00010 * Canada M5J 2M2 00011 * 416-504-9876 00012 * 00013 * NAME: RE_OGLFontCache.h (RE Library, C++) 00014 * 00015 * COMMENTS: 00016 * This is a simple font cache, used by RE_OGLRender to manage fonts. 00017 */ 00018 00019 #ifndef __RE_OGLFontCache__ 00020 #define __RE_OGLFontCache__ 00021 00022 #include "RE_API.h" 00023 00024 #include <stdio.h> 00025 00026 #include <UT/UT_PtrArray.h> 00027 #include <UT/UT_String.h> 00028 00029 class RE_OGLFont; 00030 class RE_Render; 00031 00032 class RE_API RE_OGLFontCache { 00033 public: 00034 RE_OGLFontCache(); 00035 ~RE_OGLFontCache(); 00036 00037 RE_OGLFont *getFont(const char *name, float size); 00038 RE_OGLFont *getViewportFont(const char *name, float size); 00039 00040 void setDefaultFont(const char *name, float size) 00041 { 00042 myDefaultFontName = name; 00043 myDefaultFontSize = size; 00044 } 00045 00046 const UT_String &getDefaultFontName() const { return myDefaultFontName; } 00047 float getDefaultFontSize() const { return myDefaultFontSize; } 00048 00049 // Load the display lists for fonts whose display lists were not able to 00050 // load when originally requested. 00051 void loadFontCaches(RE_Render *r); 00052 00053 private: 00054 UT_PtrArray<RE_OGLFont *> myFontCache; 00055 00056 UT_String myDefaultFontName; 00057 float myDefaultFontSize; 00058 00059 // The following flag is true when we have fonts whose display lists 00060 // need loading. 00061 bool myListsRequested; 00062 }; 00063 00064 #endif
1.5.9