I want to find out what would be the letter size in tirms of pixel width it will take for proportional fonts like Ariel.
You've bitten off a difficult problem. Assuming that the user hasn't overridden your style sheet, it's going to be nearly impossible to calculate absolutely correct numbers, but with a bit of manual work, you can get an approximation.
Start with some text of known width, and measure.
12345678901234567890123456789012345678901234567890
aaaaaaaaaaaaaaaaaaaa
...
iiiiiiiiiiiiiiiiiiii
...
MMMMMMMMMMMMMMMMMMMM
Then do a little measuring and division, and you can come up with a table of character width estimates.
| [reply] [d/l] |
This is platform-dependant.
I know that the Win32 GDI API has functions describing
font metrics and character sizes, so you might find
Win32::API useful.
Sorry I can't provide more useful information; my Win32
reference is at home, buried under mountains of paper (and
I hope it stays that way :-), and I'm unfamiliar with font
rendering in Perl in general.
--
:wq
| [reply] |
The short answer is "mu".
The long answer is that you can really only guesstimate how many pages it will take. There are many variables which will impact on how much paper will be consumed:
- Paper size (8.5"x11" vs A4)
- Font used, and size thereof ("Arial" vs. "Helvetica")
- Margin settings
- Optional headers and footers
- Browser being used
- Operating system and settings, such as anti-aliasing
- Printer peculiarities (laser vs. inkjet)
So if you can figure out an average, you get an idea. Otherwise, you might want to just suggest using the "Print Preview" function, which is always accurate.
Even if you know the width of the characters, you will have to calculate how images are inlined, words wrapped, and before you know it, you will be writing a Web browser simulator, which is probably an exercise in futility. | [reply] |
| [reply] |
This is almost as hard as to program a whole html-renderer engine. Moreover, this engine should be equivalent to Internet Explorer's one, or your page count estimate could mismatch the real one. | [reply] |