Font substitution crash in Linux
Chris Double
chris at double.co.nz
Fri Jul 24 03:26:35 UTC 2009
I sometimes get a crash in the UI running under Linux due to a font
not being available. The crash prints in the console:
Error: could not load substitute font:
-*-times-medium-r-normal--9-*-*-*-*-*-*-*.
Receiver is: a x11Globals fontDictionary.
UI step failed twice in Self 1(type: worldMorph) -- starting debugger
in new world
Could not open display "localhost:0.0", error: primitiveFailedError
1. Try Again
2. Try Local Display
3. Give Up
[Type the number of your selection]
None of the available options allow resuming since the same error
continuously occurs. It seems that the requested font is not available
in the size of 9 points,
The easiest way I can reproduce it is to evaluate something like 'foo'
in a shell in the UI, where 'foo' does not exist. The debugger pops up
and expanding the stack causes the error.
As a temporary workaround I modified the method
'structForFontSpec:WindowCanvas:' in 'traits xFontDictionary' so that
when it tries to use the substitute font it specifically uses a size
of '10' - one I know that exists on my system.
- substituteName: (fullNameFor: x11Globals scalableFont times Size:
fSpec size).
+ substituteName: (fullNameFor: x11Globals scalableFont times Size: 10).
This stops the crash and lets me use the debugger and other tools (The
inspectors in the Smalltalk application),
Chris.
--
http://www.bluishcoder.co.nz
More information about the Self-interest
mailing list