Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fallback fonts? remote display - xlib

5 views
Skip to first unread message

Riccardo Mottola

unread,
Jun 16, 2020, 12:54:14 PM6/16/20
to Discussion list for the GNUstep programming environment
Hi,

I launch an app on my Raspberry with xlib and remote display.

2020-06-16 10:40:33.831 ProjectCenter[29598:29598] No font cache
available - building new one - this may take several seconds (or minutes
on a slow machine with lots of fonts)
2020-06-16 10:40:33.834 ProjectCenter[29598:29598] Running
/GNUstep/System/Tools/font_cacher
2020-06-16 10:42:03.487 ProjectCenter[29598:29598] XGFont: selected
font: Helvetica at 12.000000 ((null)) is not available.
2020-06-16 10:42:03.488 ProjectCenter[29598:29598] The font specified
for NSFont, Helvetica, can't be found.
2020-06-16 10:42:03.488 ProjectCenter[29598:29598] XGFont: selected
font: Helvetica at 12.000000 ((null)) is not available.
2020-06-16 10:42:03.489 ProjectCenter[29598:29598] XGFont: selected
font: Helvetica at 12.000000 ((null)) is not available.
2020-06-16 10:42:03.489 ProjectCenter[29598:29598] XGFont: selected
font: Helvetica at 12.000000 ((null)) is not available.
2020-06-16 10:42:03.490 ProjectCenter[29598:29598] XGFont: selected
font: Courier at 12.000000 ((null)) is not available.
2020-06-16 10:42:03.491 ProjectCenter[29598:29598] XGFont: selected
font: Fixed at 12.000000 ((null)) is not available.

<<...>>

2020-06-16 10:42:04.267 ProjectCenter[29598:29598] NSFont.m:1513
Assertion failed in GSCInlineString(instance), method initWithCoder:.
Couldn't find a valid font when decoding.
2020-06-16 10:42:04.270 ProjectCenter[29598:29598] Exception occurred
while loading model: NSFont.m:1513 Assertion failed in
GSCInlineString(instance), method initWithCoder:. Couldn't find a valid
font when decoding.
2020-06-16 10:42:04.272 ProjectCenter[29598:29598] Failed to load Gorm

<<...>>

2020-06-16 10:42:04.342 ProjectCenter[29598:29598] XGFont: selected
font: Fixed at 12.000000 ((null)) is not available.
Segmentation fault

now.. I wonder why? I launched "xfontsel" on the raspberry.
Am I right to assume that the fonts seen there are the one availbale to
the backend too?

I see Helvetica, e.g.:

-*-helvetica-*-r-*-*-12-*-*-*-*-*-*-*

-*-courier-*-r-*-*-12-*-*-*-*-*-*-*

what am I missing?

Riccardo


Fred Kiefer

unread,
Jun 17, 2020, 2:11:19 PM6/17/20
to Discussion list for the GNUstep programming environment
Have a look into the font cache file to see which fonts are detected. maybe you should delete that file and have it recreated.
As you know the xlib backend is no longer supported especially not the XGFont class. You should check, why no better font support is found.

Riccardo Mottola

unread,
Jun 17, 2020, 6:53:51 PM6/17/20
to Fred Kiefer, Discussion list for the GNUstep programming environment
Hi,

Fred Kiefer wrote:
> Have a look into the font cache file to see which fonts are detected. maybe you should delete that file and have it recreated.
> As you know the xlib backend is no longer supported especially not the XGFont class. You should check, why no better font support is found.

after a long evening of hacking, I print out the results so we can keep
track of them.

font_cacher already generates a cache were several font names and font
families are wrong! e.g. "Helvetica" is written as "HelveticA".

The issues are between XGFontPropString, which gets it and makes it
lowercase and XGFontFamily, which capitalizes it.

Debugging with thousands of fonts is hard, so I put some code to debug
"Helvetica" and this is what I found out:

NSLog(@"|%s! |%@|", value, ret);
NSLog(@"capitalized: %@", [ret capitalizedString]);

2020-06-17 22:40:32.606 font_cacher[16321:100855] |Helvetica! |helvetica|
2020-06-17 22:40:32.608 font_cacher[16321:100855] capitalized: HelveticA

Here, the C string looks sane, the lowercase string too, but the
capitalized string is totally bogus!

if I cycle and print out the bytes of the C string they look fine:

H 48
e 65
l 6c
v 76
e 65
t 74
i 69
c 63
a 61


A bug! but where? in NSString? a short test case:

s = [[NSString stringWithCString:"Helvetica"] lowercaseString];
NSLog(@"%@ - %@", s, [s capitalizedString]);


which I suppose should be equivalent... works perfectly.

I'm a bit clueless now.


Riccardo

Riccardo Mottola

unread,
Jun 22, 2020, 5:47:24 PM6/22/20
to Fred Kiefer, Discussion list for the GNUstep programming environment
Hi All!
I admit I did not expect an overwhelming number of replies, still... a hint.
I went further though. I thought to see exactly what comes in into
NSString's capitalizedString.

First question is... how to print out an unichar in NSLog? %c? or %C?
I get the same results with both:

2020-06-22 21:43:30.598 font_cacher[22429:100817] capitalizing:
semicondensed
2020-06-22 21:43:30.598 font_cacher[22429:100817] capitalizing: |s|
2020-06-22 21:43:30.598 font_cacher[22429:100817] capitalizing: |e|
2020-06-22 21:43:30.599 font_cacher[22429:100817] capitalizing: |c|
2020-06-22 21:43:30.599 font_cacher[22429:100817] capitalizing: |n|
2020-06-22 21:43:30.625 font_cacher[22429:100817] capitalizing: fixed
2020-06-22 21:43:30.625 font_cacher[22429:100817] capitalizing: |f|
2020-06-22 21:43:30.625 font_cacher[22429:100817] capitalizing: |i|


I am printing out the string itself before, then any character before
the conversion.

It seems some skipping occours?

Riccardo Mottola

unread,
Jun 25, 2020, 12:03:10 PM6/25/20
to Fred Kiefer, Discussion list for the GNUstep programming environment
Hi all!

all is well what ends well.... after debugging, I convinced myself of an
error in Base.. made some test cases and proved it.

Richard fixed it and now the Xlib backend font_cacher works again smooth
as it should!

Riccardo
0 new messages