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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-07, 06:22 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】vectorize Diameter-sign

vectorize & diameter-sign
vectorize & diameter-sign
hello
when vectorizing a dxf-drawing in odamfcapp, the diameter sign is replaced by a question mark (img01). if i open the same drawing in another viewer (free dwg viewer), it is shown correctly.
if i look into the acdbmtext entity i see the diameter sign as a character (img03).
how can i prevent the replacement by the question mark and have the same result as in the free dwg viewer?
what i want to achieve in my application is to write a bmp file, which works quite alright except of that issue with the diameter sign.
can you help me in this matter? are there any examples i can look into?
attached images
hello martin,
possible text style font is not found and substituted font hasn't symbol "diameter". more detail see dwgdirect reference topic "font handling".
in any case could you attach your sample file?
best regards,
sergey z.
hi sergey,
thanks for your reply. i managed to get my diameter sign shown, but am not satisfied with this temporary solution (i overwrote the getpreferablefont() method in exhostappservices which, in any case, returns an existing ttf-filename ). that was good enough to understand what is missing in my application. so i undid the overwriting.
next i tried to overwrite the getfontmapfilename() method, so it would return the path to my .fmp file (copied from autocad). reading the docs about fonthandling i figured i needed to do so, since the default implementation returns an empty string:
quote:
virtual odstring
oddbhostappservices::getfontmapfilename() const
returns the name of the font mapping file used by the getpreferablefont function.
returns
the default implementation of this function does nothing but return an empty string. it will be fully implemented in a future release.
this is my version of getfontmapfilename():
code:
//test afm
odstring exhostappservices::getfontmapfilename(){
return odstring( "acad.fmp" );
}unfortunately it never gets called while debugging, which it should as it says in the docs:
quote:
oddbhostappservices::getpreferablefont(
const odstring& fontname,
odfonttype fonttype)
returns the preferable font name for the specified font name and type.
parameters
fontname (i) font name.
fonttype (i) font type.
remarks
this function is called as the first step in the process of resolving a font file. the default implementation tries to locate a font mapping file by calling getfontmapfilename, and substitutes the font name based on the contents of this file.
what am i missing? do i have to write my own getpreferablefont() method, read the .fmp file and return the given substitute-fontname?
the attached dxf-file is the one i was talking about in my earlier post. it uses simplex.shx and monos.ttf. i do have monos.ttf and am trying to substitute simplex.shx with simplex8.shx (which i have also).
as always, your help is very appreciated.
martin
attached files (162.4 kb, 1 views)

hello martin,
preferable font and font map are used in case font is substituted for other. i think you need find source font.
you need to see oddbhostappservices::findfile function (which can be overridden by the user). the default implementation ( for windows platform) of this function does the following, stopping as soon as one of the steps finds the desired file:
- attempts to access the file as-is (without modifying the path).
- attempts to access the file in the current directory.
- retrieves the system environment variable "acad", and attempts to locate the font file in one of the paths stored in this variable (the acad variable should contain a set of paths, separated by semi-colons).
- attempts to access the file in the same directory that the current drawing resides (if applicable).
- for truetype font files, attempts to locate the font file in the windows directory (windows systems only).
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】diameter symbol rendered as plus-or-minus sign yang686526 DirectDWG 0 2009-05-04 07:26 PM
【转帖】brain freeze on positional calculation yang686526 American standards 0 2009-04-29 06:42 PM


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


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多