Reply to Re: Determining the font characteristics of any web page?

Your name:

Reply:


Posted by Jim Higson on 06/20/06 21:21

Peter Olcott wrote:

>
> "Neredbojias" <http://www.neredbojias.com/fliam.php?cat=alt.html> wrote in
> message news:Xns97E88E93B789Ehttpwwwneredbojiasco@208.49.80.251...
>> To further the education of mankind, "Peter Olcott" <olcott@att.net>
>> vouchsafed:
>>
>>>>> I must know the point size. Imagine that I am writing a browser, and
>>>>> must display any webpage.
>>>>
>>>> Display where? If in users' browsers, just keyphrase-identify all
>>>> the various valid (and some invalid) possible font-designators and
>>>> copy their attributes verbatim. However, if your process depends
>>>> upon determining each user's browser default font-size, etc., to
>>>> accomplish its task, that really isn't possible.
>>>>
>>>
>>> Then browsers couldn't do it, and since they do it, therefore its not
>>> impossible.
>>
>> Actually, they don't; they _set_ the font-size for their application,
>> determining, perhaps, the OS default font size as necessary. If doing
>> this in points is really accurate (which I doubt), said browser must also
>> find out the current monitor size and resolution.
>
> I need to know whatever the final result is that these browsers use to
> display the text on the browser window. It does not matter if it is in
> point size, or tmHeight, as long as it is 100% precise.

Perhaps you could do it using an open source renderer like Gecko by
stripping out all the code you don't want (perhaps millions of lines) so
you basically just have a parsing and layout engine that doesn't display
anything. A very daunting task.

No idea what you could do with Trident (the IE engine) though. If you want
to copy the (weird) layout behaviour exactly the only thing I can think of
is clean room reverse engineering. Won't ever be exact though and really,
unless you have a huge team of experts (In which case, why would you post
here?) this seems not worth bothering with.

Another idea: how about you display the text, capture it and OCR it with
some kind of font recognition? Would that be OK? Seems hackish but might
work.

--
Jim

[Back to original 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

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