11
\$\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\$
  • 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\$ – AdmBorkBork Jul 21 '16 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\$ – Digital Trauma Jul 21 '16 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\$ – Level River St Jul 21 '16 at 19:40
  • 1
    \$\begingroup\$ More interesting if you avoid using the letters 'E', 'n', 'g', 'l', 'a', 'd'... \$\endgroup\$ – Comintern Jul 21 '16 at 22:56
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\$
  • \$\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\$ – Taylor Scott Mar 28 '17 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\$ – Taylor Scott Dec 1 '17 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\$
  • \$\begingroup\$ Not sure about your corners at the ends of the central bar there, they don't look quite right. \$\endgroup\$ – Joffan Jul 24 '16 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\$ – Sarge Borsch Jul 24 '16 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 '16 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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