Commit Graph

2 Commits

Author SHA1 Message Date
Baha bb7579d3e5 Embed print wordmark and pre-render it
Make sure the print wordmark is readily available for printing. In
addition to embedding, pre-render the wordmark outside the viewport so
that the print dialog doesn't block image rendering in the print view.

Bug: T169826
Change-Id: I788bcecadf26e4e5558b5b37e6fb1b2e9378277e
2017-08-04 11:42:18 -04:00
Baha 413870d350 Add print logo
Logo cannot be displayed as a background image because it won't be
visible in print unless the user prints backgrounds too.

A sample configuration looks like this:

$wgVectorPrintLogo = [
	'url' => 'https://en.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-en.svg',
	'width' => 174,
	'height' => 27
];

The solution presented in the patch has a downside of not being able
to scale images down if their dimensions are bigger than the
dimensions specified in the config variable. For example, if we want
to go with an SVG image, then IE8 won't be able to render it.
Alternatively, if we want to go with a PNG image, its dimensions need
to match the exact dimensoins in the config variable, otherwise the
image will show up larger or smaller depending on its dimensions.

A more complicated approach of scaling images using `transform: scale`
hasn't been used because we wanted to keep the configuration simple
while supporting the majority of our users. With the current change,
we can reuse the existing configuration options from Minerva, for
exmaple. It would look something like this:

$wgVectorPrintLogo = [
	'url' => $wgMFCustomLogos['copyright'],
	'width' => $wgMFCustomLogos['copyright-width'],
	'height' => $wgMFCustomLogos['copyright-height']
];

Bug: T169826
Change-Id: If8f9f8d95fd3c955ece37d6c8ab6995596189667
2017-08-01 10:55:53 -04:00