![]() |
【转帖】ext With Shx Font By Polylines
text with shx font by polylines
text with shx font by polylines we hav ean application that already manages ttf fonts. now, i would like to explode a text written with an shx font to polylines. the only way i found is to use textproc function. so, lloking to this forum and to the manual, what i do is: class mygeometrysimplifier : public odgigeometrysimplifier { public: void polylineproc(odint32 nbpoints, const odgepoint3d* pvertexlist, const odgevector3d* , const odgevector3d* pextrusion, odint32 ); }; odgitextstyle gistyle; gifromdbtextstyle(ptext->textstyle(), gistyle); gistyle.settextsize(ptext->height()); gistyle.setxscale(ptext->widthfactor()); gistyle.setobliquingangle(ptext->oblique()); odstring strtxt = ptext->textstring(); const odchar *pstrmsg = strtxt.c_str(); odint32 ilen = strtxt.getlength(); odgevector3d normal = ptext->normal(); double dangle = ptext->rotation(); odgevector3d direction; direction.rotateby(dangle, odgevector3d::kzaxis); direction.transformby(odgematrix3d:: planetoworld(normal)); odgepoint3d position = ptext->position(); mygeometrysimplifier geom; geom.setdrawcontext(odgibasevectorizer::drawcontex t()); geom.textproc(position, normal, direction, pstrmsg, ilen, true, &gistyle); the function geom.setdrawcontext(odgibasevectorizer::drawcontex t()); gives me an error of overload during compilation. what can i do? i am not so skilled in opendwg and any help on how to represent a shx text by polylines will be very well accepted. thank you in advance. fede can you be more specific please: what you have and what you want to get? what is "ptext" in the code you cited? in what context this code is executed? how odgibasevectorizer relates to this context? vladimir quote: originally posted by wvk can you be more specific please: what you have and what you want to get? what is "ptext" in the code you cited? in what context this code is executed? how odgibasevectorizer relates to this context? sorry vladimir, as i wrote i am not so skilled in opendwg. we have a software application to transform dxf files in cnc programs for automatic machine. this machine works only with lines and arcs. i have ptext that is a oddbtextptr. my target is to obtain the polylines describing the text pointed by ptext. at the moment by windows api we can obtain the points describing the true type font pointed by ptext. i would like to obtain a similar thing also with shf fonts. so at first i have searched for an shx file format description but i have found nothing that could help me. i have found on this forum a similar question and so i tried to use it but, as i told, i am not skilled in opendwg. we don't use till now odgibasevectorizer. so my question is: starting from my current status, how can i obtain the polylines describing the text? i thank you in advance. bye, ft vectorizing device may be inherited from odgibasevectorizer. code: #include "gi/gigeometrysimplifier.h" #include "gi/gibasevectorizer.h" #include "gicontextfordbdatabase.h" class dumpvectorizer : public odgigeometrysimplifier, public odgibasevectorizer { public: void polylineout(odint32 n, const odgepoint3d* pts) { // here lines should be processed } }; vectorization then will look like: code: odstaticrxobject<dumpvectorizer> dv; odstaticrxobject<odgicontextfordbdatabase> gicontext; gicontext.setdatabase(ptext->database()); dv.setdrawcontext(&dv); dv.setcontext(&gicontext); dv.textproc(position, normal, direction, pstrmsg, ilen, true, &gistyle); where textproc parameters are the same as you posted. or better: code: odstaticrxobject<dumpvectorizer> dv; odstaticrxobject<odgicontextfordbdatabase> gicontext; gicontext.setdatabase(ptext->database()); dv.setdrawcontext(&dv); dv.setcontext(&gicontext); dv.output().setdestgeometry(dv); dv.draw(ptext); to avoid manual normal,etc calculation vladimir last edited by vkalinin; 7th september 2005 at 05:33 amfff">. thank you very much vladimir!! ft |
所有的时间均为北京时间。 现在的时间是 09:08 PM. |