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:
@@ -67,7 +67,7 @@ Painter::Painter()
|
|||||||
fTextRenderer(new AGGTextRenderer()),
|
fTextRenderer(new AGGTextRenderer()),
|
||||||
fLastFamilyAndStyle(0)
|
fLastFamilyAndStyle(0)
|
||||||
{
|
{
|
||||||
if (fontserver)
|
if (fontserver && fontserver->GetSystemPlain())
|
||||||
fFont = *fontserver->GetSystemPlain();
|
fFont = *fontserver->GetSystemPlain();
|
||||||
|
|
||||||
_UpdateFont();
|
_UpdateFont();
|
||||||
@@ -1105,6 +1105,11 @@ Painter::_RebuildClipping()
|
|||||||
void
|
void
|
||||||
Painter::_UpdateFont()
|
Painter::_UpdateFont()
|
||||||
{
|
{
|
||||||
|
// TODO: temporary work arround until ServerFont
|
||||||
|
// is guaranteed to be valid.
|
||||||
|
if (fFont.InitCheck() < B_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fLastFamilyAndStyle != fFont.GetFamilyAndStyle()) {
|
if (fLastFamilyAndStyle != fFont.GetFamilyAndStyle()) {
|
||||||
fLastFamilyAndStyle = fFont.GetFamilyAndStyle();
|
fLastFamilyAndStyle = fFont.GetFamilyAndStyle();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user