News for hackers. Stuff that matters.
Re:Building Code Posters with Elixir by pcorey on Monday February 13, 2017 @04:41PM (#13639040)
Thanks!

I definitely understand about how seriously you take privacy. For a personal project, I wouldn't think twice about sending it your way.

Source Code Pro is my usual default for a good looking monospace font, but Fira looks like a good choice. How do you go about finding monospace font's width to height ratios? I had do dive into SVG versions of Source Code Pro and doing some hands-on testing to come up with a ratio of 0.6.

Yeah, I'm not doing anything with a margin. In hindsight, I probably should have.

I actually manually picked the code I wanted to include in the poster. I imagine doing this in an automated way would be a much more difficult problem... Do you just ignore certain files based on filename patterns? e.g. /node_modules/, etc...

Yeah, there are a few places where I can parallalize the process. There's definitely a lot of room there for future work.

3 to 4 seconds is _very impressive_. Congrats!

I'd definitely push others to go with your solution, if it's a possibility. The elixir_poster project is really just a hacked together project to build a one-off (two-off, I guess) poster for myself.

Re:Building Code Posters with Elixir by ortuna on Monday February 13, 2017 @04:54PM (#13639135)
The PDF library I use gives you the dimensions of a certain letter (via FreeType I believe). I just plot 'X' (or any char for monospace) and get it's width, height.

You could support ignoring binary/generated code with a Linguist(https://github.com/github/linguist) wrapper(ruby).

Hope it didn't sound like criticism, just wanted to talk about it. Not everyone wants to talk about generating posters :)