Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Variations of "fixed" font using Xlib?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
Zurg11
Posts: 11
Joined: 2019-03-21 07:21

[SOLVED] Variations of "fixed" font using Xlib?

#1 Post by Zurg11 »

Hello :) :) :) !

I have recently started programming using Xlib and C. As you probably already know, to specify that you want your application to use default font you set font to "fixed", like this

Code: Select all

font = XLoadQueryFont(display, "fixed");
But how can I get variations of that font, like bold, italic and bold italic?

I have tried specifying this string instead of "fixed".

Code: Select all

-*-*-*-*-normal-*-*-*-*-*-*-*-*-*
or

Code: Select all

-*-fixed-*-*-normal-*-*-*-*-*-*-*-*-*
(This is X logical font description.)
But it didn't work, text didn't show up. I thought that if I can specify "fixed" font like this that I can later change 3th field to "bold", 4th to "italic" and so on.
Last edited by Zurg11 on 2019-06-06 18:32, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Variations of "fixed" font using Xlib?

#2 Post by Head_on_a_Stick »

Try using this to get a correct name:

Code: Select all

xfontsel
https://packages.debian.org/stretch/x11-utils

This seems to be valid (but with a limited size selection available):

Code: Select all

-*-fixed-bold-*-*-*-*-*-*-*-*-*-*-*
deadbang

Zurg11
Posts: 11
Joined: 2019-03-21 07:21

Re: Variations of "fixed" font using Xlib?

#3 Post by Zurg11 »

Head_on_a_Stick wrote:Try using this to get a correct name:

Code: Select all

xfontsel
https://packages.debian.org/stretch/x11-utils

This seems to be valid (but with a limited size selection available):

Code: Select all

-*-fixed-bold-*-*-*-*-*-*-*-*-*-*-*
Thanks for the help, that does work if I replace "bold" with "medium". But it doesn't work with "bold" because it seems that bold variation does not exist on this system ("bold" field is grayed out in xfontsel) for some reason. Is that normal? How can I install bold variation?

Zurg11
Posts: 11
Joined: 2019-03-21 07:21

Re: Variations of "fixed" font using Xlib?

#4 Post by Zurg11 »

Zurg11 wrote:
Head_on_a_Stick wrote:Try using this to get a correct name:

Code: Select all

xfontsel
https://packages.debian.org/stretch/x11-utils

This seems to be valid (but with a limited size selection available):

Code: Select all

-*-fixed-bold-*-*-*-*-*-*-*-*-*-*-*
Thanks for the help, that does work if I replace "bold" with "medium". But it doesn't work with "bold" because it seems that bold variation does not exist on this system ("bold" field is grayed out in xfontsel) for some reason. Is that normal? How can I install bold variation?
Nah it's okay, I was wrong :| :| :| .

Post Reply