Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!SW.MCC.COM!peterson From: peterson@SW.MCC.COM (James Peterson) Newsgroups: comp.windows.x Subject: PolyText8 request. Message-ID: <8809022239.AA04721@cleo.sw.mcc.com> Date: 2 Sep 88 22:39:08 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 27 The PolyText8 command is defined in the X Protocol document (page 126) as follows Byte 0: 74 opcode Byte 1: unused Byte 2-3 4+(n+p)/4 request length Byte 4-7 DRAWABLE drawable Byte 8-11 GCONTEXT gc Byte 12-13 INT16 x Byte 14-15 INT16 y Byte 16-16+n-1 LISTofTEXTITEM8 items Byte 16+n-16+n+p padding A comment indicates that the number of bytes (p) of padding is always 0 or 1. How can this be? A TEXTITEM8 is a 1-byte length (m), followed by a 1-byte delta and m bytes of data. Assume that m is 3. Then the TEXTITEM8 is: Byte 16: 3 length Byte 17: 0 delta Byte 18: "a" Byte 19: "b" Byte 20: "c" Now we need 3 bytes of padding (bytes 21, 22, 23) to get up to a multiple of 4 bytes in the request. How do we know the number of items in the list? jim