More API fixes and tweaks, mostly to get BFont::GetHeight working
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10805 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3f8d6d562d
commit
9a2b128aea
|
@ -61,6 +61,21 @@ typedef struct CachedFaceRec_
|
||||||
int face_index;
|
int face_index;
|
||||||
} CachedFaceRec, *CachedFace;
|
} CachedFaceRec, *CachedFace;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Private structure to store font height values
|
||||||
|
|
||||||
|
Units provided by FT2 are in font units, so they are stored in the style as
|
||||||
|
such. Each value must be multiplied by the point size to determine size in pixels
|
||||||
|
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
FT_Short ascent;
|
||||||
|
FT_Short descent;
|
||||||
|
FT_Short leading;
|
||||||
|
FT_UShort units_per_em;
|
||||||
|
} FontStyleHeight;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class FontStyle FontFamily.h
|
\class FontStyle FontFamily.h
|
||||||
\brief Object used to represent a font style
|
\brief Object used to represent a font style
|
||||||
|
@ -124,6 +139,7 @@ public:
|
||||||
uint16 GetFace(void) const { return fFace; }
|
uint16 GetFace(void) const { return fFace; }
|
||||||
|
|
||||||
const char *GetPath(void);
|
const char *GetPath(void);
|
||||||
|
font_height GetHeight(const float &size);
|
||||||
|
|
||||||
// TODO: Re-enable when I understand how the FT2 Cache system changed from
|
// TODO: Re-enable when I understand how the FT2 Cache system changed from
|
||||||
// 2.1.4 to 2.1.8
|
// 2.1.4 to 2.1.8
|
||||||
|
@ -142,6 +158,7 @@ protected:
|
||||||
BRect fbounds;
|
BRect fbounds;
|
||||||
uint16 fID;
|
uint16 fID;
|
||||||
uint16 fFace;
|
uint16 fFace;
|
||||||
|
FontStyleHeight fHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -68,7 +68,8 @@ public:
|
||||||
FontStyle *GetStyle(const char *family, const char *face);
|
FontStyle *GetStyle(const char *family, const char *face);
|
||||||
FontStyle *GetStyle(const char *family, uint16 id) const;
|
FontStyle *GetStyle(const char *family, uint16 id) const;
|
||||||
FontStyle *GetStyle(const uint16 &familyid, const uint16 &styleid);
|
FontStyle *GetStyle(const uint16 &familyid, const uint16 &styleid);
|
||||||
FontFamily *GetFamily(const uint16 &familyid);
|
FontFamily *GetFamily(const uint16 &familyid) const;
|
||||||
|
FontFamily *GetFamily(const char *name) const;
|
||||||
|
|
||||||
ServerFont *GetSystemPlain(void);
|
ServerFont *GetSystemPlain(void);
|
||||||
ServerFont *GetSystemBold(void);
|
ServerFont *GetSystemBold(void);
|
||||||
|
@ -84,7 +85,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void FontsUpdated(void) { need_update=false; }
|
void FontsUpdated(void) { need_update=false; }
|
||||||
protected:
|
protected:
|
||||||
FontFamily *_FindFamily(const char *name) const;
|
|
||||||
uint16 TranslateStyleToFace(const char *name) const;
|
uint16 TranslateStyleToFace(const char *name) const;
|
||||||
|
|
||||||
FT_CharMap _GetSupportedCharmap(const FT_Face &face);
|
FT_CharMap _GetSupportedCharmap(const FT_Face &face);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
float Shear(void) const { return fshear; }
|
float Shear(void) const { return fshear; }
|
||||||
float Rotation(void) const { return frotation; }
|
float Rotation(void) const { return frotation; }
|
||||||
float Size(void) const { return fsize; }
|
float Size(void) const { return fsize; }
|
||||||
uint32 Face(void) const { return fface; }
|
uint16 Face(void) const { return fface; }
|
||||||
uint32 CountGlyphs(void);
|
uint32 CountGlyphs(void);
|
||||||
int32 CountTuned(void);
|
int32 CountTuned(void);
|
||||||
font_file_format FileFormat(void);
|
font_file_format FileFormat(void);
|
||||||
|
@ -73,6 +73,8 @@ public:
|
||||||
const char *GetStyle(void) const;
|
const char *GetStyle(void) const;
|
||||||
const char *GetFamily(void) const;
|
const char *GetFamily(void) const;
|
||||||
const char *GetPath(void) const { return fstyle->GetPath(); }
|
const char *GetPath(void) const { return fstyle->GetPath(); }
|
||||||
|
uint16 StyleID(void) const { return fstyle->GetID(); }
|
||||||
|
uint16 FamilyID(void) const { return fstyle->Family()->GetID(); }
|
||||||
|
|
||||||
BRect BoundingBox(void);
|
BRect BoundingBox(void);
|
||||||
void Height(font_height *fh);
|
void Height(font_height *fh);
|
||||||
|
@ -88,7 +90,7 @@ protected:
|
||||||
BRect fbounds;
|
BRect fbounds;
|
||||||
uint32 fflags;
|
uint32 fflags;
|
||||||
uint32 fspacing;
|
uint32 fspacing;
|
||||||
uint32 fface;
|
uint16 fface;
|
||||||
font_direction fdirection;
|
font_direction fdirection;
|
||||||
uint8 ftruncate;
|
uint8 ftruncate;
|
||||||
uint32 fencoding;
|
uint32 fencoding;
|
||||||
|
|
Loading…
Reference in New Issue