Bug 1847397 - Check no post barrier needed when eliding it in UpdateRegExpStatics...
[gecko.git] / layout / reftests / fonts / generate-bitpattern-font.pl
blobd47ff4541f29f5875c991f1079d32ebeee27612a
1 #!/usr/bin/perl -w
3 # Generates an SVG Font where each glyph (identified on stdin by four
4 # hex characters) consists of a bit pattern representing the Unicode
5 # code point it is the glyph for.
7 use strict;
9 print <<EOF;
10 <svg xmlns="http://www.w3.org/2000/svg">
11 <font id="BitPattern" horiz-adv-x="1000">
12 <font-face font-family="BitPattern" units-per-em="1000" ascent="800"/>
13 EOF
15 while (<>) {
16 chomp;
17 next if /^\s*$/;
18 die unless /^[0-9A-Fa-f]{4}$/;
19 my $c = hex;
20 my $s = " <glyph unicode='&#x$_;' d='";
21 for (my $i = 0; $i < 32; $i++) {
22 if ($c & (1 << $i)) {
23 my $x = 100 * (7 - ($i % 8));
24 my $y = 100 * int($i / 8);
25 $s .= "M$x,$y v80h80v-80z ";
28 $s .= "'/>\n";
29 print $s;
32 print <<EOF;
33 </font>
34 </svg>
35 EOF