查看单个帖子
旧 2009-05-06, 03:08 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)