RTF 行分隔符

发布于 2024-08-15 06:54:39 字数 98 浏览 2 评论 0原文

有人知道如何在 RTF 文件中插入水平线分隔符吗?

示例:

一些文本


一些其他文本

Does someone knows how to insert a horizontal line separator in a RTF file?

Example:

some text


some other text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

街角卖回忆 2024-08-22 06:54:39

您可以使用 \dpline 命令(请参阅 RTF 规范 1.9.1)。

下面是一个可以满足您要求的示例:

{\rtf1
{\pard some text.\par}
{\pard {\*\do\dobxcolumn\dobypara\dodhgt
        \dpline\dpxsize9200\dplinesolid\dplinew30}\par}
{\pard some other text.\par}
}

RTF 输出预览: 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:

{\rtf1
{\pard some text.\par}
{\pard {\*\do\dobxcolumn\dobypara\dodhgt
        \dpline\dpxsize9200\dplinesolid\dplinew30}\par}
{\pard some other text.\par}
}

RTF Output Preview: 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.

℡寂寞咖啡 2024-08-22 06:54:39

如果你只需要一个简单的水平线,你也可以尝试这个:

{\pard \brdrb \brdrs\brdrw10\brsp20 {\fs4\~}\par \pard}

If you just need a simple horizontal rule you can also try this:

{\pard \brdrb \brdrs\brdrw10\brsp20 {\fs4\~}\par \pard}
↘紸啶 2024-08-22 06:54:39

以下是以任意角度绘制直线的代码:

{\rtf1
{\shp
{\shpinst \shpbxpage \shpbypage \shpleft200 \shptop400 \shpright3000 \shpbottom2000
{\sp{\sn shapeType}{\sv 32}}
}}}

请参阅 RTF 规范。对于“shapeType”选项。

当我开始学习 RTF 时,似乎 '\do' 绘制对象的用途有限,而 '\shp' 是可行的方法。例如,您只能使用 \dpline 绘制水平线。您无法抑制 \dptxbx 周围的矩形(零线宽)。 \dptxbx 和 \dptxbxtext 都不会遵守 \fittext。

Here's code to draw a line at any arbitrary angle:

{\rtf1
{\shp
{\shpinst \shpbxpage \shpbypage \shpleft200 \shptop400 \shpright3000 \shpbottom2000
{\sp{\sn shapeType}{\sv 32}}
}}}

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.

壹場煙雨 2024-08-22 06:54:39

我刚刚在 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

榆西 2024-08-22 06:54:39

作为极简主义者,您可以使用居中、下划线空格:

\par
\pard\qc\ul                          \ulnone\par
\pard\par

如果居中不完美,您可能需要添加不间断空格 \~ 作为 \ulnone

As a minimalist, you can use centered, underscored spaces:

\par
\pard\qc\ul                          \ulnone\par
\pard\par

If centering is imperfect, you may need to add a non-breaking space \~ as the last space just before \ulnone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文