查看单个帖子
旧 2009-05-07, 12:53 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】remapping truetype fonts to shx stick fonts

remapping truetype fonts to shx stick fonts
remapping truetype fonts to shx stick fonts
can anyone tell me how to remap truetype fonts to shx stick fonts during the rendering process?
i don't want to modify the dwg. i am doing a conversion of the data to another drawing format and want to reduce the number of vectors produced.
last edited by burmaster; 22nd july 2005 at 02:59 pmfff">.
quote:
originally posted by burmaster
can anyone tell me how to remap truetype fonts to shx stick fonts during the rendering process?
i don't want to modify the dwg. i am doing a conversion of the data to another drawing format and want to reduce the number of vectors produced.
you can modify the text style table after you have opened the database but before you render it.
oddbtextstyletableptr pstyles = pdb->gettextstyletableid().safeopenobject(oddb::kforwr ite);
// get an iterator for the style table
oddbsymboltableiteratorptr pstyleiter = pstyles->newiterator();
for (pstyleiter->start(); ! pstyleiter->done(); pstyleiter->step())
{
oddbtextstyletablerecordptr pstyle = pstyleiter->getrecordid().safeopenobject(oddb::kforwrite);
if (!pstyle->isshapefile())
{
odstring stylename = pstyle->filename();
cout << " changing " << stylename << " to txt.shx" << endl;
stylename = "txt.shx";
pstyle->setfilename(stylename);
}
}
quote:
originally posted by burmaster
can anyone tell me how to remap truetype fonts to shx stick fonts during the rendering process?
i don't want to modify the dwg. i am doing a conversion of the data to another drawing format and want to reduce the number of vectors produced.
you can rewrite method oddbhostappservices::getpreferablefont() in your application. see dwgdirect reference topic developer's guide\font handling for more details. modifying the text style table does't give you needed result because font may change in mtext contents (switch "\f").
--
best regards,
sergey z.
quote:
originally posted by burmaster
can anyone tell me how to remap truetype fonts to shx stick fonts during the rendering process?
i don't want to modify the dwg. i am doing a conversion of the data to another drawing format and want to reduce the number of vectors produced.
you can rewrite method oddbhostappservices::getpreferablefont() in your application. see dwgdirect reference topic "developer's guide\font handling" for more details. modifying the text style table does't give you needed result because font may change in mtext contents (switch "\f").
--
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)