You are here: Re: Fonts and « PHP Programming Language « IT news, forums, messages
Re: Fonts and

Posted by Chung Leong on 12/18/45 11:50

ctclibby wrote:
> How do I get whatever surfer to download the proper font file? Sure,
> it can be an option given to the surfer, but how can I find out what
> fonts are available, then show the surfer a message or something? Is
> this an automagic thing? Am I going about this all wrong?

As far as I know there is no direct way to check if a font is install
on a user's computer. What you can do is create an element that
specifies the use of the font, then check its width to see if it comes
out. Something like:

var width;
var el = document.createElement('SPAN');
el.style.fontFamily = 'Comic Sans MS; Sans serif';
el.style.fontSize = '100px';
el.style.visibility = 'hidden';
el.innerHTML = 'III';
document.body.appendChild(el);
width = el.offsetWidth;
document.body.removeChild(el);


Since the capital I in Comic San Serif has a top and bottom bar where
as it would not a regular sans serif font, if the width isn't above a
certain number then the font isn't there.

The lack of font embedding is a major bummer with Mozilla.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация