The International Code of Signals flag alphabet is used by ships for communication, particularly for static signals.
Your challenge is to write a program or function that will take a string from STDIN or as an argument, and display the corresponding text in the ICS flag alphabet. If your language does not display to the screen, saving to a file is acceptable.
Your program or function shall support letters A-Z in upper and lower case, plus Space and Newline. Behaviour with other characters is undefined.
The display shall be large enough to display capable of displaying at least 8 flags horizontally and 6 flags vertically. Behaviour is undefined if the right hand edge is reached before a newline is received, or if the message is too long to fit the display vertically.
The flag alphabet is as shown below (Roman letters are for reference only, they are not required in the output.)
Dimensions
There is no universally agreed standard for the dimensions of these flags, so for the purpose of this challenge the following shall apply:
Flags shall be 60x60 pixels, with a 30 pixel gap between them both horizontally and vertically.
The swallowtail cut on A and B shall be 15 pixels deep.
All other lines shall be horizontal, vertical, or at 45 degrees.
The features shall be located by dividing the flag into an imaginary NxN grid of side 3,4,5 or 6 squares. Refer to the above image, but for further clarification:
A,E,H,K, L and U are based on a 2x2 grid : width of each colour zone shall be 30pixels. Also the points of the diamond in F shall be halfway along each side of the flag.
J and T are based on a 3x3 grid: each band shall be 20 pixels.
P,N and S are based on a 4x4 grid. Also the diagonal lines of Y shall split the edges of the flag into 4.
C,D,R and X shall be based on a 5x5 grid. Bands and arms of crosses shall be 12 pixels wide.
G,W,M,V are based on a 6x6 grid. Bands of G and borders of W shall be 10 pixels wide. Arms of crosses on M and V shall cover the first and last 10 pixels of each edge of the flag, leaving triangle zones measuring 40 pixels along the long edge.
The circle of I shall be in the centre of the flag and have diameter 30 pixels.
An error of +/-1 pixel from the above text is permitted. If your language only supports scalable graphics, you may interpret "pixels" to mean "units."
Colours
Colours shall be red, white, blue, yellow and black as defined by your language or its documentation. If your language does not define colours, you may use the following: Red FF0000, White FFFFFF, Blue 0000FF, Yellow FFFF00, Black 0000000.
Background shall be grey (r,g and b channels equal, between 25% and 75% intensity.)
Scoring /Loopholes
This is codegolf. Shortest code in bytes wins.
Standard loopholes are disallowed.
No builtin or library functions for displaying flags may be used. Output shall be non-text (and in particular, unicode characters shall not be used to build up the flag shape.)
Example
JFK got
my VHS
PC
and XLR
web quiz
should produce the following