c - 使用 XDrawString 垂直显示文本

标签 c linux xlib motif

我正在使用 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/

相关文章:

c - 如何在 OpenMP 中使用归约 vector 变量?

c - pragma omp for/parallel 不起作用?

linux - 如何在redhat linux上安装maven

image - 煤层气图像文件格式: what is it?怎么读呢?

c - 同时访问一个 c union 的不同成员

C# - C 互操作性

c - flushall() 和 _flushall() 之间的区别

linux - 是否可以将输入传递给正在运行的服务或守护进程?

c - Linux 将虚拟内存范围映射到现有的虚拟内存范围?

c - 使用根 X11 窗口作为 SDL2 主窗口