Hacker News new | past | comments | ask | show | jobs | submit login
Packing Equal Copies (erich-friedman.github.io)
34 points by skywalqer 9 months ago | hide | past | favorite | 2 comments



The "Squares in Squares" page [0] has a hilarious method for embedding long constants into the SVG files (which contain enough digits that they're clearly being provided more for the reader's sake than the browser's): as entity declarations in an internal DTD, to be referenced in the SVG attributes [1]!

I find it a beautiful usage of a feature that few know about (and even fewer would prefer to know about), but which works well in the browser regardless. I might steal the pattern for some of my own SVGs if no one's looking. (Well, not before testing its portability with non-browser SVG processors.)

[0] https://kingbird.myphotos.cc/packing/squares_in_squares.html

[1] e.g., view-source:https://kingbird.myphotos.cc/packing/square-_11.svg


They probably looked on stack overflow for: how can I include constants in svg files?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: