如何在 OpenOffice 中设置 TextTable 单元格的文本方向?
我想设置 TextTable 中某些单元格的文本方向,使它们是垂直的(即文本是横向而不是纵向)。 您可以在 Writer 中通过选择单元格来执行此操作,然后转到: 表 - 文本属性 - 文本流 - 文本方向
但是,我不知道如何通过 API 执行此操作。 我尝试使用 CharRotation,但它的行为不正确。 CharRotation 只是获取文本并旋转它(不调整任何格式)。 我正在处理的文本是按制表位格式化的,并且以这种方式旋转时行为不正确。
I want to set the text direction for some cells in a TextTable so that they are vertical (i.e., the text is landscape instead of portrait).
You can do this in Writer by selecting the cell(s), and going to:
Table - Text Properties - Text Flow - Text Direction
However, I cannot figure out how to do this through the API. I tried using CharRotation, but it does not behave the right way. CharRotation simply takes the text, and rotates it (without adjusting any formatting). The text I am dealing with is formatted by tab stops, and does not behave correctly when rotated this way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过这几个月我终于想通了!
您必须设置单元格的“WritingMode”属性。 在 C# 中:
我还没有在 python 中尝试过,但我想它会是这样的:
如果您使用的是静态类型语言,请确保将其转换为 Short。 由于某些奇怪的原因,执行
typeof(WritingMode)
不起作用。请参阅 OOo 错误跟踪器中的此问题。
I finally figured this out after all these months!
You have to set the "WritingMode" property for the cell. In C#:
I haven't tried it in python yet, but I suppose it would be something like this:
If you're using a statically typed language, make sure you cast it to a short. Doing
typeof(WritingMode)
won't work, for some odd reason.See this issue in the OOo bug tracker.