![]() |
【转帖】odgitextstyle to gdiplus fon
odgitextstyle to gdiplus font
odgitextstyle to gdiplus font hi, i am trying to draw text in a custom viewer developed based on the odvectorizeex sample, i am not able to translate the font dimensions returned in odgitextstyle(textproc) into gdiplus font class, please advice on how to acheive this. thank you krishna in autocad font height is the height of 'a' character. sergey slezkin sergey, thank you for the quick response, the font size information still didnt help me much, heres what i am doing i am trying to use teh code from the exgdigeometry.cpp, getlogfont, and textprocfunctions(in a custom viewer bases on odvectorizeex) to translate odgitextstyle, but the calculations didnt make any sense to me. could you help me with a explanation and/or code sample that helps make the transition from height returned by getheight() to a height in gdiplus. thank you krishna hello krishna, here is formula from getlogfont() function for calculate text height. int height = odroundtolong(style.getfont()->getheight() * ydir.length() / style.getfont()->fontabove()); where style.getfont()->getheight() and style.getfont()->fontabove() (height of 'a' character) are physical font property. style.getfont()->getheight()/style.getfont()->fontabove() is coefficient to reduce to acad text height and ydir.length() is text height in device unit here. the text height unit in acad corresponds fontabove(). -- best regards, sergey zaitcev |
所有的时间均为北京时间。 现在的时间是 02:21 PM. |