Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

xlib xft antialiased fonts in c

 
   Soft32 Home -> Linux -> X Window System RSS
Next:  Current FSB speed  
Author Message
Yoshi Rokuko

External


Since: Nov 16, 2008
Posts: 1



(Msg. 1) Posted: Sun Nov 16, 2008 10:25 am
Post subject: xlib xft antialiased fonts in c
Archived from groups: comp>os>linux>x (more info?)

hey!

is there a good howto with examples on using xft antialiased and colored
fonts in xlib with c?

i have http://keithp.com/~keithp/render/Xft.tutorial, but some examples
would be nice too ...

the following gives me black font:

#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
[...]

struct {
GC blue;
GC gray;
} gc; /* grafical contexts */
XftFont *xftfont;
XftDraw *draw;
XftColor color;
char *msg = "789,34 £ |@~½¾²³";
[...]

xftfont = XftFontOpen(dpy, scr,
XFT_FAMILY, XftTypeString, "dejavuserifcondensed",
XFT_SIZE, XftTypeDouble, 98.0,
NULL);

/* Set the color to black */
color.color.red = 0;
color.color.green = 0;
color.color.blue = 0;
color.color.alpha = 0xffff; //USHRT_MAX;

draw = XftDrawCreate(dpy, win, DefaultVisual(dpy, scr), cmap);

but how do i get i.e. something like

XAllocNamedColor(dpy, cmap, "#4c7899", &blue, &blue)

for the xft fonts?

thank you in advance
y0shi

--
psyc://nemesis.psyc.biz/~y0shi
http://psyc.biz/y0shi_public.ke
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[gentoo-user] Question about /etc/fonts/fonts.conf: How to.. - Hi, I've read the http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts HOWTO. As I'm now a LCD screen user, I wanted to enable..

[gentoo-user] xorg-x11: truetype-fonts vs. type1-fonts - Are the USE flags 'truetype-fonts' and 'type1-fonts' in xorg-x11 meant to be substitutes for each other? I'm running..

[gentoo-dev] Last rites: media-fonts/artwiz-fonts - # Ryan Hill <dirtyepic@gentoo.org> (23 Jul 2007) # duplicated by media-fonts/artwiz-aleczapka-en. use that inste...

[gentoo-user] how could I make Eterm fonts look like xterm.. - I love the spiffy look of the Eterm, and it seems pretty fast with bash_completion, so I really tried to customize it t...

[gentoo-user] Xlib problem - Trying to execute an X application as root, from some time now I'm getting this messages: Xlib: connection to ":0...

Xlib: connection to ":0.0" refused by server - I have Redhat linux 9. After changing the host name via the command "hostname", every GUI application I try t...
       Soft32 Home -> Linux -> X Window System All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]