我想了解一些关于富文本格式的有趣细节 下面是在记事本中打开的富文本格式内容示例
{\rtf1\mac\deff2 {\fonttbl{\f0\fswiss Chicago;}{\f2\froman New York;}{\f3\fswiss Geneva;}{\f4\fmodern Monaco;}{\f11\fnil Cairo;}{\f13\fnil Zapf Dingbats;}{\f16\fnil Palatino;}{\f18\fnil Zapf Chancery;}{\f20\froman Times;}{\f21\fswiss Helvetica;}
{\f22\fmodern Courier;}{\f23\ftech Symbol;}{\f24\fnil Mobile;}{\f100\fnil FoxFont;}{\f107\fnil MathMeteor;}{\f164\fnil Futura;}{\f1024\fnil American Heritage;}{\f2001\fnil Arial;}{\f2005\fnil Courier New;}{\f2010\fnil Times New Roman;}
{\f2011\fnil Wingdings;}{\f2515\fnil MT Extra;}{\f3409\fnil FoxPrint;}{\f11132\fnil InsigniaLQmono;}{\f11133\fnil InsigniaLQprop;}{\f14974\fnil LB Helvetica Black;}{\f14976\fnil L Helvetica Light;}}{\colortbl\red0\green0\blue0;\red0\green0\blue255;
\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;}{\stylesheet{\f4\fs18 \sbasedon222\snext0 Normal;}}{\info{\title samplepostscript.msw}{\author
Computer Science Department}}\widowctrl\ftnbj \sectd \sbknone\linemod0\linex0\cols1\endnhere \pard\plain \qc \f4\fs18 {\plain \b\f21 Sample Rich Text Format Document\par
}\pard {\plain \f20 \par
}\pard \ri-80\sl-720\keep\keepn\absw570 {\caps\f20\fs92\dn6 T}{\plain \f20 \par
}\pard \qj {\plain \f20 his is a sample rich text format (RTF), document. This document was created using Microsoft Word and then printing the document to a RTF file. It illustrates the very basic text formatting effects that can be achieved using RTF.
\par
\par
}\pard \qj\li1440\ri1440\box\brdrs \shading1000 {\plain \f20 RTF }{\plain \b\f20 contains codes for producing advanced editing effects. Such as this indented, boxed, grayed background, entirely boldfaced paragraph.\par
}\pard \qj {\plain \f20 \par
Microsoft Word developed RTF for document transportability and gives a user access to the complete set of the effects that can be achieved using RTF. \par
}}
在 MS word 中编辑此文件后,它发生了很大变化。我没有通过在 MS word 中打开删除或添加任何内容,我删除了“illustrates”一词(可以在上面的 rtf 文件中看到),然后添加词再次回到相同的位置。所以文件内容没有任何变化。但是保存文件后,我在文本编辑器中打开了它,做了很多更改
\par }\pard \ltrpar\ql \li0\ri-80\sl-720\slmult0\keep\keepn\widctlpar\absw570\wrapdefault\faauto\rin-80\lin0\itap0 {\rtlch\fcs1 \af46\afs92 \ltrch\fcs0 \caps\f46\fs92\dn6\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 T}{\rtlch\fcs1 \af46\afs24 \ltrch\fcs0
\f46\fs24\insrsid1866410
\par }\pard \ltrpar\qj \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46
his is a sample rich text format (RTF), document. This document was created using Microsoft Word and then printing the document to a RTF file. It }{\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 illustrates }
{\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 the very basic text formatting effects that can be achieved using RTF.
\par
\par }\pard \ltrpar\qj \li1440\ri1440\widctlpar\brdrt\brdrs\brdrw15 \brdrl\brdrs\brdrw15 \brdrb\brdrs\brdrw15 \brdrr\brdrs\brdrw15 \wrapdefault\faauto\rin1440\lin1440\itap0 \shading1000 {\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410
\hich\af46\dbch\af31505\loch\f46 RTF }{\rtlch\fcs1 \ab\af46\afs24 \ltrch\fcs0 \b\f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 contains codes for pr\hich\af46\dbch\af31505\loch\f46
oducing advanced editing effects. Such as this indented, boxed, grayed background, entirely boldfaced paragraph.
\par }\pard \ltrpar\qj \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410
主要变化是以下行
}\pard \qj {\plain \f20 his is a sample rich text format (RTF), document. This document was created using Microsoft Word and then printing the document to a RTF file. It illustrates the very basic text formatting effects that can be achieved using RTF.
被替换为
\par }\pard \ltrpar\qj \li0\ri0\widctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46
his is a sample rich text format (RTF), document. This document was created using Microsoft Word and then printing the document to a RTF file. It }{\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 illustrates }
{\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 the very basic text formatting effects that can be achieved using RTF.
您可以看到我在文件中剪切并粘贴“插图”一词的部分的更改。在该部分中添加了一些东西,例如
illustrates }
{\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46\fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46 the very basic text formatting effects that can be achieved using RTF. "
那么为什么会发生这种变化呢?
更新: 通过下面的答案,我发现这是由于 ms word 添加了一些自己的样式等现在我的问题是我可以删除这个附加的源代码或代码(例如 {\rtlch\fcs1 \af46\afs24 \ltrch\fcs0 \f46 \fs24\insrsid1866410 \hich\af46\dbch\af31505\loch\f46) 从 rtf 文件手动使用二进制工具?如果我删除它会出错吗?(对于一个文件,我通过手动删除它进行了更改,当我检查内容时,没有删除任何数据)。但我想知道删除它是否可以?