RTF 行分隔符
有人知道如何在 RTF 文件中插入水平线分隔符吗?
示例:
一些文本
一些其他文本
Does someone knows how to insert a horizontal line separator in a RTF file?
Example:
some text
some other text
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用
\dpline
命令(请参阅 RTF 规范 1.9.1)。下面是一个可以满足您要求的示例:
RTF 输出预览:
您自定义线条颜色(
\dplineco[rgb]
)、宽度(\dplinew
)、线条样式等。如果您对 RTF 感兴趣,您会发现 RTF Pocket Guide 很有帮助——它比 RTF 规范要简单得多!具体来说,它讨论了绘制水平线的其他方法。
You could use the
\dpline
commands (See the section on "Drawing Objects" on page 157 in the RTF Spec 1.9.1).Here's a sample that should do what you want:
RTF Output Preview:
You customize the line color with
\dplineco[rgb]
, width with\dplinew
), line-styles etc.And if you're interested in RTF, you would find the RTF Pocket Guide helpful -- it is much less boring than the RTF Spec! Specifically, it talks about other ways of drawing a horizontal line.
如果你只需要一个简单的水平线,你也可以尝试这个:
If you just need a simple horizontal rule you can also try this:
以下是以任意角度绘制直线的代码:
请参阅 RTF 规范。对于“shapeType”选项。
当我开始学习 RTF 时,似乎 '\do' 绘制对象的用途有限,而 '\shp' 是可行的方法。例如,您只能使用 \dpline 绘制水平线。您无法抑制 \dptxbx 周围的矩形(零线宽)。 \dptxbx 和 \dptxbxtext 都不会遵守 \fittext。
Here's code to draw a line at any arbitrary angle:
See RTF spec. for 'shapeType' options.
As I begin to learn RTF, it appears that '\do' draw objects are of limited use, and '\shp' is the way to go. For instance, you can only do horizontal lines with \dpline. You can't suppress the rectangle (zero line width) around \dptxbx. Neither \dptxbx nor \dptxbxtext will obey \fittext.
我刚刚在 Apple 的 Textedit 中成功地制作了一条令人信服的水平规则,方法是:插入一个表格,将列和行设置为 1(如果需要,可以在此时更改边框的颜色)在表格中键入单个字符(空格)单元格,选择它并打开字体调色板,将字体大小设置为 0.2
I've just successfully made a convincing horizontal rule in Apple's Textedit by: insert a table, set the cols and rows to 1 (change the colour of the border at this point if you want) type a single character (a space) in the cell, select it and open the font palette, set font size to 0.2
作为极简主义者,您可以使用居中、下划线空格:
如果居中不完美,您可能需要添加不间断空格
\~
作为\ulnone
。As a minimalist, you can use centered, underscored spaces:
If centering is imperfect, you may need to add a non-breaking space
\~
as the last space just before\ulnone
.