Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!oliveb!sun!eureka!argv From: argv%eureka@Sun.COM (Dan Heller) Newsgroups: comp.windows.x Subject: Rotated text Message-ID: <105466@sun.Eng.Sun.COM> Date: 17 May 89 23:58:32 GMT Sender: news@sun.Eng.Sun.COM Reply-To: argv@sun (Dan Heller) Organization: Island Graphics Corporation Lines: 36 Now that I'm talking about fonts, inspection of the code *appears* to be just shy of giving XDrawString the ability to render rotated text. The following changes would need to happen: there needs to be a height field in the XCharStruct data structure, and there needs to be an ability to communicate this new information about the font changes to the server. The application is responsible for rotating the glyphs of the characters, of course. typedef struct { short lbearing; /* origin to left edge of raster */ short rbearing; /* origin to right edge of raster */ short width; /* advance to next char's origin */ /+ short height; /* advance to next y coord */ +/ short ascent; /* baseline to top edge of raster */ short descent; /* baseline to bottom edge of raster */ unsigned short attributes; /* per char flags (not predefined) */ } XCharStruct; Here, the "width" is currently used to move the position of the next x coord for rendering the next character. However, the y coord stays the same. I don't see a requirement that this has to be this way -- with the "height" parameter, the next char's origin can be moved up or down as well. If the application chooses to not rotate the glyphs, the the characters rendered may have a stepping stone effect. With negative values in the height and width fields, the text may be rendered from right to left. Affected called would include all the routines which would get the geometry of a string including the bounding boxes, text width and height, etc... Feedback? dan dan