DWF
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
DWF Toolkit - font identifica tion
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I am converting w2d file to the custom graphical format. I converted geometry correctly but I had some problem with font conversion. Namely, "my" font size and font size at Design Review are different.
For idenetification font height I do next steps:
1) Get viewport and viewport units transform matrix (WT_Object::Viewport_ID)
currViewportUnitsMatrix = ((WT_Viewport*)pCurrObject)->viewport_units().dwf_
2) Process WT_Object::Text_ID:
a) Get WT_Font through rendition, which got early WT_Rendition& rendition = _pFile->rendition();
WT_Font wtFont = rendition.font();
b) Convert logical font height value to the application value using viewport and units transform matrix
// for convert value we find distance between 0,0 point and value,0 point - ??? Is another way existing?
...
After these operations I get a font height which I use in project and it is different from right Design Review height.
What I do wrong?
Another question about font name and family. What I should use for identifying font name WT_Font::font_name() or WT_Font::family()?
Thanks
Solved! Go to Solution.
Re: DWF Toolkit - font identifica tion
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Do you want to convert the text font height to the real text height? If yes then in step 2) ->b):
- Convert the WT_Font to HFONT;
- Draw the text with HFONT in a device context;
- Get the text height;
- Multiply the text height and the viewport scale; then we can get the real text height.
Please let me know if you have any further questions.

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Re: DWF Toolkit - font identifica tion
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Your solution is working! I converted the text font height to the real text height.
Thank you for quick reply.
---
Timofey Tatarinov
Re: DWF Toolkit - font identifica tion
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Silvia Cao,
Our application is working on Windows now. But we want to support our system on linux too. And we have a question:
What can we do for converting of the text font height to the real text height on linux?
Thanks
Re: DWF Toolkit - font identifica tion
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
The font supported in DWF is TrueType; so we need to install the graphics library which can support the TrueType (like Simple DirectMedia Layer); and then process the text like in Windows.
Please let me know if you have any further questions.

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.

