| Ticket UUID: | 1151700 | |||
| Title: | XIM input box font size hard coded | |||
| Type: | Bug | Version: | obsolete: 8.4.9 | |
| Submitter: | lvirden | Created on: | 2005-02-25 11:40:47 | |
| Subsystem: | 69. Events | Assigned To: | jenglish | |
| Priority: | 5 Medium | Severity: | ||
| Status: | Open | Last Modified: | 2026-09-19 11:19:30 | |
| Resolution: | None | Closed By: | ||
| Closed on: | ||||
| Description: |
In using XIM on SPARC Solaris, with kinput2, it was
discovered that kinput2's font size is based on the
font of the top level used to contain the input entry
box. The Tk code affected is in tkEvent.c:
>
> if (dispPtr->inputXfs == NULL) {
> /*
> * We only need to create one
XFontSet
> */
> char **missing_list;
> int missing_count;
> char *def_string;
>
> dispPtr->inputXfs =
> XCreateFontSet(dispPtr->display,
>
"-*-*-*-R-Normal--14-130-75-75-*-*",
> &missing_list,
> &missing_count, &def_string);
> if (missing_count > 0) {
>
XFreeStringList(missing_list);
> }
> }
>
where the fontset is hard coded.
So for a user to change the font size, they have to
rebuild Tk!
The developer who researched this wrote:
>
> My thoughts on this would be to extend the tk
> useinputmethods command > (<http://wiki.tcl.tk/8695>,
>
<http://www.tcl.tk/man/tcl8.4/TkCmd/tk.htm>) to
something like this:
tk useinputmethods?-displayof window?
?-preeditfont fontset?
#example -preeditfont
'-*-*-*-R-Normal--24-230-75-75-*-*'
?-style style?
#choices: root, over
?boolean?
where the ones with comments are new. The argument
fontset to
-preeditfont would be any string that can be passed to
XCreateFontSet()
(<http://www.xfree86.org/4.1.0/XCreateFontSet.3.html>).
I was thinking about a sample implementation, but I
haven't had a chance to do more than think. In
particular, I haven't checked whether the fontset can
be changed dynamically with XSetICValues()
(<http://www.xfree86.org/current/XSetICValues.3.html>).
A simpler mechanism, like a new resource, is probably
more feasible.
| |||
| User Comments: |
serhiy.storchaka added on 2026-09-19 09:13:52:
Still current, and more important on high-resolution displays: the ibus XIM server offers XIMPreeditPosition, so the composing text is drawn with Tk's hard-coded 14-pixel font set, which is tiny next to a widget font scaled for the screen. Fix in branch [c125ceaa3a]: the font set is chosen by the pixel size of the widget's line height, reported by Tk_SetCaretPos(), and cached per display. jenglish added on 2005-12-17 02:35:30: Logged In: YES user_id=68433 I wrote: > XIM clients don't need to set XNFontSet at all [...] Apparently not true: kinput2 (at least) needs this to be set if XIMPreeditPosition is selected, otherwise XCreateIC returns NULL. Nevermind. jenglish added on 2005-12-17 01:34:03: Logged In: YES user_id=68433 According to the Xlib programmer's manual, XIM clients don't need to set XNFontSet at all; if one isn't provided, the IM server will use a suitable default. This might be a better approach; the IM server will probably have a much better idea of what font(s) to use than Tk or the application programmer will. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki