Font metrics and kerning

Russell Shaw rjshaw at
Mon Sep 26 09:00:48 PDT 2005

How do X toolkits do accurate pos(x,y) to character string
hit testing in text widgets?

Looking thru Xaw code, it looks like only XCharStruct is

typedef struct {
             short lbearing;          /* origin to left edge of raster */
             short rbearing;          /* origin to right edge of raster */
             short width;             /* advance to next char's origin */
             short ascent;            /* baseline to top edge of raster */
             short descent;           /* baseline to bottom edge of raster */
             unsigned short attributes;/* per char flags (not predefined) */
} XCharStruct;

But this does not have kerning information to allow you to
calculate accurate text widths. Does X core fonts even do
kerning at all?

More information about the xorg mailing list