Review Request: Exact ms-word font height

Matus Hanzes matus.hanzes at ixonos.com
Tue Mar 22 11:38:10 GMT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100915/
-----------------------------------------------------------

Review request for Calligra, Thorsten Zachmann and Casper Boemann.


Summary
-------

Problem with fonts in linux and windows is that true type fonts have more than one metric.
They have normal metric placed in font header table
          microsoft metric placed in os2 table
          apple metric placed in os2 table
   
Ms-word is probably using CreateFontIndirect and GetOutlineTextMetric function to calculate line height and this functions are using windows gdi environment which is using microsoft font metric placed in os2 table.
Qt on linux is using normal font metric.

This two metrics are different and change from font to font.

If caligra words on linux wants to have the same line height as ms-word, font stretch constant has to be calculated and used in text shape.

This is the equation which is used in text shape:
font_size * font_stretch = windows_font_height

Any comments are welcome


Diffs
-----

  CMakeLists.txt bc49dae 
  filters/libmsooxml/MsooXmlReader_p.h 240058b 
  filters/words/docx/DocxXmlDocumentReader.cpp 59a9ed7 
  filters/words/docx/DocxXmlStylesReader.cpp fe00266 
  libs/main/KoDocument.cpp 151ec99 
  libs/odf/KoGenStyle.h 572cf00 
  libs/odf/KoGenStyle.cpp 287f428 
  plugins/textshape/CMakeLists.txt c093c8e 
  plugins/textshape/Layout.h fd82e21 
  plugins/textshape/Layout.cpp 674cb23 

Diff: http://git.reviewboard.kde.org/r/100915/diff


Testing
-------


Thanks,

Matus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110322/71839134/attachment.htm>


More information about the calligra-devel mailing list