قالب وردپرس درنا توس
Home / Mac / RTF and RTFD – The Eclectic Light Company

RTF and RTFD – The Eclectic Light Company

Mac and iOS devices have the advantage of not a number of Rich Text documents, but two: RTF and RTFD. This article explores some of their features and limitations and considers the issues of working with them side by side.

Rich Text Format, RTF, is one of the early markup language formats and was developed by Microsoft's Word development team in the 1980s, and was first published in Microsoft Word 3 in 1987. The current version is 1.9, which appeared over a decade ago in 2008. Unlike proper markup languages, it was never intended to be human readable, and amazingly still fundamentally based on 7-bit ASCII plain text rather than full Unicode encoding. For example, the word Café is usually coded in RTF as Caf & # 39; e9 and Unicode more generally uses escape sequences such as uc0 u1

0140 with a specific font which is declared in the document font table.

In addition to styled text, RTF supports embedding certain image formats and some other types of graphics, but falls well below most modern standards for included content. It also does not specify page layouts.

In the late 1980s, when the NeXTSTEP operating system was developed for Steve Jobs & # 39; NeXT computers, it was decided to address some of the deficiencies of RTF in a derived format, rich text with attachments, or rich text format directory, RTFD. This is dependent on a function in NeXTSTEP where files can be bundled into a directory which then looks and behaves as a single file. This is done by giving the package list an extension of .rtfd, and in it it stores RTF text content in a file called TXT.rtf next to separate files containing the included content, such as images. This was implemented in NeXT provided text and Rich Text editor TextEdit, which made its way with RTFD to Mac OS X.

There is an immediate problem here: apart from macOS and NeXTSTEP, other operating systems such as Windows and Linux don't 39; Don't support directories that act as packages. Furthermore, regular RTF was part of Microsoft Word, while the upstart RTFD was not. So since that time, RTF and RTFD, as two bad behaviors of children, have lived their own separate lives, and it has been quite useless to get RTFD to work in Windows, just as getting Apple to support richer RTF has also failed .

This is well illustrated in the behavior of TextEdit in macOS. Create a styled text document, and TextEdit offers you the choice of storing it in RTF or RTFD. The moment you try to insert an image into it – also in a format elsewhere supported by RTF – and TextEdit forces the document to be converted to RTFD.


This form also goes deeper into macOS. Using another editor, you create an RTF document with a built-in image, and QuickLook's thumbnails ignore the image and QuickLook's preview feature. The pages are as annoying partisan as TextEdit, and every version of Microso ft Word ignores RTFD packages as if they were sick. Fortunately, some third-party apps still behave like adults: My favorite for working with both formats, for example, is Nisus Writer Pro, which dares to give the user a choice, and can be invaluable for converting between the two formats.

RTF is undoubtedly the more practical one, even if you are not interested in cross-platform compatibility. However, you can pay for your convenience. Embed a 205 KB PNG image in a few lines of text, and you may find that the image is converted to 4.9 MB of TIFF data in the RTF file. This is embedded as an object in the RTF source.

Because an RTF document is a single file, when opened by a sandboxed app in macOS, a single quarantine flag is written to it. The file has a UTI of public.rtf, a MIME type text / rtf for transmission over the Internet, and the standard extension of .rtf.

For text documents only, an RTFD package is ineffective, but the format comes into its own when you start to post other content. Not only can you add a wider range of images and graphics files, but you can also include PDF. These appear in TXT.rtf as linked NeXTGraphic files, revealing their origin. If you watch out, you can even edit raw RTF source to remove such included pages.

Quarantine flag attachments to RTFD are more messy: instead of putting a flag on the .rtfd package, each file in the folder gets its own quarantine flag. The package has a UTI for com.apple.rtfd, and uses the .rtfd extension. However, as a directory full of files, it does not qualify for a MIME type, and although a recipient can read RTFD, you must file it in an archive format as a zip file to send it to them over the Internet. However, iCloud transparently handles both RTF and RTFD documents.

There are some very nice things you can do with RTFD documents. Put together one that contains a page or two of PDF, for example. Open the RTFD folder in the Finder, select one of these PDF pages, and then use a Finder quick action on it to add comments. Then open the original RTFD document and the annotations will now appear in it as well. You can use similar actions with other included files, which no RTF files can access.

You will sometimes see RTFD packages called 'packages'. They are not: a package has a fairly tightly prescribed and more complex structure, like an app or other code bundle, and in it is a Property List file called Info.plist. In comparison, RTFD packages are flat and far simpler. However, you must be careful even if you try to manipulate them directly.

So when should you use which?

RTF is ideal if you need others who do not want to use Mac or iOS devices to view or edit the document. But it is quite limited what it can do, especially what types of content can be posted. If you are only interested in styled text without pictures, it is compact and easily accessible. It still doesn't use Unicode as its original text format, so for non-Roman scripts it can be a pain.

If you are sure that your document will only ever open on a Mac or iOS device, and especially if you want more adventurous inclusions like PDF, RTFD will probably give you the flexibility you want. But it has not been modernized to work initially in Unicode, which is bizarre when everything else (except PDF) does.

Source link