Menu

#864 16-bit X11 fonts not correctly displayed

final: 8.1.1
closed-fixed
5
2001-04-05
2000-11-01
No

OriginalBugID: 2349 Bug
Version: 8.1.1
SubmitDate: '1999-07-16'
LastModified: '2000-04-16'
Severity: MED
Status: UnAssn
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 4071
OS: Linux
OSVersion: Debian 1.3
Machine: Other

Name:
Claude Barras

ObservedBehavior:
I have tested the unicode font proposed by Scriptics's Howto
on Internationalization:
http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
I have met various problems in displaying this font with Tcl/Tk 8.1.1
under X11 (platform: Linux/i86 + XFree) related to
tk8.1.1/unix/tkUnixFont.c

Detection of 16-bit X11 fonts does not work correctly; I guess
something like the following should be done:
l. 1464
< familyPtr->isTwoByteFont = (fontStructPtr->min_byte1 > 0);
> familyPtr->isTwoByteFont = (fontStructPtr->max_byte1 > 0);

I think there should be an extension of encodingAliases[] for 16-bit
unicode coded fonts, e.g.:
l. 176:
> {"unicode", "iso10646*"},

l. 23: "unicode" could perhaps be added to the encodingList ? I don't
know
if it is important.

With these modifs, 16-bit fonts are recognized, but there is clearly
a problem of byte swapping. e.g., \u0201 is displayed instead of
\u0102.
The problem could be that XChar2b natural byte order is not the one
returned by the "unicode" encoding ? With xfd, chars are displayed at
the correct position.
All calls to XTextWidth16/XDrawString16 are potentially concerned,
and also perhaps the FontMapLoadPage function lines 1830-1831:
hi = ((unsigned char *) buf)[0];
lo = ((unsigned char *) buf)[1];

Anyway, even when trying to add byte swapping at various places,
I couldn't manage to make it work as I think it should...

PatchFiles:
unix/tkUnixFont.c

Discussion

  • Don Porter

    Don Porter - 2001-03-25
    • labels: 104339 --> 46. Unix Fonts
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-04-05
    • assigned_to: nobody --> hobbs
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-04-05

    Logged In: YES
    user_id=72656

    Fixed by patch in 406411, for 8.3.3/8.4a3.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-04-05
    • status: open --> closed-fixed