1,003 karma · joined September 10, 2014
I had fun building this small project, there are a few fun things I did to make this work:
- The editor is a textarea with a monospace font, but the text is transparent, the font is rendered on top of it using SVG of the same size and line height as the monospace font behind it. This way I didn't have to recreate a whole editor and got the real-time preview I wanted.
- The way the SVG preview and the 'real font' are constructed is different. I talk about this a bit more on my blog [1] but in short in SVG I can use "thick lines" with rounded corners, and for the font I have to render polygons and I found a great library "mfogel/polygon-clipping" that makes the process of combining them a breeze.
Thank you all for the interest! I might work on an update or two ;)
And yes, more points and different aspect ratio would be nice, currently the `textarea` works by having a native textarea invisible on top of the SVG render, and tuning it to be in sync was a bit hard. So I think I can make custom grids and ratios happen but I'll have to disable the textarea for them, no big deal I guess :)
That's the thing, making something plug and play and mostly "driver-free" would be very hard to almost impossible. Framework laptops look amazing but they will require at least a bit more maintenance and knowledge, and that is fine too.
So sad to hear. No one shines a laser on an aircraft accidentally, and it is not like the police are using lasers as an excuse to systematically punish a minority. We don't need to wait for a tragedy to happen here.
https://github.com/javierbyte/pintr/blob/master/lib/svg.js#L...
* Update to add a link to the code that generates the SVG.
I tried to contact them from the email that used to be the 2FA, but no one could help me. It was a sad and eye-opening experience as I could have lost google domains and more.