don't crash if the system fonts are not initialized

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12388 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2005-04-14 00:12:06 +00:00
parent bd841e3cd4
commit 8fdfa137d6
+6 -1
View File
@@ -67,7 +67,7 @@ Painter::Painter()
fTextRenderer(new AGGTextRenderer()),
fLastFamilyAndStyle(0)
{
if (fontserver)
if (fontserver && fontserver->GetSystemPlain())
fFont = *fontserver->GetSystemPlain();
_UpdateFont();
@@ -1105,6 +1105,11 @@ Painter::_RebuildClipping()
void
Painter::_UpdateFont()
{
// TODO: temporary work arround until ServerFont
// is guaranteed to be valid.
if (fFont.InitCheck() < B_OK)
return;
if (fLastFamilyAndStyle != fFont.GetFamilyAndStyle()) {
fLastFamilyAndStyle = fFont.GetFamilyAndStyle();