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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】ext Outpu (http://www.dimcax.com/hust/showthread.php?t=18732)

yang686526 2009-05-07 04:47 PM

【转帖】ext Outpu
 
text output
text output
i'm trying to convert some text into a dwg file.
the information i have is a logfont, a bounding box before transformation, and the transformation.
i can output text be specifying the height to be the height of the bounding box.
i.e.
oddbtextptr ptext = oddbtext::createobject();
ptext->setheight(bbox.height());
this works fine unless the text contains letters that are higher and lower then the letter 'a'.
e.g. "bottom" outputs fine as does "paper" but "diaper" is incorrect.
the symptoms are that "diaper" is approx 1/3 larger than the bounding box.
is setting the height for text this way correct? if so why the problem with "dp"? if not, how should i do it?
i'm using dd 1.12.04
in autocad "text height" is treated as height of "a" symbol not the height of bounding box. coefficient to convert between these two heights depends on font metrics - it is different for different fonts.
sergey slezkin


所有的时间均为北京时间。 现在的时间是 04:45 PM.