* Removed dead code.

* Fixed line lengths.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28102 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-10-14 19:48:35 +00:00
parent f6bffd4e5b
commit 73be167630
2 changed files with 19 additions and 38 deletions
+8 -27
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku.
* Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -25,10 +25,11 @@ static BLocker sFontLock("font lock");
/*!
\brief Constructor
\param filepath path to a font file
\param face FreeType handle for the font file after it is loaded - it will be kept open until the FontStyle is destroied
\param face FreeType handle for the font file after it is loaded - it will
be kept open until the FontStyle is destroyed
*/
FontStyle::FontStyle(node_ref& nodeRef, const char* path, FT_Face face)
: //BLocker(BString("FontStyle_").Append(face->style_name).String()),
:
fFreeTypeFace(face),
fName(face->style_name),
fPath(path),
@@ -74,7 +75,8 @@ FontStyle::Hash() const
bool
FontStyle::CompareTo(Hashable& other) const
{
// our hash values are unique (unless you have more than 65536 font families installed...)
// our hash values are unique (unless you have more than 65536 font
// families installed...)
return Hash() == other.Hash();
}
@@ -103,7 +105,7 @@ FontStyle::GetHeight(float size, font_height& height) const
/*!
\brief Returns the path to the style's font file
\brief Returns the path to the style's font file
\return The style's font file path
*/
const char*
@@ -153,7 +155,7 @@ FontStyle::Flags() const
/*!
\brief Updates the given face to match the one from this style
The specified font face often doesn't match the exact face of
a style. This method will preserve the attributes of the face
that this style does not alter, and will only update the
@@ -194,27 +196,6 @@ FontStyle::UpdateFace(FT_Face face)
}
/*!
\brief Converts an ASCII character to Unicode for the style
\param c An ASCII character
\return A Unicode value for the character
*/
// TODO: Re-enable when I understand how the FT2 Cache system changed from
// 2.1.4 to 2.1.8
/*
int16
FontStyle::ConvertToUnicode(uint16 c)
{
FT_Face f;
if(FTC_Manager_LookupFace(ftmanager,(FTC_FaceID)cachedface,&f)!=0)
return 0;
return FT_Get_Char_Index(f,c);
}
*/
void
FontStyle::_SetFontFamily(FontFamily* family, uint16 id)
{
+11 -11
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2006, Haiku.
* Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -50,13 +50,14 @@ class FontKey : public Hashable {
/*!
\class FontStyle FontStyle.h
\brief Object used to represent a font style
FontStyle objects help abstract a lot of the font engine details while
still offering plenty of information the style in question.
*/
class FontStyle : public ReferenceCounting, public Hashable/*, public BLocker*/ {
class FontStyle : public ReferenceCounting, public Hashable {
public:
FontStyle(node_ref& nodeRef, const char* path, FT_Face face);
FontStyle(node_ref& nodeRef, const char* path,
FT_Face face);
virtual ~FontStyle();
virtual uint32 Hash() const;
@@ -73,7 +74,8 @@ class FontStyle : public ReferenceCounting, public Hashable/*, public BLocker*/
\return true if fixed, false if not
*/
bool IsFixedWidth() const
{ return fFreeTypeFace->face_flags & FT_FACE_FLAG_FIXED_WIDTH; }
{ return fFreeTypeFace->face_flags
& FT_FACE_FLAG_FIXED_WIDTH; }
/* \fn bool FontStyle::IsFullAndHalfFixed()
\brief Determines whether the font has 2 different, fixed, widths.
@@ -88,14 +90,16 @@ class FontStyle : public ReferenceCounting, public Hashable/*, public BLocker*/
\return true if scalable, false if not
*/
bool IsScalable() const
{ return fFreeTypeFace->face_flags & FT_FACE_FLAG_SCALABLE; }
{ return fFreeTypeFace->face_flags
& FT_FACE_FLAG_SCALABLE; }
/*!
\fn bool FontStyle::HasKerning(void)
\brief Determines whether the font has kerning information
\return true if kerning info is available, false if not
*/
bool HasKerning() const
{ return fFreeTypeFace->face_flags & FT_FACE_FLAG_KERNING; }
{ return fFreeTypeFace->face_flags
& FT_FACE_FLAG_KERNING; }
/*!
\fn bool FontStyle::HasTuned(void)
\brief Determines whether the font contains strikes
@@ -151,10 +155,6 @@ class FontStyle : public ReferenceCounting, public Hashable/*, public BLocker*/
status_t UpdateFace(FT_Face face);
// TODO: Re-enable when I understand how the FT2 Cache system changed from
// 2.1.4 to 2.1.8
// int16 ConvertToUnicode(uint16 c);
private:
friend class FontFamily;
uint16 _TranslateStyleToFace(const char *name) const;