1

I'm trying to find a way to get font measurements from within my PCL (Portable Class Library), however every resource I have come across to get font measurements seems to be platform specific.

Is this a limitation of the PCL to not support a portable way of retrieving font metrics?

And, if they have different ways of retrieving the metrics, does that mean that the metrics are different? That is, if I have Courier New 10 pt font, would the word Hello have a different width from a Windows desktop vs Windows Phone vs Windows RT application?

quepas
  • 956
  • 1
  • 13
  • 30
michael
  • 14,844
  • 28
  • 89
  • 177
  • Yes, fonts are highly platform-specific. Even on the same platform, a WPF font is a very different animal from a Winforms font. So this just can't work. Use a delegate if you have to so the host app can provide an implementation of whatever function you need. – Hans Passant Apr 02 '15 at 15:40
  • @HansPassant: Are you saying that the word **Hello** would actually take up a different amount of pixels (height, width, etc) on a Windows Form app, as opposed to a WPF app? – michael Apr 20 '15 at 14:46
  • Certainly. It isn't even consistent in a WPF app, backgrounder [is here](http://blogs.msdn.com/b/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx). – Hans Passant Apr 20 '15 at 14:51

0 Answers0