Quick and dirty hack to let those font rendering problems disappear - I don't really
know what's going on, but this appears to fix it. And since we'll get a new glyph layout backend sooner or later, I don't want to mess with that stuff again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15176 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -66,7 +66,7 @@ class FontKey : public Hashable {
|
|||||||
FontStyle objects help abstract a lot of the font engine details while
|
FontStyle objects help abstract a lot of the font engine details while
|
||||||
still offering plenty of information the style in question.
|
still offering plenty of information the style in question.
|
||||||
*/
|
*/
|
||||||
class FontStyle : public ReferenceCounting, public Hashable, public BLocker {
|
class FontStyle : public ReferenceCounting, public Hashable/*, public BLocker*/ {
|
||||||
public:
|
public:
|
||||||
FontStyle(node_ref& nodeRef, const char* path, FT_Face face);
|
FontStyle(node_ref& nodeRef, const char* path, FT_Face face);
|
||||||
virtual ~FontStyle();
|
virtual ~FontStyle();
|
||||||
@@ -76,6 +76,9 @@ class FontStyle : public ReferenceCounting, public Hashable, public BLocker {
|
|||||||
|
|
||||||
const node_ref& NodeRef() const { return fNodeRef; }
|
const node_ref& NodeRef() const { return fNodeRef; }
|
||||||
|
|
||||||
|
bool Lock();
|
||||||
|
void Unlock();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool FontStyle::IsFixedWidth(void)
|
\fn bool FontStyle::IsFixedWidth(void)
|
||||||
\brief Determines whether the font's character width is fixed
|
\brief Determines whether the font's character width is fixed
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
const uint32 kInvalidFamilyFlags = ~0UL;
|
const uint32 kInvalidFamilyFlags = ~0UL;
|
||||||
|
|
||||||
|
static BLocker sFontLock("font lock");
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
font_score(const FontStyle* style)
|
font_score(const FontStyle* style)
|
||||||
@@ -56,7 +58,7 @@ compare_font_styles(const FontStyle* a, const FontStyle* b)
|
|||||||
\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 destroied
|
||||||
*/
|
*/
|
||||||
FontStyle::FontStyle(node_ref& nodeRef, const char* path, FT_Face face)
|
FontStyle::FontStyle(node_ref& nodeRef, const char* path, FT_Face face)
|
||||||
: BLocker(BString("FontStyle_").Append(face->style_name).String()),
|
: //BLocker(BString("FontStyle_").Append(face->style_name).String()),
|
||||||
fFreeTypeFace(face),
|
fFreeTypeFace(face),
|
||||||
fName(face->style_name),
|
fName(face->style_name),
|
||||||
fPath(path),
|
fPath(path),
|
||||||
@@ -107,6 +109,20 @@ FontStyle::CompareTo(Hashable& other) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
FontStyle::Lock()
|
||||||
|
{
|
||||||
|
return sFontLock.Lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
FontStyle::Unlock()
|
||||||
|
{
|
||||||
|
return sFontLock.Unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
FontStyle::GetHeight(float size, font_height& height) const
|
FontStyle::GetHeight(float size, font_height& height) const
|
||||||
{
|
{
|
||||||
@@ -171,7 +187,7 @@ FontStyle::PreservedFace(uint16 face) const
|
|||||||
status_t
|
status_t
|
||||||
FontStyle::UpdateFace(FT_Face face)
|
FontStyle::UpdateFace(FT_Face face)
|
||||||
{
|
{
|
||||||
if (!IsLocked()) {
|
if (!sFontLock.IsLocked()) {
|
||||||
debugger("UpdateFace() called without having locked FontStyle!");
|
debugger("UpdateFace() called without having locked FontStyle!");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user