Monday, October 01, 2007

Canadian Signal Word Type Height Calculator

If you're in the business of designing packaging for Consumer Packaged Goods to be sold in Canada, you may have run across the amazingly complicated formula for calculating the size of the word "Caution" as it sits at the bottom of the package, warning the consumer not to drink the Drano, or what have you. The corresponding icons for "poisonous," "contents under pressure," etc. are quite punk rock, I will have to upload those later.

hazard.gif

So, this is the kind of thing you only have to do twice before it's safer and easier to offload the entire calculation off to the computer.

#! usr/bin/perl
# a formula used to calculate size of "signal word" for Cdn cautionary copy.
# Find diameter of a circle with an area equal to 3% of the PDP.
# That's how big any required symbol needs to be.
# The signal word then has to be 1/4 that size.

use Math::Complex;
use constant PI => 4 * atan2(1, 1);
print "enter the X dimension of your PDP in centimeters\n";
my $xDim = (<\STDIN\>);
print "enter the y dimension of your PDP in centimeters\n";
my $yDim = (<\STDIN\>);
my $PDPArea = $xDim * $yDim;
my $SignalWordHeight = (sqrt(($PDPArea * .03)/PI))/2;

printf "the area of the principal display panel is %.3f cm square, and the signal word should be at least %.3f cm high.\n", $PDPArea, $SignalWordHeight;

Update: Had to escape "STDIN" with backslashes for Blogger. Remove before use.

No comments: