TheSwamp
Code Red => .NET => Topic started by: samisoft on June 24, 2023, 11:27:55 AM
-
How can I get the list of all available fonts in AutoCAD?
I received the following code , but the reference FontTable is not there in AutoCAD !!!
using (Transaction tr = db.TransactionManager.StartTransaction())
{
// Get the font table object
FontTable fontTable = (FontTable)tr.GetObject(db.FontTableId, OpenMode.ForRead);
// Iterate through the font table records and print the font names
foreach (ObjectId fontId in fontTable)
{
FontTableRecord fontRecord = (FontTableRecord)tr.GetObject(fontId, OpenMode.ForRead);
string fontName = fontRecord.Name;
ed.WriteMessage("\n" + fontName);
}
tr.Commit();
}
THE name space of FontTable could not e found !
-
As noted over on f5 there is no such class as FontTableRecord.
would be nice if you posted your revised code here when finished.