Debian Codegraph @

texmf-dist/doc/fonts/eurosym/eurosym.cpp

raw
1 // -*- Mode: C++ -*-
2
3 #include <fig.h>
4
5 int main (int, char **)
6 {
7 // These measures are taken from an ``official'' Euro symbol
8 // that is programmed in PostScript (which turns out not to
9 // use the correct measures.
10
11 // However, let's view the values in mm.
12 Fig::unit= Fig::mm;
13
14 // Default angle unit is degrees:
15 Fig::angle_unit= Fig::deg;
16
17 // The origin is at the center of the arcs.
18 // Inner Arc:
19 FigDimension const inner_arc_radius= 67.5;
20 FigAngle const inner_arc_angle1= 40.0;
21 FigAngle const inner_arc_angle2= 320.0;
22
23 // Outer Arc:
24 FigDimension const outer_arc_radius= 77.5; // Hmmm... It can be seen that the line width
25 // is 10 units. So the inner radius contradicts
26 // the official construction; if must be 5 units
27 // and the outer one 6 units.
28 FigDimension const outer_arc_angle1= 311.8513;
29 FigDimension const outer_arc_angle2= 43.68390;
30
31 // However, just for the fun of it, continue to write the rest as a fig-file, too:
32
33 FILE *f=fopen ("eurosym.fig", "wt");
34 (new FigFile (
35 FigVectorWidget ()
36 << (new FigCEllipse (0, 0, inner_arc_radius)) // instead of arc, use a circle for now
37 << (new FigCEllipse (0, 0, outer_arc_radius))
38 << (new FigClosedPoly (
39 FigVectorPoint()
40 << FigPoint (26.73339, -15)
41 << FigPoint (-97.5, -15)
42 << FigPoint (-93.22267, -5)
43 << FigPoint (31.010728, -5)
44 << FigPoint (26.73339, -15)
45 ))
46 << (new FigClosedPoly (
47 FigVectorPoint()
48 << FigPoint (35.28807, 5)
49 << FigPoint (-97.5, 5)
50 << FigPoint (-93.22267, 15)
51 << FigPoint (39.56541, 15)
52 << FigPoint (35.28807, 5)
53 ))
54 ))->scale (1, -1)
55 ->translate (120, 100)
56 ->save (f);
57 fclose (f);
58
59 return 0;
60 }