高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】redering texts
redering texts?
redering texts?
can any body please tell me how to render the fonts.
i am trying to read a dwg file and then display its contents in my application.
i am using the odvectorize example code for this purpose.
my problem is that first i tried to render the text by doing the maximal vectorization i.e vectorizing to simpler entities. this should result in polygons and triangles that when drawn should result in the correct text and font. am i right? however, this does not result in correct behaviour. all i get back is a lots of points and broken and very small triangles drawn. what could be the problem? is it that the font file is missing. i do not think that the problem is that the font file is missing because i returned the correct path of the font file in the funtion
oddbhostappservices::findfile()
like
odstring exhostappservices::findfile(const char* filename,oddbdatabase* pdb,oddbhostappservices::findfilehint hint)
{
odstring temp;
printf("filehint%d\n",hint);
printf("file name:%s:\n",filename);
temp.format("c:\\\\windows\\\\fonts\\\\arial.ttf") ;
printf("%s\n",temp.c_str());
printf("i am here\n");
return temp;
} */
the problem is not solved with this code.
secondly, i have the following problem as well:
now i am not doing the maximal vecotrization but instead trying to get the text attributes like width scale factor and height of the text with the following code:
void odgidumperimpl:: output(const odgitextstyle& textstyle)
{
odstring s;
s.format(" size:%lf, isshape:%d, xscale:%lf",
textstyle.textsize(), textstyle.isshape(), textstyle.xscale());
output(s);
}
is textstyle.textsize() the height of the font? surprisingly, the values of the textstyle.textsize and textstyle.xscale are always 1.0000 and 1.0000. what could be its reason? please help me in this regard.
thanks
faisal.
last edited by f_shaukat; 8th november 2006 at 03:26 amfff">.
|