| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Text; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Text - A XFig file animator class - Text object |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Text object - object code in FIG format: 4. |
|
10
|
|
|
|
|
|
|
Here are all the attributes of this class: |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
B
|
|
13
|
|
|
|
|
|
|
height, length, x, y, text, visibility, center_x, center_y> |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 FIG ATTRIBUTES |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=over |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=item sub_type |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
0: Left justified; |
|
22
|
|
|
|
|
|
|
1: Center justified; |
|
23
|
|
|
|
|
|
|
2: Right justified. |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=item pen_color |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
-1..31: FIG colors; |
|
28
|
|
|
|
|
|
|
32..543 (512 total): user colors. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=item depth |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
0 ... 999: larger value means object is deeper than (under) |
|
33
|
|
|
|
|
|
|
objects with smaller depth |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item pen_style |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
unused |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item font |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
For font_flags bit 2 = 0 (LaTeX fonts): |
|
42
|
|
|
|
|
|
|
0: Default font; |
|
43
|
|
|
|
|
|
|
1: Roman; |
|
44
|
|
|
|
|
|
|
2: Bold; |
|
45
|
|
|
|
|
|
|
3: Italic; |
|
46
|
|
|
|
|
|
|
4: Sans Serif; |
|
47
|
|
|
|
|
|
|
5: Typewriter. |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
For font_flags bit 2 = 1 (PostScript fonts): |
|
50
|
|
|
|
|
|
|
-1: Default font; |
|
51
|
|
|
|
|
|
|
0: Times Roman; |
|
52
|
|
|
|
|
|
|
1: Times Italic; |
|
53
|
|
|
|
|
|
|
2: Times Bold; |
|
54
|
|
|
|
|
|
|
3: Times Bold Italic; |
|
55
|
|
|
|
|
|
|
4: AvantGarde Book; |
|
56
|
|
|
|
|
|
|
5: AvantGarde Book Oblique; |
|
57
|
|
|
|
|
|
|
6: AvantGarde Demi; |
|
58
|
|
|
|
|
|
|
7: AvantGarde Demi Oblique; |
|
59
|
|
|
|
|
|
|
8: Bookman Light; |
|
60
|
|
|
|
|
|
|
9: Bookman Light Italic; |
|
61
|
|
|
|
|
|
|
10: Bookman Demi; |
|
62
|
|
|
|
|
|
|
11: Bookman Demi Italic; |
|
63
|
|
|
|
|
|
|
12: Courier; |
|
64
|
|
|
|
|
|
|
13: Courier Oblique; |
|
65
|
|
|
|
|
|
|
14: Courier Bold; |
|
66
|
|
|
|
|
|
|
15: Courier Bold Oblique; |
|
67
|
|
|
|
|
|
|
16: Helvetica; |
|
68
|
|
|
|
|
|
|
17: Helvetica Oblique; |
|
69
|
|
|
|
|
|
|
18: Helvetica Bold; |
|
70
|
|
|
|
|
|
|
19: Helvetica Bold Oblique; |
|
71
|
|
|
|
|
|
|
20: Helvetica Narrow; |
|
72
|
|
|
|
|
|
|
21: Helvetica Narrow Oblique; |
|
73
|
|
|
|
|
|
|
22: Helvetica Narrow Bold; |
|
74
|
|
|
|
|
|
|
23: Helvetica Narrow Bold Oblique; |
|
75
|
|
|
|
|
|
|
24: New Century Schoolbook Roman; |
|
76
|
|
|
|
|
|
|
25: New Century Schoolbook Italic; |
|
77
|
|
|
|
|
|
|
26: New Century Schoolbook Bold; |
|
78
|
|
|
|
|
|
|
27: New Century Schoolbook Bold Italic; |
|
79
|
|
|
|
|
|
|
28: Palatino Roman; |
|
80
|
|
|
|
|
|
|
29: Palatino Italic; |
|
81
|
|
|
|
|
|
|
30: Palatino Bold; |
|
82
|
|
|
|
|
|
|
31: Palatino Bold Italic; |
|
83
|
|
|
|
|
|
|
32: Symbol; |
|
84
|
|
|
|
|
|
|
33: Zapf Chancery Medium Italic; |
|
85
|
|
|
|
|
|
|
34: Zapf Dingbats. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item font_size |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
font size in points |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item angle |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
radians, the angle of the text |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item font_flags |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
bit0: Rigid text (text doesn't scale when scaling compound objects); |
|
98
|
|
|
|
|
|
|
bit1: Special text (for LaTeX); |
|
99
|
|
|
|
|
|
|
bit2: PostScript font (otherwise LaTeX font is used); |
|
100
|
|
|
|
|
|
|
bit3: Hidden text. |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item height, length |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Fig units |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item x, y |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Fig units, coordinate of the origin of the string. |
|
109
|
|
|
|
|
|
|
If sub_type = 0, it is the lower left corner of the string. |
|
110
|
|
|
|
|
|
|
If sub_type = 1, it is the lower center. |
|
111
|
|
|
|
|
|
|
Otherwise it is the lower right corner of the string. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item text |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
ASCII characters; |
|
116
|
|
|
|
|
|
|
starts after a blank character following the last number and |
|
117
|
|
|
|
|
|
|
ends before the sequence '\001'. This sequence is not part of the string. |
|
118
|
|
|
|
|
|
|
Characters above octal 177 are represented by \xxx where xxx is the |
|
119
|
|
|
|
|
|
|
octal value. This permits fig files to be edited with 7-bit editors and sent |
|
120
|
|
|
|
|
|
|
by e-mail without data loss. Note that the string may contain '\n'. |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=back |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 ADDITONNAL ATTRIBUTES |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=over |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item visibility |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
0: hidden; |
|
131
|
|
|
|
|
|
|
1: shown |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item center_x, center_y |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
calculated center (Fig units) |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item max_spline_step |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
parameter for computing polyline from spline (default 0.2) |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item high_precision |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
parameter for computing polyline from spline (default 0.5) |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=back |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=cut |
|
148
|
|
|
|
|
|
|
|
|
149
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
37
|
|
|
150
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
27
|
|
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# useful classes |
|
153
|
1
|
|
|
1
|
|
6
|
use FigAnim::Utils; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
1456
|
|
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
# constructor |
|
156
|
|
|
|
|
|
|
sub new { |
|
157
|
0
|
|
|
0
|
|
|
my $proto = shift; |
|
158
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto; |
|
159
|
0
|
|
|
|
|
|
my $self = {}; |
|
160
|
|
|
|
|
|
|
|
|
161
|
0
|
|
|
|
|
|
$self->{name} = shift; # object's name in comment |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
#$self->{object_code} = 4; |
|
164
|
0
|
|
|
|
|
|
$self->{sub_type} = shift; |
|
165
|
0
|
|
|
|
|
|
$self->{pen_color} = shift; |
|
166
|
0
|
|
|
|
|
|
$self->{depth} = shift; |
|
167
|
0
|
|
|
|
|
|
$self->{pen_style} = shift; |
|
168
|
0
|
|
|
|
|
|
$self->{font} = shift; |
|
169
|
0
|
|
|
|
|
|
$self->{font_size} = shift; |
|
170
|
0
|
|
|
|
|
|
$self->{angle} = shift; |
|
171
|
0
|
|
|
|
|
|
$self->{font_flags} = shift; |
|
172
|
0
|
|
|
|
|
|
$self->{height} = shift; |
|
173
|
0
|
|
|
|
|
|
$self->{length} = shift; |
|
174
|
0
|
|
|
|
|
|
$self->{x} = shift; |
|
175
|
0
|
|
|
|
|
|
$self->{y} = shift; |
|
176
|
0
|
|
|
|
|
|
$self->{text} = shift; |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# reference to the FigFile |
|
179
|
0
|
|
|
|
|
|
$self->{fig_file} = shift; |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
# object's visibility : 0=hidden 1=shown |
|
182
|
0
|
|
|
|
|
|
$self->{visibility} = 1; |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# calculated center |
|
185
|
0
|
|
|
|
|
|
$self->{center_x} = undef; |
|
186
|
0
|
|
|
|
|
|
$self->{center_y} = undef; |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
# animations |
|
189
|
0
|
|
|
|
|
|
$self->{animations} = []; |
|
190
|
|
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
|
bless ($self, $class); |
|
192
|
0
|
|
|
|
|
|
return $self; |
|
193
|
|
|
|
|
|
|
} |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
# methods |
|
197
|
|
|
|
|
|
|
sub clone { |
|
198
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
199
|
0
|
|
|
|
|
|
my $obj = new Text; |
|
200
|
0
|
|
|
|
|
|
$obj->{$_} = $self->{$_} foreach (keys %{$self}); |
|
|
0
|
|
|
|
|
|
|
|
201
|
0
|
|
|
|
|
|
return $obj; |
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub output { |
|
205
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
206
|
0
|
0
|
|
|
|
|
return if ($self->{visibility} == 0); |
|
207
|
|
|
|
|
|
|
|
|
208
|
0
|
|
|
|
|
|
my $fh = shift; |
|
209
|
|
|
|
|
|
|
|
|
210
|
0
|
|
|
|
|
|
foreach (split(/\n/, $self->{name})) { |
|
211
|
0
|
|
|
|
|
|
printf $fh "# $_\n"; |
|
212
|
|
|
|
|
|
|
} |
|
213
|
|
|
|
|
|
|
|
|
214
|
0
|
|
|
|
|
|
printf $fh "4 %d %d %d %d %d %g %.4f %d %g %g %d %d %s\\001\n", |
|
215
|
|
|
|
|
|
|
@$self{'sub_type','pen_color','depth','pen_style','font','font_size', |
|
216
|
|
|
|
|
|
|
'angle','font_flags','height','length','x','y','text'}; |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub calculateCenter { |
|
220
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
221
|
0
|
0
|
|
|
|
|
if ($self->{sub_type} == 0) { |
|
|
|
0
|
|
|
|
|
|
|
222
|
0
|
|
|
|
|
|
$self->{center_x} = $self->{x} + sprintf("%.0f", $self->{length} / 2); |
|
223
|
|
|
|
|
|
|
} elsif ($self->{sub_type} == 1) { |
|
224
|
0
|
|
|
|
|
|
$self->{center_x} = $self->{x}; |
|
225
|
|
|
|
|
|
|
} else { |
|
226
|
0
|
|
|
|
|
|
$self->{center_x} = $self->{x} - sprintf("%.0f", $self->{length} / 2); |
|
227
|
|
|
|
|
|
|
} |
|
228
|
0
|
|
|
|
|
|
$self->{center_y} = $self->{y} + sprintf("%.0f", $self->{height} / 2); |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
# animation methods |
|
233
|
|
|
|
|
|
|
sub setAttributeValue { |
|
234
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
235
|
0
|
|
|
|
|
|
my @anim = (0, $self->{name}, shift, 0, shift, shift); |
|
236
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
sub setPenColor { |
|
240
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
241
|
0
|
|
|
|
|
|
my $time = shift; |
|
242
|
0
|
|
|
|
|
|
my $color = $FigAnim::Utils::colors_codes{shift}; |
|
243
|
0
|
0
|
|
|
|
|
if (defined $color) { |
|
244
|
0
|
|
|
|
|
|
my @anim = (0, $self->{name}, $time, 0, 'pen_color', $color); |
|
245
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
} |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
sub hide { |
|
250
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
251
|
0
|
|
|
|
|
|
my @anim = (0, $self->{name}, shift, 0, 'visibility', 0); |
|
252
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
sub show { |
|
256
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
257
|
0
|
|
|
|
|
|
my @anim = (0, $self->{name}, shift, 0, 'visibility', 1); |
|
258
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
} |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
sub translate { |
|
262
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
263
|
0
|
|
|
|
|
|
my @anim = (14, $self->{name}, shift, shift, shift, shift, shift); |
|
264
|
0
|
0
|
|
|
|
|
$anim[6] = '' if (!(defined $anim[6])); |
|
265
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
sub rotate { |
|
269
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
270
|
0
|
|
|
|
|
|
my @anim = (24, $self->{name}, shift, shift, shift, shift, shift, shift); |
|
271
|
0
|
0
|
0
|
|
|
|
if (!((defined $anim[5]) && (defined $anim[6]))) { |
|
272
|
0
|
|
|
|
|
|
$anim[5] = $self->{center_x}; |
|
273
|
0
|
|
|
|
|
|
$anim[6] = $self->{center_y}; |
|
274
|
|
|
|
|
|
|
} |
|
275
|
0
|
0
|
|
|
|
|
$anim[7] = '' if (!(defined $anim[7])); |
|
276
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
} |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
sub scale { |
|
280
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
281
|
0
|
|
|
|
|
|
my @anim = (34, $self->{name}, shift, shift, shift, shift, shift); |
|
282
|
0
|
0
|
0
|
|
|
|
if (!((defined $anim[5]) && (defined $anim[6]))) { |
|
283
|
0
|
|
|
|
|
|
$anim[5] = $self->{center_x}; |
|
284
|
0
|
|
|
|
|
|
$anim[6] = $self->{center_y}; |
|
285
|
|
|
|
|
|
|
} |
|
286
|
0
|
|
|
|
|
|
push @{$self->{fig_file}->{animations}}, \@anim; |
|
|
0
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
# outputs a SVG element |
|
291
|
|
|
|
|
|
|
sub outputSVG { |
|
292
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
293
|
0
|
|
|
|
|
|
my $fh = shift; |
|
294
|
|
|
|
|
|
|
|
|
295
|
0
|
|
|
|
|
|
my ($colors) = @_; |
|
296
|
|
|
|
|
|
|
|
|
297
|
0
|
|
|
|
|
|
foreach (split(/\n/, $self->{name})) { |
|
298
|
0
|
|
|
|
|
|
print $fh "\n"; |
|
299
|
|
|
|
|
|
|
} |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# converts values in SVG-CSS |
|
302
|
|
|
|
|
|
|
|
|
303
|
0
|
|
|
|
|
|
my $style = "style=\""; |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
# sub_type |
|
306
|
0
|
0
|
|
|
|
|
if ($self->{sub_type} == 0) { $style .= "text-anchor: start; "; } |
|
|
0
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
307
|
0
|
|
|
|
|
|
elsif ($self->{sub_type} == 1) { $style .= "text-anchor: middle; "; } |
|
308
|
0
|
|
|
|
|
|
elsif($self->{sub_type} == 2) { $style .= "text-anchor: end; "; } |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
# color |
|
311
|
|
|
|
|
|
|
$style .= |
|
312
|
0
|
|
|
|
|
|
"fill: " . |
|
313
|
|
|
|
|
|
|
ConvertSVG::pen_fill_colors_to_rgb($self->{pen_color}, $colors) . |
|
314
|
|
|
|
|
|
|
"; "; |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
# font_size |
|
317
|
0
|
|
|
|
|
|
$style .= "font-size: " . ($self->{font_size} * 12) . "; "; |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
# font |
|
320
|
0
|
|
|
|
|
|
$style .= ConvertSVG::font_flags_to_font($self->{font_flags}, |
|
321
|
|
|
|
|
|
|
$self->{font}); |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
# end of style |
|
324
|
0
|
|
|
|
|
|
$style .= "\""; |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# x |
|
327
|
0
|
|
|
|
|
|
my $x = "x=\"" . $self->{x} . "\""; |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
# y |
|
330
|
0
|
|
|
|
|
|
my $y = "y=\"" . $self->{y} . "\""; |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
# angle |
|
333
|
0
|
|
|
|
|
|
my $angle = ConvertSVG::rad_to_deg($self->{angle}); |
|
334
|
0
|
|
|
|
|
|
my $transform = ""; |
|
335
|
0
|
0
|
|
|
|
|
if ($angle != 0) { |
|
336
|
0
|
|
|
|
|
|
$transform = |
|
337
|
|
|
|
|
|
|
"transform=\"rotate($angle, " . |
|
338
|
|
|
|
|
|
|
$self->{x} . ", " . |
|
339
|
|
|
|
|
|
|
$self->{y} . |
|
340
|
|
|
|
|
|
|
")\""; |
|
341
|
|
|
|
|
|
|
} |
|
342
|
|
|
|
|
|
|
|
|
343
|
0
|
|
|
|
|
|
my $text = $self->{text}; |
|
344
|
|
|
|
|
|
|
|
|
345
|
0
|
|
|
|
|
|
print $fh "\n"; |
|
346
|
|
|
|
|
|
|
|
|
347
|
0
|
|
|
|
|
|
for (my $i = 0; $i < length($text); $i++) { |
|
348
|
0
|
|
|
|
|
|
my $char = substr($text, $i, 1); |
|
349
|
|
|
|
|
|
|
|
|
350
|
0
|
0
|
|
|
|
|
if ($char eq "&") { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
351
|
0
|
|
|
|
|
|
$char = "&"; |
|
352
|
|
|
|
|
|
|
} elsif ($char eq "<") { |
|
353
|
0
|
|
|
|
|
|
$char = "<"; |
|
354
|
|
|
|
|
|
|
} elsif ($char eq ">") { |
|
355
|
0
|
|
|
|
|
|
$char = ">"; |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
|
|
358
|
0
|
|
|
|
|
|
my $char_code = substr($text, $i, 4); |
|
359
|
0
|
0
|
|
|
|
|
if ($char_code =~ m/\\\d{3}/) { |
|
360
|
0
|
|
|
|
|
|
$char = substr($char_code, 1, 3); |
|
361
|
|
|
|
|
|
|
|
|
362
|
0
|
|
|
|
|
|
$char = |
|
363
|
|
|
|
|
|
|
substr($char, 0, 1)*8*8 + |
|
364
|
|
|
|
|
|
|
substr($char, 1, 1)*8 + |
|
365
|
|
|
|
|
|
|
substr($char, 2, 1); |
|
366
|
|
|
|
|
|
|
|
|
367
|
0
|
|
|
|
|
|
$char = sprintf("\&\#%03u;", $char); |
|
368
|
|
|
|
|
|
|
|
|
369
|
0
|
|
|
|
|
|
$i += 3; |
|
370
|
|
|
|
|
|
|
} |
|
371
|
|
|
|
|
|
|
|
|
372
|
0
|
|
|
|
|
|
print $fh $char; |
|
373
|
|
|
|
|
|
|
} |
|
374
|
|
|
|
|
|
|
|
|
375
|
0
|
|
|
|
|
|
print $fh "\n"; |
|
376
|
|
|
|
|
|
|
|
|
377
|
0
|
0
|
|
|
|
|
if ($#{$self->{animations}} >= 0) { # SVG + SMIL |
|
|
0
|
|
|
|
|
|
|
|
378
|
0
|
|
|
|
|
|
for (my $i = 0; $i <= $#{$self->{animations}}; $i++) { |
|
|
0
|
|
|
|
|
|
|
|
379
|
0
|
|
|
|
|
|
print $fh "\t"; |
|
380
|
0
|
|
|
|
|
|
my $smil = ConvertSMIL::smil($self->{animations}[$i]); |
|
381
|
0
|
|
|
|
|
|
print $fh $smil; |
|
382
|
0
|
|
|
|
|
|
print $fh "\n"; |
|
383
|
|
|
|
|
|
|
} |
|
384
|
|
|
|
|
|
|
} |
|
385
|
|
|
|
|
|
|
|
|
386
|
0
|
|
|
|
|
|
print $fh "\n\n" |
|
387
|
|
|
|
|
|
|
} |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
1; |