discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fallback fonts? remote display - xlib


From: Riccardo Mottola
Subject: Re: fallback fonts? remote display - xlib
Date: Thu, 18 Jun 2020 00:49:06 +0200
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 SeaMonkey/2.53.2

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]