Tuesday, January 21 2014

Generating hanko in Adobe Illustrator

A somewhat-belated follow-up to my earlier hanko braindump, here are two bits of ExtendScript (Javascript) for generating decent-looking square seals (kakuin) in Illustrator and then resizing them to see how they’d look at different sizes when sent off to an online dealer who has a laser engraver, CNC mill, or photopolymer (e.g. Brother) system.

sample square seal

The first, make-seal.jsx, takes a string of kanji/kana and formats it into a traditional-looking square or rectangular seal, with options for changing the font, spacing, etc. You need to have some sort of kanji fonts on your system, of course; the script goes looking for anything by DynaCom or Hakushu, and if all else fails, will let you use Meiryo and MS Mincho/Gothic. Overriding the font menu is on my to-do list, along with creating double borders and some other features used in real hand-carved seals.

The second script, seal-sizing.jsx, takes whatever artwork you have selected and creates a new document scaling it to various common seal sizes (by default, the ones offered by Inkan Honpo, who accepts Illustrator files directly; most dealers want black-and-white GIF/JPG). Useful for printing out and seeing how good your design really looks at different sizes, which is important for the seals I’m designing for some local martial-arts instructors.

For extra credit, here’s what I’m using to lightly distress the resulting seals, adjusting the outlines to look a bit less computer-generated. I’d save this as an Illustrator action, except that actions aren’t capable of recording everything any more, sigh.

  1. Select/Object/Text Objects
  2. Type/Create Outlines
  3. Effect/Distort & Transform/Roughen…
    0.15%, 67/in, Smooth
  4. Object/Expand Appearance
  5. Object/Path/Simplify…
    96%
  6. Select/Inverse
  7. Effect/Distort & Transform/Roughen…
    0.2%, 83/in, Smooth
  8. Object/Expand Appearance
  9. Object/Path/Simplify…
    93%

(I could rant about how Illustrator CC for Windows forces the pixelAligned property for all RGB documents created in ExtendScript, or how ScriptUI windows are mis-sized on HiDPI displays, but I’ll save those for bug reports)

I have some notes on making round seals, but automating those in a way that looks half-decent is actual work.

[Update: because it amused me…]

絶対領域制服清福