I am trying to create a "save webpage as bitmap"-function on a website and i have some problems rendering the text in the correct size on the server side.
The fontsize settings for the text on the client is:
.textDiv
{
font-family: Verdana;
font-size:16px;
}
If i try to render this on the server with
float emSize = 16;
g.DrawString("mytext", new Font("Verdana", emSize), Brushes.Black, x, y);
The text will become about 20% larger on the server.
The documentation for new Font() says that the second argument(the font size) should be specified in em-points. What exactly is one em-point?
If i specify font-size:16em in the browser, the text becomes HUGE. If i specify font-size:1em in the browser the text will be around 14px big but if i put 1 as argument on the server the text becomes a thin line.
So, how do i convert from browser px or em to .net px/em.