AcApDocument* pDoc;
AcDbDatabase* pDb;
pDoc = acDocManager->curDocument();
pDb = pDoc->database();
AcDbTextStyleTable* pTextTbl;
AcDbTextStyleTableIterator *pTextIterator;
es = pDb->getTextStyleTable(pTextTbl, AcDb::kForRead);
pTextTbl->newIterator(pTextIterator); //获取迭代器
vector<wstring> fontList;
for (pTextIterator->start(); !pTextIterator->done(); pTextIterator->step()) {
AcDbTextStyleTableRecord *pTextRecord;
es = pTextIterator->getRecord(pTextRecord, AcDb::kForRead);
TCHAR* pFontName = NULL;
es = pTextRecord->fileName(pFontName); //获取字体名称
if (es == Acad::eOk) {
AddToFontList(pFontName, fontList);
}
es = pTextRecord->bigFontFileName(pFontName); //获取大字体名称
if (es == Acad::eOk) {
AddToFontList(pFontName, fontList);
}
}
pTextTbl->close();
页:
[1]