Table of Contents

CadMTextLook

from OpenCAD2D import CadMTextLook

class CadMTextLook(System.Object) ยท CadMTextLook in the .NET reference

The look of a run of letters of an MTEXT, as its inline codes set it: the font and whether it is bold or italic, the lines under, over and through, the colour, the height, the slant, the spacing and the width of the letters, and how the run stands in its line. A value left null (or false) is the MTEXT's own, so that CadMTextLook.Plain is the look of words written with no code at all. A look is never changed: each With gives a new one.

Properties and fields

Align

.NET

@property
def Align(self) -> int | None

Gets how the run stands in a line of taller letters (\A): 0 on the baseline, 1 at the middle, 2 at the top; null for the baseline.

Bold

.NET

@property
def Bold(self) -> bool

Gets whether the letters are bold (|b1 of a TrueType font code).

Charset

.NET

@property
def Charset(self) -> int | None

Gets the character set of the font code (|c0); null where the code gave none.

ColorIndex

.NET

@property
def ColorIndex(self) -> int | None

Gets the colour index of \C: 0 ByBlock, 256 ByLayer, 1 to 255 a colour of the index; null for the MTEXT's own.

Font

.NET

@property
def Font(self) -> str | None

Gets the font a code switches to: a TrueType family (Arial) or an SHX file (romans); null for the MTEXT style's.

Height

.NET

@property
def Height(self) -> float | None

Gets the height of the letters in drawing units (\H); null for the MTEXT's height.

IsPlain

.NET

@property
def IsPlain(self) -> bool

Gets whether this is CadMTextLook.Plain in all but the font: what the MTEXT's own codes before its words may set without a run of their own.

IsShx

.NET

@property
def IsShx(self) -> bool

Gets whether CadMTextLook.Font is an SHX file (\F) rather than a TrueType family (\f).

Italic

.NET

@property
def Italic(self) -> bool

Gets whether the letters are italic (|i1 of a TrueType font code).

Oblique

.NET

@property
def Oblique(self) -> float | None

Gets the slant of the letters in degrees (\Q); null for the style's.

Overline

.NET

@property
def Overline(self) -> bool

Gets whether the letters are overlined (\O to \o).

Pitch

.NET

@property
def Pitch(self) -> int | None

Gets the pitch and family of the font code (|p34); null where the code gave none.

Plain

.NET

Plain: ClassVar[CadMTextLook]

Gets the look of words with no code: everything the MTEXT's own.

Strikethrough

.NET

@property
def Strikethrough(self) -> bool

Gets whether the letters are struck through (\K to \k).

Tracking

.NET

@property
def Tracking(self) -> float | None

Gets the spacing of the letters as a factor of their usual spacing (\T); null for 1.

TrueColor

.NET

@property
def TrueColor(self) -> int | None

Gets the true colour of \c as 0xRRGGBB; null for none.

Underline

.NET

@property
def Underline(self) -> bool

Gets whether the letters are underlined (\L to \l).

WidthFactor

.NET

@property
def WidthFactor(self) -> float | None

Gets the width factor of the letters (\W); null for the style's.

Methods

Equals

.NET

def Equals(self, other: CadMTextLook) -> bool
def Equals(self, obj: object) -> bool

GetHashCode

.NET

def GetHashCode(self) -> int

WithAlign

.NET

def WithAlign(self, align: int | None) -> CadMTextLook

Gives the look standing in its line as \A says (0, 1, 2); null for the baseline.

WithColorIndex

.NET

def WithColorIndex(self, index: int | None) -> CadMTextLook

Gives the look in a colour of the index (0 ByBlock, 256 ByLayer), any true colour dropped; null for the MTEXT's own.

WithHeight

.NET

def WithHeight(self, height: float | None) -> CadMTextLook

Gives the look of a height in drawing units; null for the MTEXT's.

WithOblique

.NET

def WithOblique(self, degrees: float | None) -> CadMTextLook

Gives the look of a slant in degrees; null for the style's.

WithOverline

.NET

def WithOverline(self, on: bool) -> CadMTextLook

Gives the look overlined or not.

WithShx

.NET

def WithShx(self, file: str) -> CadMTextLook

Gives the look with an SHX font, which is neither bold nor italic.

WithStrikethrough

.NET

def WithStrikethrough(self, on: bool) -> CadMTextLook

Gives the look struck through or not.

WithTracking

.NET

def WithTracking(self, factor: float | None) -> CadMTextLook

Gives the look of a spacing factor; null for 1.

WithTrueColor

.NET

def WithTrueColor(self, rgb: int | None) -> CadMTextLook

Gives the look in a true colour, 0xRRGGBB, any colour index dropped; null for none.

WithTrueType

.NET

def WithTrueType(self, family: str, bold: bool, italic: bool) -> CadMTextLook

Gives the look with a TrueType font, bold and italic as given, the character set and pitch kept.

WithUnderline

.NET

def WithUnderline(self, on: bool) -> CadMTextLook

Gives the look underlined or not.

WithWidthFactor

.NET

def WithWidthFactor(self, factor: float | None) -> CadMTextLook

Gives the look of a width factor; null for the style's.