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: Mon, 22 Jun 2020 23:47:16 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.2

Hi All!

Riccardo Mottola 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.


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?



reply via email to

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