Files
haiku-beta6/headers/private/servers/app/FontServer.h
T

89 lines
2.1 KiB
C++
Raw Normal View History

/*
* Copyright 2001-2005, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* DarkWyrm <[email protected]>
2005-11-01 16:28:01 +00:00
* Axel Dörfler, [email protected]
*/
2005-11-01 16:28:01 +00:00
#ifndef FONT_SERVER_H
#define FONT_SERVER_H
#include <Font.h>
#include <Locker.h>
2005-11-01 16:28:01 +00:00
#include <OS.h>
#include <ObjectList.h>
#include <SupportDefs.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_CACHE_H
class BPath;
class FontFamily;
class FontStyle;
class ServerFont;
2005-11-01 16:28:01 +00:00
/*!
\class FontServer FontServer.h
\brief Manager for the largest part of the font subsystem
*/
class FontServer : public BLocker {
2005-11-01 16:28:01 +00:00
public:
FontServer();
~FontServer();
status_t InitCheck() { return fInitStatus; }
int32 CountFamilies();
int32 CountStyles(const char *family);
void RemoveFamily(const char *family);
void ScanSystemFolders();
status_t ScanDirectory(const char *path);
FontFamily* GetFamilyByIndex(int32 index) const;
FontFamily *GetFamily(uint16 familyID) const;
FontFamily *GetFamily(const char *name) const;
FontStyle *GetStyleByIndex(const char *family, int32 index) const;
FontStyle *GetStyle(const char *family, const char *style, uint16 familyID = 0xffff,
uint16 styleID = 0xffff, uint16 face = 0);
FontStyle *GetStyle(const char *family, uint16 styleID);
FontStyle *GetStyle(uint16 familyID, uint16 styleID);
ServerFont *GetSystemPlain();
ServerFont *GetSystemBold();
ServerFont *GetSystemFixed();
bool SetSystemPlain(const char *family, const char *style, float size);
bool SetSystemBold(const char *family, const char *style, float size);
bool SetSystemFixed(const char *family, const char *style, float size);
bool FontsNeedUpdated() { return fNeedUpdate; }
/*!
\brief Called when the fonts list has been updated
*/
void FontsUpdated() { fNeedUpdate = false; }
private:
void _AddFont(BPath &path);
2005-11-01 16:28:01 +00:00
FT_CharMap _GetSupportedCharmap(const FT_Face &face);
private:
status_t fInitStatus;
BObjectList<FontFamily> fFamilies;
ServerFont *fPlain, *fBold, *fFixed;
bool fNeedUpdate;
int32 fNextID;
};
extern FTC_Manager ftmanager;
extern FT_Library ftlib;
extern FontServer *gFontServer;
#endif /* FONTSERVER_H_ */