高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】shx Font Representation
shx font representation
shx font representation
i am developping a cad application where it is possible to write a text.
i would like to give the possibility to write also shx fonts.
so i am looking how to explode a text made with an shx font in polylines.
i am able to import correctly a dxf with shx font and explode it but
i am not able to use shx font without importing dxf.
now, if i want to represent the polulines of a text with shx font i do this:
oddbdatabaseptr pdb = myapp.createdatabase(true, false);
odstaticrxobject<dumpvectorizer> dv;
odstaticrxobject<odgicontextfordbdatabase> gicontext;
gicontext.setdatabase(pdb);
dv.setdrawcontext(&dv);
dv.setcontext(&gicontext);
odgitextstyle gistyle;
gicontext.getdefaulttextstyle(gistyle);
gistyle.setfont("solid.shx" ,false, false, 0, 0);
gistyle.setfontfilepath(ptext->getfontname());
dv.textproc(position, direction, upvector , pstrmsg, ilen, true, &gistyle);
i have the font solid.shx in the directory acad enviroment variable but what i obtained is a very simple and not very fine font completely different form solid.shx and differnet also from txt.shx.
am i doing everything correct?
thank you in advance for any help.
ftimillero
hi ftimillero,
1. use method setfilename(const char* fontname) for shx font instead of setfont().
2.
quote:
i have the font solid.shx in the directory acad enviroment variable
use gistyle.loadstylerec(oddbdatabase* pdb) instead of setfontfilepath() and dwgdirect must find font in your acad directory.
--
best regards,
sergey z.
|