views:

30

answers:

2

Hello,

I need to generate small images for certain parts of text. Those will have to fit into the text seamlessly. I know I can not make up for every browser font settings available, but how do I have to check for Linux, Mac and Windows users depending on the user agent? I want to use the right font (of the three "Verdana, Arial, Helvetiva") for the right user agent OS.

So:

  1. How do I check for the OS? What do I have to compare to in the user agent?
  2. Where can I get the other two fonts. Does the Windows-included Verdana look the same as the one used on Linux (or, is it free anyway? I don't know much about fonts)? Where do I get Helvetica? Is it Mac OS licensed?

Any code examples can be in either c# or VB.NET. I can read both.

Thank you in advance.

A: 

If you use @font-face in your css and specify the font-size in pixels, you will get the same font on all platforms at a predictable size. Then you can create one set of images for all platforms.

egrunin
I think they're trying to make images of email addresses to make it harder for spam bots to get them or something. If so, CSS `@font-face` wouldn't work.
icktoofay
Something like that. I want to generate images which fit into the text flow perfectly. And this for every of the 3 font familys.
sinni800
+1  A: 

For client side, have a look at http://www.w3schools.com/js/js_browser.asp

For server side, look at Request.Browser.Platform.

As for the fonts, I can't tell you much, except to make sure that you have a (virtual) machine that matches each platform you want to target. In my opinion, it's the only way to be really sure that whatever you end up doing actually works.

LaustN
Request.Browser.Platform looks great. Now I just need to know what where I can get Helvetica...
sinni800
Well I read up on the font thing and saw that Arial is in fact something modeled after Helvetica... http://www.ms-studio.com/articles.html... So I would have to pay to get Helvetica without an Apple OS.Alright, I'll just differentiate between Verdana and Arial then--
sinni800