Dekel Tsur <[EMAIL PROTECTED]> wrote:
> We need to change the internal text storage from 8-bit to 16/32-bit,
> before we can use such a patch.
Yes, I realize this (and called it 2. in the previous message.)
> We also want to be able to render simultaneously Japanese, Hebrew, Russia
> etc. Is it supported by Xlib? (i.e. does the XCreateOC call also load
> iso8859-n font if they are available?)
OK here is the official way to use multiple fontsets:
/// after calling XSetLocaleModifiers() etc.
string real_locale = "LC_CTYPE=" + getenv(LC_CTYPE);
putenv("LC_CTYPE=ja_JP");
XOM om_ja = XOpenOM(dpy, 0, 0, 0);
putenv("LC_CTYPE=he_IL");
XOM om_he = XOpenOM(dpy, 0, 0, 0);
putenv(real_locale.c_str());
/// Now this creates a XFontSet consists of
/// ISO8859-1, JISX0208.1983-0, JISX0201.1976-0 and possibly
/// JISX0212.1990-0
XOC oc_ja = XCreateOC(om_ja,
XNBaseFontName, "-*-*-*-*-*-*-12-*", NULL);
/// And this one creates a XFontSet consists of
/// ISO8859-8 (for ch <= 0x7f), and ISO8859-8 (for ch >= 0x80)
XOC oc_he = XCreateOC(om_he,
XNBaseFontName, "-*-*-*-*-*-*-12-*", NULL);
/// You can draw some texts
XmbDrawString(dpy, win, oc_, gc, x1, y1,
ja_text.c_str(), ja_text.length());
XmbDrawString(dpy, win, oc_, gc, x2, y2,
he_text.c_str(), he_text.length());
If _XOpenLC() is used, you don't have to change the environment variable:
XLCd lcd_ja = _XOpenLC("ja_JP");
XOM om_ja = lcd_ja->methods->open_om(dpy, 0, 0, 0);
XLCd lcd_he = _XOpenLC("he_IL");
XOM om_he = lcd_he->methods->open_om(dpy, 0, 0, 0);
/// etc. etc.
In case you want to create a custom XFontSet, please refer to
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg07891.html
Regards,
SMiyata