我正在使用 XDrawString 在绘图区域显示文本。默认情况下,这似乎是从左到右水平显示文本。
谁能告诉我如何使用这个库函数从上到下或从下到上垂直旋转和显示文本。
在此先感谢您的帮助。
最佳答案
您需要为每个字符调用一次,在 Xlib 中没有可以绘制旋转字符串的单一函数。 Here's a quote from the Programming Manual :
Vertical Text and Rotated Text
Xlib provides routines that draw horizontal strings, but not vertical ones. If you want to draw strings vertically that read normally, you need to use a separate text drawing call for each character. You use a baseline with the same x coordinate but a different y coordinate for each character.
关于c - 使用 XDrawString 垂直显示文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21984286/