Even more font stuff:
* the node monitor is now working - fonts can only be added yet, though * deleting a FontFamily did not work before, as the last style to be removed tried to delete the family again. * "luckily", FontFamilies and FontStyles were not deleted at all before. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14824 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,11 +10,12 @@
|
||||
#define FONT_FAMILY_H_
|
||||
|
||||
|
||||
#include <String.h>
|
||||
#include <Rect.h>
|
||||
#include <Font.h>
|
||||
#include <ObjectList.h>
|
||||
#include <Locker.h>
|
||||
#include <Node.h>
|
||||
#include <ObjectList.h>
|
||||
#include <Rect.h>
|
||||
#include <String.h>
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
@@ -22,6 +23,7 @@
|
||||
#include "HashTable.h"
|
||||
|
||||
|
||||
struct node_ref;
|
||||
class FontFamily;
|
||||
class ServerFont;
|
||||
|
||||
@@ -66,12 +68,14 @@ class FontKey : public Hashable {
|
||||
*/
|
||||
class FontStyle : public SharedObject, public Hashable, public BLocker {
|
||||
public:
|
||||
FontStyle(const char* path, FT_Face face);
|
||||
FontStyle(node_ref& nodeRef, const char* path, FT_Face face);
|
||||
virtual ~FontStyle();
|
||||
|
||||
virtual uint32 Hash() const;
|
||||
virtual bool CompareTo(Hashable& other) const;
|
||||
|
||||
const node_ref& NodeRef() const { return fNodeRef; }
|
||||
|
||||
/*!
|
||||
\fn bool FontStyle::IsFixedWidth(void)
|
||||
\brief Determines whether the font's character width is fixed
|
||||
@@ -159,6 +163,7 @@ class FontStyle : public SharedObject, public Hashable, public BLocker {
|
||||
FT_Face fFreeTypeFace;
|
||||
BString fName;
|
||||
BString fPath;
|
||||
node_ref fNodeRef;
|
||||
|
||||
FontFamily* fFamily;
|
||||
uint16 fID;
|
||||
@@ -184,8 +189,8 @@ class FontFamily {
|
||||
const char* Name() const;
|
||||
|
||||
bool AddStyle(FontStyle* style);
|
||||
bool RemoveStyle(const char* style);
|
||||
bool RemoveStyle(FontStyle* style);
|
||||
bool RemoveStyle(const char* style, bool deleteSelfIfEmpty = true);
|
||||
bool RemoveStyle(FontStyle* style, bool deleteSelfIfEmpty = true);
|
||||
|
||||
FontStyle* GetStyle(const char* style) const;
|
||||
FontStyle* GetStyleMatchingFace(uint16 face) const;
|
||||
|
||||
@@ -73,6 +73,8 @@ class FontManager : public BLooper {
|
||||
uint16 fallbackFace);
|
||||
status_t _SetDefaultFonts();
|
||||
void _AddSystemPaths();
|
||||
font_directory* _FindDirectory(node_ref& nodeRef);
|
||||
void _RemoveDirectory(font_directory* directory);
|
||||
status_t _AddPath(const char* path);
|
||||
status_t _AddPath(BEntry& entry, font_directory** _newDirectory = NULL);
|
||||
|
||||
@@ -82,7 +84,7 @@ class FontManager : public BLooper {
|
||||
void _ScanFontsIfNecessary();
|
||||
void _ScanFonts();
|
||||
status_t _ScanFontDirectory(font_directory& directory);
|
||||
status_t _AddFont(BPath& path);
|
||||
status_t _AddFont(font_directory& directory, BEntry& entry);
|
||||
|
||||
FT_CharMap _GetSupportedCharmap(const FT_Face &face);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user