haiku/src/servers/app/FontFamily.h
Axel Dörfler 98fe648b6e * FontFamily::GetStyle() now looks for alternative names when a specific
style couldn't be found, ie. when looking for "Roman", "Regular", and
  "Book" are accepted, too, and "Italic"/"Oblique" are now synonyms as 
  well.
* This prevents StyledEdit from using the "Condensed" style when it does 
  not find a certain font.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-18 16:52:34 +00:00

59 lines
1.2 KiB
C++

/*
* Copyright 2001-2008, Haiku.
* 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>
#include "FontStyle.h"
/*!
\class FontFamily FontFamily.h
\brief Class representing a collection of similar styles
FontFamily objects bring together many styles of the same face, such as
Arial Roman, Arial Italic, Arial Bold, etc.
*/
class FontFamily {
public:
FontFamily(const char* name, uint16 id);
virtual ~FontFamily();
const char* Name() const;
bool AddStyle(FontStyle* style);
bool RemoveStyle(FontStyle* style);
FontStyle* GetStyle(const char* style) const;
FontStyle* GetStyleMatchingFace(uint16 face) const;
FontStyle* GetStyleByID(uint16 face) const;
uint16 ID() const
{ return fID; }
uint32 Flags();
bool HasStyle(const char* style) const;
int32 CountStyles() const;
FontStyle* StyleAt(int32 index) const;
private:
FontStyle* _FindStyle(const char* name) const;
BString fName;
BObjectList<FontStyle> fStyles;
uint16 fID;
uint16 fNextID;
uint32 fFlags;
};
#endif // FONT_FAMILY_H_