Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [FIXED] FC_WEIGHT is too big.
[FIXED] FC_WEIGHT is too big. [message #40061] |
Fri, 31 May 2013 20:39 |
|
Klugier
Messages: 1082 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
In my opinion, normal fonts is too bolded on X11 operating systems. We need to change FC_WEIGHT factor. Now, It is too big. I have enclose patch code (DrawTextX11.cpp - Line 27):
FcPatternAddInteger(p, FC_WEIGHT, font.IsBold() ? 160 : 80);
Insted of:
FcPatternAddInteger(p, FC_WEIGHT, font.IsBold() ? 200 : 100);
As You can see, I had shrunk two values about 20%. I had choosen this value, because 80 is maximum value for not bolded fonts. If We select bigger value. Letters such as: "j" or "y" will have problems with tails on some desktop enviroments like KDE when GTK backend is on. The first value for "real" bolded texts is only smaller proportionally and It can be bigger.
I have enclosed demonstrative images.
P.S.
Ubuntu problem with bold text after this patch will be history.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 30 June 2013 16:27] Report message to a moderator
|
|
|
|
Re: [X11 Font problems - Bug?] FC_WEIGHT is too big. [message #40121 is a reply to message #40120] |
Sat, 15 June 2013 17:45 |
|
Klugier
Messages: 1082 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I have made simply test:
Cout () << "FC_WEIGHT_NORMAL: " << FC_WEIGHT_NORMAL << "\n";
Cout () << "FC_WEIGHT_BOLD: " << FC_WEIGHT_BOLD << "\n";
The return values for Kubuntu 13.04 is
FC_WEIGHT_NORMAL: 80
FC_WEIGHT_BOLD: 200
It seems that 80 constant for FC_WEIGHT_NORMAL looks ok and 100 is too high. On the other hand, 160 constant for bold fonts is too low.
I am not sure, but why we can't replace this line using FC_WEIGHT_NORMAL and FC_WEIGHT_BOLD constants? I have enclosed sample code:
FcPatternAddInteger(p, FC_WEIGHT, font.IsBold() ? FC_WEIGHT_BOLD : FC_WEIGHT_NORMAL);
P.S.
On Ubuntu 13.04 values are the same.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 16 June 2013 01:23] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 05:35:28 CEST 2024
Total time taken to generate the page: 0.02803 seconds
|