Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Klugier is currently offline  Klugier
Messages: 639
Registered: September 2012
Location: Poland, Kraków
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


Ultimate++ - 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 #40120 is a reply to message #40061] Sat, 15 June 2013 13:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
It looks like fontconfig actually defines constants for this (FC_WEIGHT_NORMAL, FC_WEIGHT_BOLD), unfortunately these seem to be 100 and 200 on my machine. Other opensource seems to use these constants as well....

Can you check please?
Re: [X11 Font problems - Bug?] FC_WEIGHT is too big. [message #40121 is a reply to message #40120] Sat, 15 June 2013 17:45 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 639
Registered: September 2012
Location: Poland, Kraków
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


Ultimate++ - one framework to rule them all.

[Updated on: Sun, 16 June 2013 01:23]

Report message to a moderator

Re: [X11 Font problems - Bug?] FC_WEIGHT is too big. [message #40130 is a reply to message #40121] Mon, 17 June 2013 20:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
klugier wrote on Sat, 15 June 2013 11:45

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:



I have already did that...

Mirek
Re: [X11 Font problems - Bug?] FC_WEIGHT is too big. [message #40134 is a reply to message #40130] Tue, 18 June 2013 12:59 Go to previous message
Klugier is currently offline  Klugier
Messages: 639
Registered: September 2012
Location: Poland, Kraków
Contributor
Hello Mirek,

We can also patch italic part (DrawTextX11.cpp - Line 25):

FcPatternAddInteger(p, FC_SLANT, font.IsItalic() ? FC_SLANT_ITALIC : FC_SLANT_ROMAN);


Sincerely,
Klugier


Ultimate++ - one framework to rule them all.
Previous Topic: Smtp: compiling error in smtp.h
Next Topic: [Win32 - FileSel - System Places Improvement] - Disk name
Goto Forum:
  


Current Time: Sun Nov 17 01:24:36 CET 2019

Total time taken to generate the page: 0.02908 seconds