News for hackers. Stuff that matters.
Re:Country Flags in SVG by blue1 on Friday February 04, 2022 @06:46AM (#30205591)
Except that flags do not all have the same ratio. It may be useful to assume so for graphic layouts, but it is not really correct.
Re:Country Flags in SVG by fredoralive on Friday February 04, 2022 @06:59AM (#30205704)
The 1:1 variants seem to indicate that this collection is intended more for the benefit of UI designers etc. who want all flags to have consistent shape for their designs rather than as a reference for the definitive versions of flags.

Unfortunately they chose 3:4 for the rectangular variants, which isn't really used that much, 2:3 and 1:2 are more common for flags[1], so lots more flags have their designs rearranged, squished and stretched to fit the box than would otherwise need to be. For example flags with the UK's Union Jack in the canton seem to be noticeably mangled as the Union Jack seems far too large relatively. It's always going to be a compromise to have one shape, but just using 2:3 (the most common shape) would mean far fewer would need adjustments.

[1] https://en.wikipedia.org/wiki/List_of_aspect_ratios_of_natio...

Re:Country Flags in SVG by gspr on Friday February 04, 2022 @07:17AM (#30205828)
> The 1:1 variants seem to indicate that this collection is intended more for the benefit of UI designers etc. who want all flags to have consistent shape for their designs rather than as a reference for the definitive versions of flags.

So the UI people just make up fake flags then. Cool.

Re:Country Flags in SVG by bloak on Friday February 04, 2022 @06:56AM (#30205671)
And a fun thing about the UK flag is that you are allowed to make it in different aspect ratios, but you can't just naively scale it: https://en.wikipedia.org/wiki/Union_Jack#Specification

I don't know whether SVG can handle that, but you can get JavaScript to display it correctly in any aspect ratio, of course.

Re:Country Flags in SVG by chrismorgan on Friday February 04, 2022 @09:25AM (#30207079)
https://temp.chrismorgan.info/2022-02-05-union-jack.svg

It depends on calc(), vw and vh units, so it’ll work in browsers but not elsewhere.

(Certainly not all flags with similar specifications will be achievable; this one’s diagonals just happened to be all neatly anchored in the corners, though the red diagonal St Patrick’s cross is fiddly, requiring masking to achieve the required stroke alignment, for which see also https://svgwg.org/specs/strokes/#SpecifyingStrokeAlignment, which is an incomplete draft, and unimplemented.)