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_to_application_adjoint_transform();
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.
Solved by SilviaCao. Go to Solution.
Do you want to convert the text font height to the real text height? If yes then in step 2) ->b):
Please let me know if you have any further questions.
Your solution is working! I converted the text font height to the real text height.
Thank you for quick reply.
---
Timofey Tatarinov
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
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.