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
@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
@property
def Bold(self) -> bool
Gets whether the letters are bold (|b1 of a TrueType font code).
Charset
@property
def Charset(self) -> int | None
Gets the character set of the font code (|c0); null where the code gave none.
ColorIndex
@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
@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
@property
def Height(self) -> float | None
Gets the height of the letters in drawing units (\H); null for the MTEXT's height.
IsPlain
@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
@property
def IsShx(self) -> bool
Gets whether CadMTextLook.Font is an SHX file (\F) rather than a TrueType family (\f).
Italic
@property
def Italic(self) -> bool
Gets whether the letters are italic (|i1 of a TrueType font code).
Oblique
@property
def Oblique(self) -> float | None
Gets the slant of the letters in degrees (\Q); null for the style's.
Overline
@property
def Overline(self) -> bool
Gets whether the letters are overlined (\O to \o).
Pitch
@property
def Pitch(self) -> int | None
Gets the pitch and family of the font code (|p34); null where the code gave none.
Plain
Plain: ClassVar[CadMTextLook]
Gets the look of words with no code: everything the MTEXT's own.
Strikethrough
@property
def Strikethrough(self) -> bool
Gets whether the letters are struck through (\K to \k).
Tracking
@property
def Tracking(self) -> float | None
Gets the spacing of the letters as a factor of their usual spacing (\T); null for 1.
TrueColor
@property
def TrueColor(self) -> int | None
Gets the true colour of \c as 0xRRGGBB; null for none.
Underline
@property
def Underline(self) -> bool
Gets whether the letters are underlined (\L to \l).
WidthFactor
@property
def WidthFactor(self) -> float | None
Gets the width factor of the letters (\W); null for the style's.
Methods
Equals
def Equals(self, other: CadMTextLook) -> bool
def Equals(self, obj: object) -> bool
GetHashCode
def GetHashCode(self) -> int
WithAlign
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
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
def WithHeight(self, height: float | None) -> CadMTextLook
Gives the look of a height in drawing units; null for the MTEXT's.
WithOblique
def WithOblique(self, degrees: float | None) -> CadMTextLook
Gives the look of a slant in degrees; null for the style's.
WithOverline
def WithOverline(self, on: bool) -> CadMTextLook
Gives the look overlined or not.
WithShx
def WithShx(self, file: str) -> CadMTextLook
Gives the look with an SHX font, which is neither bold nor italic.
WithStrikethrough
def WithStrikethrough(self, on: bool) -> CadMTextLook
Gives the look struck through or not.
WithTracking
def WithTracking(self, factor: float | None) -> CadMTextLook
Gives the look of a spacing factor; null for 1.
WithTrueColor
def WithTrueColor(self, rgb: int | None) -> CadMTextLook
Gives the look in a true colour, 0xRRGGBB, any colour index dropped; null for none.
WithTrueType
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
def WithUnderline(self, on: bool) -> CadMTextLook
Gives the look underlined or not.
WithWidthFactor
def WithWidthFactor(self, factor: float | None) -> CadMTextLook
Gives the look of a width factor; null for the style's.