Skip to main content
View as Markdown

ISch_FontManager interface

The ISch_FontManager interface represents the internal font manager in Schematic Editor that manages fonts for text based objects on schematic documents.

public interface ISch_FontManager

Namespace: SCH · Assembly: Altium.SDK.Interfaces

Remarks​

To have access to the ISch_FontManager interface, read SCH.GlobalVars.SchServer;

Properties​

PropertyTypeAccessDescription
BoldboolgetThis Bold property determines the Bold style for the font.
DefaultHorizontalSysFontIdintget
DefaultVerticalSysFontIdintget
FontCountintgetThe FontCount property returns the number of fonts used in the computer system that the Altium Designer is currently residing on.
FontNamestringgetThis indexed FontName property returns the name of an indexed font as a string.
ItalicboolgetThis Italic property determines the Italic style for the font.
RotationintgetThe Rotation property determines the orientation of the text object.
SaveFlagboolget
SizeintgetThe Size property determines the font size.
StrikeOutboolgetThe StrikeOut property determines whether the font is striked out or not.
UnderLineboolgetThis UnderLine property determines whether the font is underlined or not.

Bold​

This Bold property determines the Bold style for the font.

bool GetState_Bold(int argnId);

Type: bool · Access: read-only · Index: argnId (int)

See also: ISch_FontManager.GetFontID

DefaultHorizontalSysFontId​

No description yet.

int GetState_DefaultHorizontalSysFontId();

Type: int · Access: read-only

DefaultVerticalSysFontId​

No description yet.

int GetState_DefaultVerticalSysFontId();

Type: int · Access: read-only

FontCount​

The FontCount property returns the number of fonts used in the computer system that the Altium Designer is currently residing on.

int GetState_FontCount();

Type: int · Access: read-only

FontName​

This indexed FontName property returns the name of an indexed font as a string. Every computer could have a different table of fonts used.

string GetState_FontName(int argnId);

Type: string · Access: read-only · Index: argnId (int)

Italic​

This Italic property determines the Italic style for the font.

bool GetState_Italic(int argnId);

Type: bool · Access: read-only · Index: argnId (int)

See also: ISch_FontManager.GetFontID

Rotation​

The Rotation property determines the orientation of the text object. For ISch_Labels, it is necessary to set the Orientation property of these ISch_Labels as well as the Rotation property for the FontID variables.

int GetState_Rotation(int argnId);

Type: int · Access: read-only · Index: argnId (int)

SaveFlag​

No description yet.

bool GetState_SaveFlag(int argnId);

Type: bool · Access: read-only · Index: argnId (int)

Size​

The Size property determines the font size.

int GetState_Size(int argnId);

Type: int · Access: read-only · Index: argnId (int)

See also: ISch_FontManager.GetFontID

StrikeOut​

The StrikeOut property determines whether the font is striked out or not.

bool GetState_StrikeOut(int argnId);

Type: bool · Access: read-only · Index: argnId (int)

See also: ISch_FontManager.GetFontID

UnderLine​

This UnderLine property determines whether the font is underlined or not.

bool GetState_UnderLine(int argnId);

Type: bool · Access: read-only · Index: argnId (int)

See also: ISch_FontManager.GetFontID

Methods​

MethodReturnsDescription
GetFontIDintThis method retrieves the font ID of TFontID type that can be used to set the font style of a text based object such as a ISch_Label object.
GetFontSizeint
GetFontSpecvoidEvery font used in the Schematic document has its own FontID.
Import_FromUserbool
IsFontVerticalboolThis method determines whether the font is vertically orientated or not.

GetFontID​

This method retrieves the font ID of TFontID type that can be used to set the font style of a text based object such as a ISch_Label object.

int GetFontID(int argSize, int argRotation, bool argUnderline, bool argItalic, bool argBold, bool argStrikeOut, string argFontName);
ParameterTypePassing
argSizeintvalue
argRotationintvalue
argUnderlineboolvalue
argItalicboolvalue
argBoldboolvalue
argStrikeOutboolvalue
argFontNamestringvalue

Returns: int

Example: Give a rotated label a font with the same rotation.

using SCH;

ISch_ServerInterface schServer = SCH.GlobalVars.SchServer;
ISch_Document schDoc = schServer?.GetCurrentSchDocument();
if (schDoc == null)
return;
var aLabel = schServer.SchObjectFactory(TObjectId.eLabel, TObjectCreationMode.eCreate_GlobalCopy) as ISch_Label;
if (aLabel == null)
return;

aLabel.SetState_Orientation(TRotationBy90.eRotate90);
aLabel.SetState_FontId(schServer.GetState_FontManager().GetFontID(14, 90, false, false, false, false, "Times New Roman"));
// Note eRotate90 for the Orientation property, and a 90 value as a parameter for the GetFontID method.
schDoc.RegisterSchObjectInContainer(aLabel);

GetFontSize​

No description yet.

int GetFontSize(int argFontID);
ParameterTypePassing
argFontIDintvalue

Returns: int

GetFontSpec​

Every font used in the Schematic document has its own FontID. You can invoke the GetFontSpec method to retrieve font specifications for the supplied Font ID.

void GetFontSpec(int argFontID, ref int argSize, ref int argRotation, ref bool argUnderline, ref bool argItalic, ref bool argBold, ref bool argStrikeOut, ref string argFontName);
ParameterTypePassing
argFontIDintvalue
argSizeintref
argRotationintref
argUnderlineboolref
argItalicboolref
argBoldboolref
argStrikeOutboolref
argFontNamestringref

Returns: nothing (void)

Import_FromUser​

No description yet.

bool Import_FromUser(ref int argFontID);
ParameterTypePassing
argFontIDintref

Returns: bool

IsFontVertical​

This method determines whether the font is vertically orientated or not.

bool IsFontVertical(int argFontID);
ParameterTypePassing
argFontIDintvalue

Returns: bool

Returned by​

ISch_ServerInterface.FontManager