高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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.
|