info-inventor-dev
[Top] [All Lists]

Problem when load font failed

To: info-inventor-dev@xxxxxxxxxxx
Subject: Problem when load font failed
From: Ang Bodhi <angbodhi@xxxxxxxxxxxxxx>
Date: Fri, 04 May 2001 02:52:34 +0800
Sender: owner-info-inventor-dev@xxxxxxxxxxx
Hi,

In SoText2.c++ and SoText3.c++, when no font (not even the default
Utopia-Regular)
are loaded successfully, some variables will be left unintialized, eg.
bitmapDict,
which when reference later will cause core dump. I encounter this
situation when
using libFL wrapper to FreeType and no TrueType fonts are found.

The following changes continue the initialization even when no fonts are
loaded.
In SoText2, the no valid font situation are also deteced by checking
fc->fontNumList.

Index: SoText2.c++
===================================================================
RCS file: /cvs/inventor/lib/database/src/so/nodes/SoText2.c++,v
retrieving revision 1.4
diff -r1.4 SoText2.c++
839a840
>  if (!fc->fontNumList) continue;
992d992
<      return;
1346a1347,1348
>     if (!fontNumList) return NULL;
>
2031a2034
>  if (!fc->fontNumList) continue;
2133d2135
<      return;
2461a2464,2465
>     if (!fontNumList) return NULL;
>

Index: SoText3.c++
===================================================================
RCS file: /cvs/inventor/lib/database/src/so/nodes/SoText3.c++,v
retrieving revision 1.6
diff -r1.6 SoText3.c++
1667d1666
<      return;
4279d4277
<      return;

Regards,
Ang Bodhi



<Prev in Thread] Current Thread [Next in Thread>
  • Problem when load font failed, Ang Bodhi <=