Table of Contents

Class CadMTextImport

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

What the MTEXT editor's Import Text reads from a file: a text file (.txt) as paragraphs of plain letters, or a rich text file (.rtf) as paragraphs of runs with the font, bold, italic, underline, strikethrough, colour and size they have there. A file over 32 KB is refused, as AutoCAD 2021 refuses it.

public static class CadMTextImport
Inheritance
CadMTextImport
Inherited Members

Remarks

An RTF is read for what an MTEXT can hold: \b, \i, \ul, \strike, \fN (a font other than the document's default), \cfN (a colour of the colour table, written as a true colour), \fsN (a size other than that of the first letters, in drawing units the MTEXT's height times the ratio), \par and \line (a new paragraph), \tab, the quotes, dashes and bullet, and the letters of \'hh and \uN (a \'hh is read in the code page of its font's \fcharsetN, else the document's \ansicpgN). What is dropped: paragraph formatting (alignment, indents, tab stops, spacing, lists), tables, pictures and objects, headers and footers, footnotes, hyperlinks (their words stay), and every other character effect (small capitals, sub- and superscripts, highlight, spacing, shadow). A run that has none of the rest is Plain, and InsertContent(CadMTextContent) gives it the look of the letters typed there.

Fields

MaxBytes

The largest file Import Text takes, in bytes: 32 KB.

Methods

FromFile(string, double)

Reads a file: an RTF where it begins {\rtf, else a text file.

FromRtf(string, double)

Reads rich text as the class says.

FromText(string)

Reads plain words: each line a paragraph, in no look of its own.