Posters and Scale

In some cases, your poster may need to know the magnification in the current view.

For example, the normal behavior of text in a poster is to retain its specified size, at every magnification. But suppose you want the text to get smaller as you zoom out? You can do this!

The key things to know is that $ScreenWidth is the width of the poster, in pixels, and $Width is the logical width of the poster note, independent of magnification. At standard scale, 1 unit translates to 32 pixels. So the current magnification is ^value($ScreenWidth(32*$Width)). In CSS, this becomes:

<style>
body {
	font-size:^value($ScreenWidth/(32*$Width)*14 )px;
}
</style>

Thanks to Alan Liu for pointing this out.

6 Likes