1 /* 2 * Copyright 2001-2009, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * DarkWyrm <bpmagic@columbus.rr.com> 7 * Axel Dörfler, axeld@pinc-software.de 8 */ 9 #ifndef APP_FONT_MANAGER_H 10 #define APP_FONT_MANAGER_H 11 12 13 #include "FontManager.h" 14 15 16 #include <AutoDeleter.h> 17 #include <HashMap.h> 18 #include <Looper.h> 19 #include <ObjectList.h> 20 #include <Referenceable.h> 21 22 23 #include <ft2build.h> 24 #include FT_FREETYPE_H 25 26 class BEntry; 27 class BPath; 28 struct node_ref; 29 30 class FontFamily; 31 class FontStyle; 32 class ServerFont; 33 34 35 // font areas should be less than 20MB 36 #define MAX_FONT_DATA_SIZE_BYTES 20 * 1024 * 1024 37 #define MAX_USER_FONTS 128 38 39 /*! 40 \class AppFontManager AppFontManager.h 41 \brief Manager for application-added fonts in the font subsystem 42 */ 43 class AppFontManager : public FontManagerBase { 44 public: 45 AppFontManager(); 46 virtual ~AppFontManager(); 47 48 status_t AddUserFontFromFile(const char* path, 49 uint16& familyID, uint16& styleID); 50 status_t AddUserFontFromMemory(const FT_Byte* fontAddress, 51 size_t size, uint16& familyID, uint16& styleID); 52 status_t RemoveUserFont(uint16 familyID, uint16 styleID); 53 54 private: 55 status_t _AddUserFont(FT_Face face, node_ref nodeRef, 56 const char* path, 57 uint16& familyID, uint16& styleID); 58 private: 59 60 int32 fNextID; 61 }; 62 63 64 #endif /* APP_FONT_MANAGER_H */ 65