[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xterm with combining characters



Markus Kuhn writes:

> At the moment, the fixed fonts have spacing combining characters, i.e.,
> every combining character is as wide as a normal character. Some other
> proportional fonts (e.g., those by B&H and Mark Leisher) have zero-width
> combining characters with link left of the origin. I am wondering,
> whether I should also do this for the fixed fonts.

For non-proportional fonts, this makes sense. Looking at Xlib.h and
the implementation of XTextExtents,

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;

I conclude that the existing text output routines will do the right thing
if you define   lbearing < rbearing <= 0, width = 0  for a combining,
nonspacing character.

For a proportional font it's more tricky to place an accent over the
center of a character which can be as wide as an 'm' or as thin as an 'i'...

Bruno
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/