2006-03-18 19:42:14 +03:00
|
|
|
/*
|
2008-03-18 19:52:34 +03:00
|
|
|
* Copyright 2001-2008, Haiku.
|
2006-03-18 19:42:14 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* DarkWyrm <bpmagic@columbus.rr.com>
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
|
|
|
*/
|
|
|
|
#ifndef FONT_FAMILY_H_
|
|
|
|
#define FONT_FAMILY_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <ObjectList.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
2007-07-18 00:48:06 +04:00
|
|
|
#include "FontStyle.h"
|
2006-03-18 19:42:14 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class FontFamily FontFamily.h
|
|
|
|
\brief Class representing a collection of similar styles
|
2008-03-18 19:52:34 +03:00
|
|
|
|
2006-03-18 19:42:14 +03:00
|
|
|
FontFamily objects bring together many styles of the same face, such as
|
|
|
|
Arial Roman, Arial Italic, Arial Bold, etc.
|
|
|
|
*/
|
|
|
|
class FontFamily {
|
2008-03-18 19:52:34 +03:00
|
|
|
public:
|
|
|
|
FontFamily(const char* name, uint16 id);
|
|
|
|
virtual ~FontFamily();
|
|
|
|
|
|
|
|
const char* Name() const;
|
2006-03-18 19:42:14 +03:00
|
|
|
|
2008-03-18 19:52:34 +03:00
|
|
|
bool AddStyle(FontStyle* style);
|
|
|
|
bool RemoveStyle(FontStyle* style);
|
2006-03-18 19:42:14 +03:00
|
|
|
|
2008-03-18 19:52:34 +03:00
|
|
|
FontStyle* GetStyle(const char* style) const;
|
|
|
|
FontStyle* GetStyleMatchingFace(uint16 face) const;
|
|
|
|
FontStyle* GetStyleByID(uint16 face) const;
|
2006-03-18 19:42:14 +03:00
|
|
|
|
2008-03-18 19:52:34 +03:00
|
|
|
uint16 ID() const
|
|
|
|
{ return fID; }
|
|
|
|
uint32 Flags();
|
2006-03-18 19:42:14 +03:00
|
|
|
|
2008-03-18 19:52:34 +03:00
|
|
|
bool HasStyle(const char* style) const;
|
|
|
|
int32 CountStyles() const;
|
|
|
|
FontStyle* StyleAt(int32 index) const;
|
2006-03-18 19:42:14 +03:00
|
|
|
|
2008-03-18 19:52:34 +03:00
|
|
|
private:
|
|
|
|
FontStyle* _FindStyle(const char* name) const;
|
2006-03-18 19:42:14 +03:00
|
|
|
|
2008-03-18 19:52:34 +03:00
|
|
|
BString fName;
|
|
|
|
BObjectList<FontStyle> fStyles;
|
|
|
|
uint16 fID;
|
|
|
|
uint16 fNextID;
|
|
|
|
uint32 fFlags;
|
2006-03-18 19:42:14 +03:00
|
|
|
};
|
|
|
|
|
2007-07-18 00:48:06 +04:00
|
|
|
#endif // FONT_FAMILY_H_
|