几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to resolve the font path (http://www.dimcax.com/hust/showthread.php?t=16754)

yang686526 2009-05-06 03:08 PM

【转帖】how to resolve the font path
 
how to resolve the font path
how to resolve the font path
hi all,
in odsmidapp, i override the oddbhostappservices::findfile() like this.
odstring codamdiapp::findfile( const char* pcfilename, oddbdatabase* pdb, oddbhostappservices::findfilehint hint )
{
odstring s = pcfilename;
if ( hint == 1 || hint == 2 ) {
s = m_shxfontpath;
s += "\\";
s += pcfilename;
return s;
}
else if ( hint == 3 ) {
s = m_ttffontpath;
s += "\\";
s += getttffilename( pcfilename );
return s;
}
return exhostappservices::findfile( pcfilename, pdb, hint );
}
odstring getttffilename( const char* name )
{
...
}
i set "c:\\acadfont" to m_shxfontpath, and "c:\\winnt\\font" to m_ttffontpath.
i open a dwg file that uses shx font styles and ttf font styles. shx style texts are displayed good, but ttf style texts arr displayed as rectangles.
i check the parameters, hint and pcfilename, and return value odstring.
1 txt.shx c:\acadfont\txt.shx
1 bigfont.shx c:\acadfont\bigfont.shx
1 simplex.shx c:\acadfont\simplex.shx
3 ms pgothic.ttf c:\winnt\fonts\msgothic.ttc
what is wrong with these codes & results?
thank you for your help.
junichi yoshimoto
yossypackun@yahoo.co.jp
junichi yoshimoto

recently some bugs with multibyte text rendering were fixed. does your problem takes place with single byte ttf text?
sergey slezkin

thank you, slezkin.
as you said, my problem occurs with multi byte ttf texts. sigle byte ttf texts are looking good. ( although inside font still isn't filled with v1.06... )
i tried these.
1. open a database.
2. replace the font of textstyles using ttf font with shx font, and store these informations.
3. view and add some operations.
4. restore original font informations.
5. save the database.
it has still some problems with shift-jis own character codes, but almost good.
i hope next version will release in the near future.
junichi yoshimoto


所有的时间均为北京时间。 现在的时间是 08:00 AM.