12
\$\begingroup\$

The specification of the "estimated" sign used by the European Union Directive (U+212e in Unicode, which you may not simply print for this challenge) is quite precise.

Specification of the EU estimated sign

To copy some restrictions from this question: Render the symbol to file or screen using vector or raster graphics. If your output is rasterised, your image must have dimensions of 264 pixels × 240 pixels or more. Any other helping lines or length indicators must not be drawn.

\$\endgroup\$
4
  • 9
    \$\begingroup\$ Quite precise, but still a bit unclear. What exactly are the 0,085, 0,013, and 0,025 measuring? Is the 0,846 diagonal in the middle intended to pass through the epicenter of the ellipse formed by the outer 1 and 0,9? \$\endgroup\$ Jul 21, 2016 at 18:36
  • 1
    \$\begingroup\$ Not the same symbol, but I think this is close enough to be considered a dup: codegolf.stackexchange.com/questions/26689/…. I'm not using my dup hammer though. \$\endgroup\$ Jul 21, 2016 at 19:22
  • \$\begingroup\$ @TimmyD 0,025 is the thickness of the cross bar, which is extends +/-0,0125 either side of the centre of the ellipse, rather than sitting on top of the centreline. (I inverted the symbol and checked.) 0,013 is the radius of the corner (it should be easy to find the centre of the corner circle). 0,085 is also the radius of the corner (a bit of help in finding the y coordinate of the corner circle would be nice.) \$\endgroup\$ Jul 21, 2016 at 19:40
  • 1
    \$\begingroup\$ More interesting if you avoid using the letters 'E', 'n', 'g', 'l', 'a', 'd'... \$\endgroup\$
    – Comintern
    Jul 21, 2016 at 22:56

5 Answers 5

15
\$\begingroup\$

VBA, 587 560 bytes

Sub S(a,b,c,d,e,f)
Set v=ActiveSheet.Shapes.AddShape(a,b,c,d,e)
v.Fill.ForeColor.RGB=f
v.Line.Visible=0
If a=5 Then v.Adjustments(1)=.5
End Sub
Sub U():p=91.5:w=-1
S 1,0,0,500,450,w
S 9,0,0,500,450,0
S 9,38.5,13.5,423,423,w
S 1,36,120,29,210,0
S 1,65,80,26.5,290,0
S 1,435,120,29,105,0
S 1,408.5,80,26.5,145,0
q=212.25:S 1,9,q,480,19,0
S 5,p,205.75,317,13,w
S 1,405,231.25,95,131.5,w
r=14.5:S 1,p,70.5,r,30,0
q=85:S 9,p,59.6,q,q,w
S 1,p,349.5,r,30,0
S 9,p,305.4,q,q,w
S 1,395,70.5,r,30,0
S 9,323.5,59.6,q,q,w
q=231.25:S 1,p,q,6.5,6.5,0
S 9,p,q,13,13,w
End Sub

Invoke macro U. Basically a lot of shape drawing. Shape 1 is a rectangle, 5 a rounded rectangle and 9 is an oval. Output is 500 wide by 450 high.

enter image description here

Edit: added the rounded rectangle (with adjustment to turn the ends into semicircles) to produce the radiused corners on top of the bar with one shape draw.

\$\endgroup\$
2
  • \$\begingroup\$ Excel lent - You sure did put a lot of work into that one! You can drop 2 bytes by changing Sub U() to Sub U \$\endgroup\$ Mar 28, 2017 at 21:16
  • \$\begingroup\$ Actuallly, you can get this down to 535 bytes by making changing f to Optional f=0 and removing the 0 f calls, removing the space in a=5 Then, moving the subroutines to a worksheet codepane and removing the ActiveSheet. call (this means that U is then called as Sheet1.U) and removing the () in Sub U() \$\endgroup\$ Dec 1, 2017 at 22:45
3
\$\begingroup\$

Haml + Sass, 20 + 722 = 742 bytes

I'm sure this could be golfed a lot more, but I'm happy enough with it. Demo on CodePen.

Note: Because of default margins, this needs a browser window at least 1,000-some pixels wide.

Haml

#u
#v
 #w
 #x
 #y
#z

Sass

$w: 1000px
$h: 900px
$a: 183px
$b: 25px
$p: 85px
$q: 13px
$d: 846px
$e: $w - 2*$a
$f: 143px
$s: 50%
$t: $p/5.5
=d($w:$w,$h:$h)
 width: $w
 height: $h
=m($c)
 background-color: $c
=k
 +m(#000)
 position: absolute
 content: ''
=l
 +k
 +m(#fff)
=o($o:$p)
 +d($o,$p)
=r($a)
 border-radius: $a
*
 +k
html,body
 +l
 position: relative
#u
 +d
 clip-path: ellipse($s $s)
#v
 +d($e)
 left: $a
 clip-path: circle(($d/2) at $s $s)
#v::before,#v::after
 +l
 +d($e,($h -$b)/2)
 +r($q)
#v::after
 bottom: 0
#w,#x
 +o($t)
 top: $f
#w::before,#x::before,#y::before
 +l
 +o
 +r($s 0)
#x,#x::before
 right: 0
#x::before
 +r(0 $s 0 0)
#y
 +o($t)
 bottom: $f
 z-index: 9
#y::before
 +r(0 0 0 $s)
#z
 +l
 +d($s,267px)
 top: ($h+$b)/2
 right: 0
\$\endgroup\$
3
\$\begingroup\$

GLSL + shadertoy.com, 349 345 344 bytes

#define F float
void mainImage(out vec4 R,vec2 C){F S=min(iResolution.x,iResolution.y/0.9);vec2 p=C/vec2(0.5,0.45)/S-1.;F A=0.94-length(p*vec2(1.22,1));F H=min(min(-p.y-0.025,p.y+0.551),p.x);F B=max(length(p)-1.,min(abs(p.y)-0.025,max(A,H)));F D=max(min(p.x,-p.y),max(-A,0.634-abs(p.x)));R=vec4(vec3(max(H,min(B*D*64.-0.01,min(B,D)))*S/3.),1);}

Can be tested by pasting the code on this page: https://www.shadertoy.com/new

Output (when the screen size is 1440*900):

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ Not sure about your corners at the ends of the central bar there, they don't look quite right. \$\endgroup\$
    – Joffan
    Jul 24, 2016 at 4:29
  • \$\begingroup\$ Maybe they should have a little different "size", I didn't really understand what size they should be, so approximated it with eyes \$\endgroup\$ Jul 24, 2016 at 12:05
  • 1
    \$\begingroup\$ They should be circular arcs with a radius of 0.013 (x the full width of the figure). \$\endgroup\$
    – Joffan
    Jul 24, 2016 at 15:44
1
\$\begingroup\$

PostScript, 280 140 bytes

Now smaller, with binary tokens and less precision!

00000000: 5b28 5b29 7b31 3339 9205 8881 3588 0035  [([){139....5..5
00000010: 2035 9207 887f 3588 7f88 2835 9207 9242   5....5...(5...B
00000020: 747d 285d 297b 885d 3938 8822 3088 2d92  t}(]){.]98."0.-.
00000030: 0588 0c30 9285 9242 7d2f 747b 3188 ff92  ...0...B}/t{1...
00000040: 8b7d 3e3e 920d 8864 3930 92ad 387b 307d  .}>>...d90..8{0}
00000050: 9283 880a 3992 8b88 0a30 8768 0192 0592  ....9....0.h....
00000060: 422e 3035 202e 3035 3592 8b31 9296 87a9  B.05 .055..1....
00000070: 0034 315b 3587 4001 8869 9280 87a9 0034  .41[[email protected]
00000080: 5b92 965d 88ff 3192 8b5d 745d            [..]..1..]t]

Before being tokenized (255 bytes):

[([){139 arc -127 5 0 5 5 arct 127 5 127 40 5 arct fill t}(]){93 98 34 0 45 arc 12 0 rlineto fill}/t{1 -1 scale}>>begin
100 90 translate
8{0}repeat
10 9 scale
10 0 360 arc fill
.05 .055 scale
1 setgray
169 41[5 320 105 rectfill
169 4[setgray]-1 1 scale]t]

Step-by-step:

step-by-step

Final output: final output

(Gray background is from Preview.app and not part of actual output.)

\$\endgroup\$
0
\$\begingroup\$

C (gcc), 251 248 bytes

-3 bytes thanks to @ceilingcat

#define q(x,y)(x)*(x)+(y)*(y)
#define A abs
main(i,j){puts("P5 264 240 1");for(i=-121;i++<119;)for(j=-133;j++<131;)putchar(((q(i,j*.9)>'8?'|q(i,j)<12471&A(j)<84)&q(A(i)-72,A(j)-81)>39|q(A(i)-65,A(j)-61)<504)&A(i)>3&(A(j)-83||A(i)-4)|j>0&i>3&i<73);}

Try it online!

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.