alexpana / wxWidgets

Read-only mirror of the wxWidgets SVN repo (automatically updated). Report issues here: http://trac.wxwidgets.org/
http://www.wxwidgets.org/
3 stars 0 forks source link

Slightly smaller font size (but pixel accurate) in Direct2D #16

Closed alexpana closed 10 years ago

alexpana commented 10 years ago

There is a slight font size difference between the Direct2D and the GDI+ implementation. For example: a font of size 9 has a height of 9 pixels when drawn using Direct2D but 12 pixels when drawn using GDI+.

Note: The Direct2D implementation takes into consideration the DPI of the output device since font sizes are measured in DIP (device-independent pixels). A msdn reference can be found here: http://msdn.microsoft.com/en-us/library/windows/desktop/ff684173%28v=vs.85%29.aspx

alexpana commented 10 years ago

It appears I was wrongly using the font's point size instead of the pixel size. This is fixed by abe10c6dc078aa6e76d05809ac73f903337327f5