News for hackers. Stuff that matters.
Re:The “Y” logo in the top-left corner has been upgraded to SVG by phoe-krk on Wednesday May 10, 2023 @07:05PM (#35894712)
Here it is, in its full glory!

    <?xml version="1.0" encoding="utf-8"?>
    <svg viewBox="0 0 100 100" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
      <rect x="0" y="0" width="100" height="100" fill="rgb(255, 102, 0)"></rect>
      <path d="M 50 77 L 50 50 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt">
      </path>
      <path d="M 94.93056731583404 35.622745513916016 L 71.2454833984375 71.2454833984375 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt" transform="matrix(1 0 0 1 -21.2455 -21.2455)">
      </path>
      <path d="M -78.93056731583404 36.17028045654297 L -55.67118835449219 71.79300689697266 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt" transform="matrix(1 0 0 1 105.396 -21.7213)">
      </path>
      <rect transform="" width="100" height="23.742591024555463" stroke-width="1" stroke="none" fill="#FF6600" stroke-opacity="1" fill-opacity="1" stroke-linecap="butt" stroke-linejoin="miter" >
      </rect>
    </svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by jjcm on Wednesday May 10, 2023 @07:35PM (#35895079)
Interesting, I never realized the Y wasn't symmetrical. The left branch is slightly lower and to the left of the right branch in the Y. This also creates a gap in the center of it at high resolutions: https://i.imgur.com/vwPnz2j.png

If this wasn't intentional, here's a symmetrical version:

    <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
        <rect width="100" height="100" fill="#FF6600"/>
        <path fill-rule="evenodd" clip-rule="evenodd" d="M62.1762 23.7426H72.6857L54.3948 51.6515V76.9391H45.6048V51.6554L27.3143 23.7426H37.8233L49.9988 42.3233L62.1762 23.7426Z" fill="white"/>
    </svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by TimTheTinker on Wednesday May 10, 2023 @07:40PM (#35895111)
Perhaps the asymmetry is there to subtly evoke a dip and recovery of a company's stock price. The subtext could be "we build resilient companies".
Re:The “Y” logo in the top-left corner has been upgraded to SVG by Quindecillion on Thursday May 11, 2023 @01:19AM (#35897892)
Imperfections in vector images make me twitch
Re:The “Y” logo in the top-left corner has been upgraded to SVG by throwaway290 on Thursday May 11, 2023 @05:36AM (#35899848)
Fun fact: "Y" in your comment is not symmetrical either. Letter shapes are usually not symmetrical, Y/X/etc. even in gothic sans typefaces add asymmetries that make text easier to read.
Re:The “Y” logo in the top-left corner has been upgraded to SVG by 5- on Wednesday May 10, 2023 @07:18PM (#35894885)
that's a lot of svg! svgo suggests the following without any manual tinkering:

  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="#F60" d="M0 0h100v100H0z"/><path fill="none" stroke="#FFF" stroke-width="8.79" d="M50 77V50m23.69-35.62L50 50M26.47 14.45l23.25 35.62"/><path fill="#F60" d="M0 0h100v23.74H0z"/></svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by willis936 on Wednesday May 10, 2023 @07:20PM (#35894914)
Transport compression should get it most of the way there, no? I think having human readable vector graphics is nice.
Re:The “Y” logo in the top-left corner has been upgraded to SVG by h0l0cube on Wednesday May 10, 2023 @07:29PM (#35895018)
Apart from being one-lined, the optimised version is more readable and roughly about as compressible. There’s really no reason to have transformation matrices for 2 squares and a simple polygon
Re:The “Y” logo in the top-left corner has been upgraded to SVG by kashnote on Wednesday May 10, 2023 @07:28PM (#35895004)
This the most HN string of replies I've seen. Cheers haha
Re:The “Y” logo in the top-left corner has been upgraded to SVG by tomxor on Wednesday May 10, 2023 @08:27PM (#35895584)
transport compression isn't going to help with the unnecessary high precision coordinates.

There are also a bunch of things that are just the result of it being automatically generated by some vector package, such as the transforms, separate paths, masking of a bunch of strokes rather than just flattening the shape etc.

Re:The “Y” logo in the top-left corner has been upgraded to SVG by tomxor on Wednesday May 10, 2023 @08:16PM (#35895490)
I see your 258 byte svgo version and raise it my 171 byte hand optimized version:

    <svg viewBox="-32 -32 64 64" xmlns="http://www.w3.org/2000/svg"><path fill="#f60" d="M-32-32h64v64h-64z"/><path fill="#fff" d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by tomxor on Wednesday May 10, 2023 @08:18PM (#35895503)
Better still, an inline SVG fragment is only 151 bytes - and will save 318 bytes of http header:

    <svg viewBox="-32 -32 64 64" width=18 height=18><path fill=#f60 d="M-32-32h64v64h-64z"/><path fill=#fff d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by turnsout on Wednesday May 10, 2023 @09:42PM (#35896222)
118, can we beat it anyone?

<svg viewBox="-32 -32 64 64" style="background: #f60"><path fill="#fff" d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>

Re:The “Y” logo in the top-left corner has been upgraded to SVG by lights0123 on Wednesday May 10, 2023 @09:45PM (#35896262)
It doesn't need to be valid XML if you embed it in the HTML, which was their point.
Re:The “Y” logo in the top-left corner has been upgraded to SVG by turnsout on Wednesday May 10, 2023 @09:57PM (#35896356)
Edit: I stand corrected, it does parse correctly when embedded in HTML!
Re:The “Y” logo in the top-left corner has been upgraded to SVG by zimpenfish on Thursday May 11, 2023 @02:45AM (#35898603)
By the tiniest of margins, 115. Deleted two spaces and an `l`. Largely inspired by `svgo`. Using `rsvg-convert` to render them both to PNG shows identical output between this and the 118 version. https://rjp.is/hn-svg.html seems to render them identically in Safari and Chrome.

    <svg viewBox="-32-32 64 64" style="background:#f60"><path fill="#fff" d="m0-5-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by Squarex on Thursday May 11, 2023 @03:55AM (#35899143)
But not in Firefox :(
Re:The “Y” logo in the top-left corner has been upgraded to SVG by zimpenfish on Thursday May 11, 2023 @06:40AM (#35900292)
That appears to be trigged by "-32-32" (broken) vs "-32 -32" (working). Looks like this has been a long-standing weirdness in Firefox[1] where it is allowed somewhere but not other places.

On the other hand, the spec[2] does specify whitespace or commas between the viewbox numbers.

I rescind my 115 claim and reset it back to 116.

[1] https://github.com/svg/svgo/issues/12

[2] "a list of four numbers <min-x>, <min-y>, <width> and <height>, separated by whitespace and/or a comma"

Re:The “Y” logo in the top-left corner has been upgraded to SVG by turnsout on Thursday May 11, 2023 @10:14AM (#35902399)
We can move the fill to the style attribute and get it back down to 114:

  <svg viewBox="-32 -32 64 64" style="background:#f60;fill:#fff"><path d="m0-5-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
Re:The “Y” logo in the top-left corner has been upgraded to SVG by zimpenfish on Thursday May 11, 2023 @04:26PM (#35907924)
Oh, if you then switch to the comma-style for viewBox, drop the / from the path tag, and drop the quotes from the style attributes, that takes it down to 109.

Safari, Chrome, and Firefox are all perfectly happy with it but then rsvg-convert chokes on all of those changes. 114 is probably the best that can be done and still be "conforming" (for want of a better word.)

Re:The “Y” logo in the top-left corner has been upgraded to SVG by dmw_ng on Thursday May 11, 2023 @04:31AM (#35899413)
viewBox can be comma-separated, so you can loose the quotes but only for inline SVG
Re:The “Y” logo in the top-left corner has been upgraded to SVG by zimpenfish on Thursday May 11, 2023 @06:45AM (#35900337)
Well, that seems to work in everything (Firefox, Safari, Chrome, rsvg-convert) and drops it down to 114. Ta!
Re:The “Y” logo in the top-left corner has been upgraded to SVG by goodrubyist on Wednesday May 10, 2023 @07:17PM (#35894876)
so many butts!
Re:The “Y” logo in the top-left corner has been upgraded to SVG by layer8 on Thursday May 11, 2023 @02:00AM (#35898239)
Why use such un-round numbers though?