Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!uunet!leafusa!io!bcking From: bcking@io.UUCP (Christine King x4426) Newsgroups: comp.windows.x Subject: X Fonts: 2Byte vs. 16Bit Keywords: font,byte order,2byte Message-ID: <1681@io.UUCP> Date: 2 Aug 90 15:00:45 GMT Distribution: comp Organization: Interleaf Inc, Cambridge, MA Lines: 41 I'm having a problem with 2byte fonts in X, and I hope somebody can help. We are an application (Interleaf) that has to run on various kinds of clients and servers, some of which have "Motorola" byte-order and some "VAX" byte-order. The important difference for this problem is the representation of a short int: Motorola's are like 00 41, where the 00 is the high-order byte but the lower address; VAX's are like 41 00. (I think I have that right. If not, I'm sure I'll get flamed. Anyway, the two are the reverse of each other, which is what matters here.) For X 2byte fonts, we use arrays of "short" to represent strings of character codes. In the Motorola case, for a particular font that has an "A" in position 0041, the "A" is displayed. In the VAX case, I have to swap the bytes of the code to get the "A". This is all as described in Scheifler/Gettys/Newman "X Window System". Howevermuch of a Pain-in-the-Neck this swapping is, I accept it because it's documented. But: Scheifler/Gettys/Newman also mention "16bit fonts" in several places, which seem to be a different thing from "2byte fonts". Do 16-bit fonts really exist in X? Are they (in the VAX case) differently indexed than 2-byte fonts? Are the BDF descriptions different from a 2byte font? Could I use the same code (no swapping), and the same BDF fontfiles for Motorola and for VAX? Note that it is a client-side application problem to get the byte-order correct for a 2byte font. For a 16bit font, however, I think it would be a client-side X-implementation problem. Surely the server need make no distinction between a 2byte and a 16bit font, particularly since there is no difference for a Motorola server. -- --Christine King (bcking@ileaf.com)