Posts tagged 'hershey'

Thing-a-Day 2011 #25 - Scribbling in SVG (+Hershey font typing)

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

Added some scribbling to my little JavaScript app, which also gets saved to the SVG.

It's not great (my insistence on making these things map to the sticky note image means they don't line up right with the mouse), but it works!

Scribbs

As before, you can play with it here: http://schmarty.net/hershey_js_demo/

Thing-a-Day 2011 #24 - Hershey Fonts in JS, now sized for Unicorn Plotting!

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

I tweaked my little Hershey Fonts in JavaScript toy a bit. Now, the SVG data that it produces is at the right size and scale to plot on a sticky note on a MakerBot Unicorn.  Save the SVG content, load it in Inkscape, and save it as .gcode using my Inkscape extension for Unicorn.

At long last, after a bunch of little thing-a-days, I can write out a sticky-note:

Belaird

Save the SVG data and open it in Inkscape:

Belaird-inkscape

And save it as G-Code for plotting on the Unicorn!

Belaird-gcode

Matt Griffin was kind enough to plot it for me on one of the Thing-O-Matics at the BotCave:

Belairicorn

... sorry for the Bel-Air... :)

You can play with it here: http://schmarty.net/hershey_js_demo/

Thing-a-Day 2011 #23 - SVG Output for Hershey fonts in JavaScript

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

I really wanted to get SVG manipulation going in this demo, so I have ported the rendering (once again), this time using the jQuery SVG lib, which is really nice and easy to use: http://keith-wood.name/svg.html

Hershey-js-svg-output

You can play with it here: http://schmarty.net/hershey_js_demo/index.html

Thing-a-Day 2011 #22 - Hershey Fonts in JS - on a Sticky Note!

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

Ok, this is more a kind of clever image arrangement than anything else, but it looks nice, I think.

Writing_on_a_sticky_note

You can play with it here: http://schmarty.net/hershey_js_demo/index.html

Until I change it again!

Thing-a-Day 2011 #21 - Auto-scaling Hershey fonts in JavaScript

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

Ok, this is kind of fun, even though the code is very naive.

I've added a height-check at the end of my line-breaking code. If there are too many lines of text to fit within the allowed space, the algorithm will rescale everything and try again:

Auto_scale_hershey_js

This isn’t great for real-time text flow, but it is fine for fitting text, I think.

Thing-a-Day 2011 #20 - Hershey fonts in JavaScript on the canvas

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

I haven't been making as much progress on my "draw things in the browser so a robot can draw them on the Unicorn" project, so I decided to take a stab at cleaning things up a little to make that easier.

Today I rewrote my little demo to use canvas 2D instead of Raphael.js.  It looks the same, for the most part:

Hershey_js_canvas

But being in canvas land instead of Raphael land means I can do real stacked transforms easily, without having to keep track of them myself. For instance: ROTATION!

Canvas_rotated

Thing-a-Day 2011 #17 - Simple line-wrapping for Hershey JS demo

This post used to be on Posterous. I rescued my posts before Posterous shut down and am now sharing them here.

I've decided to slowly expand this drawing-stuff-in-the-browser demo, and added some simple line-wrapping to the code on my demo page:

http://schmarty.net/hershey_js_demo/

Word wrapping is an interesting topic, and I hope to get this cleaned up a bit with features like breaking up words if they are too long, improving the algorithm to make nicer "squared" paragraphs, etc.

Line_wrapping_hershey_js