Jump to content

GernotM

Members
  • Posts

    8
  • Joined

  • Last visited

GernotM's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. I agree completely with your opinion regarding the print surprises you can get with the different browsers. Since there is no way a combination of cyan, magenta, and yellow ink will give you white, and 'no ink' gives you white only on a white paper, a light gray may be the closest approximation to white deliberately chosen to print something on possibly non-white paper. Perhaps that is the rationale, and perhaps it is stated somewhere but I have never seen it expressed. On the other hand it may simply be a programming bug in window.print or (all?) printer software. After all, how many people are crazy enough to try to print a white character... Thanks for the discussion.GernotM
  2. 1. I didn't put the script tags above the body tag. The W3Schools example did. 2. Yes, the font attributes ought to be declared in CSS. But that's not the main issue here. 3. It's not a printer thing. I tried 3 different model printers (all inkjets). 4. I maligned monospace fonts wrongly. With Lucida Console, space comes out correctly so the issue is moot. Nevertheless, I find it curious that a character specified as 'white' comes out gray, i.e. white does not really equal 'no color'. Thanks,GernotM.
  3. I've edited your example on window.print() as follows:<!DOCTYPE html><html><head><script>function printpage(){window.print();}</script></head><body><font color='red'>A</font><font color='blue'>B</font><font color='red'>C</font><font color='black'>D</font><font color='gray'>E</font><br><font color='red'>A</font><font color='blue'>B</font><font color='white'>C</font><font color='black'>D</font><font color='gray'>E</font><input type="button" value="Print this page" onclick="printpage()" /></body></html> (The font tag I used is deprecated but it's quick.)The reason I am printing a white character on white paper instead of printing a space has to do with trying to maintain vertical alignment of characters because browsers seem to compress whitespace, even for monospace fonts (I did only limited experiments). In the display, the letter C in the second row is not visible, as intended, while vertical alignment of the other characters is maintained. If the page is printed, the alignment is fine but the letter C in the second row is printed in gray. Independent of the merits, or lack thereof, of my approach, why is that? Can it be avoided? Thanks,GernotM
×
×
  • Create New...