| 1 |
% METAFONT source for Bahá'í nine-pointed star |
| 2 |
% Using proper coordinates from SVG path data |
| 3 |
|
| 4 |
% Font parameters |
| 5 |
font_identifier "BAHAISTAR"; |
| 6 |
font_size 10pt#; |
| 7 |
|
| 8 |
% Basic setup |
| 9 |
mode_setup; |
| 10 |
|
| 11 |
% Nine-pointed star at asterisk position |
| 12 |
beginchar("*", 10pt#, 10pt#, 0pt#); |
| 13 |
"Bahai nine-pointed star"; |
| 14 |
|
| 15 |
% Center and scale factor |
| 16 |
x_center := w/2; |
| 17 |
y_center := 0.3*h; |
| 18 |
scale_factor := 0.003; % Scale from SVG coordinates (~240 range) to character size |
| 19 |
|
| 20 |
% Define all 18 points (9 outer + 9 inner alternating) |
| 21 |
% SVG points: 0.0,-120.0 17.1,-47.0 77.1,-91.9 43.3,-25.0 118.2,-20.8 49.2,8.7 103.9,60.0 32.1,38.3 41.0,112.8 0.0,50.0 -41.0,112.8 -32.1,38.3 -103.9,60.0 -49.2,8.7 -118.2,-20.8 -43.3,-25.0 -77.1,-91.9 -17.1,-47.0 |
| 22 |
|
| 23 |
pair star_points[]; |
| 24 |
star_points[1] := (x_center + scale_factor * 0.0 * w, y_center - scale_factor * (-120.0) * h); |
| 25 |
star_points[2] := (x_center + scale_factor * 17.1 * w, y_center - scale_factor * (-47.0) * h); |
| 26 |
star_points[3] := (x_center + scale_factor * 77.1 * w, y_center - scale_factor * (-91.9) * h); |
| 27 |
star_points[4] := (x_center + scale_factor * 43.3 * w, y_center - scale_factor * (-25.0) * h); |
| 28 |
star_points[5] := (x_center + scale_factor * 118.2 * w, y_center - scale_factor * (-20.8) * h); |
| 29 |
star_points[6] := (x_center + scale_factor * 49.2 * w, y_center - scale_factor * 8.7 * h); |
| 30 |
star_points[7] := (x_center + scale_factor * 103.9 * w, y_center - scale_factor * 60.0 * h); |
| 31 |
star_points[8] := (x_center + scale_factor * 32.1 * w, y_center - scale_factor * 38.3 * h); |
| 32 |
star_points[9] := (x_center + scale_factor * 41.0 * w, y_center - scale_factor * 112.8 * h); |
| 33 |
star_points[10] := (x_center + scale_factor * 0.0 * w, y_center - scale_factor * 50.0 * h); |
| 34 |
star_points[11] := (x_center + scale_factor * (-41.0) * w, y_center - scale_factor * 112.8 * h); |
| 35 |
star_points[12] := (x_center + scale_factor * (-32.1) * w, y_center - scale_factor * 38.3 * h); |
| 36 |
star_points[13] := (x_center + scale_factor * (-103.9) * w, y_center - scale_factor * 60.0 * h); |
| 37 |
star_points[14] := (x_center + scale_factor * (-49.2) * w, y_center - scale_factor * 8.7 * h); |
| 38 |
star_points[15] := (x_center + scale_factor * (-118.2) * w, y_center - scale_factor * (-20.8) * h); |
| 39 |
star_points[16] := (x_center + scale_factor * (-43.3) * w, y_center - scale_factor * (-25.0) * h); |
| 40 |
star_points[17] := (x_center + scale_factor * (-77.1) * w, y_center - scale_factor * (-91.9) * h); |
| 41 |
star_points[18] := (x_center + scale_factor * (-17.1) * w, y_center - scale_factor * (-47.0) * h); |
| 42 |
|
| 43 |
% Create the star path |
| 44 |
path star_path; |
| 45 |
star_path := star_points[1]; |
| 46 |
for i := 2 upto 18: |
| 47 |
star_path := star_path -- star_points[i]; |
| 48 |
endfor; |
| 49 |
star_path := star_path -- cycle; |
| 50 |
|
| 51 |
% Set pen and draw the star |
| 52 |
pickup pencircle scaled 0.5pt; |
| 53 |
draw star_path; |
| 54 |
|
| 55 |
endchar; |
| 56 |
|
| 57 |
end |