Skip navigation
Currently Being Moderated

How to make a handwriting font look like real handwriting in InDesign CS5

Oct 12, 2010 3:46 PM

This is a script I've written (AppleScript) that addresses the  problem most handwriting fonts have — they look like fonts, mostly  because they're settled so regularly along the baseline and their glyphs  are so uniform.

 

It began as a way for me to address a  need for a project I was working on, something designed to look like a  scrapbook. I was using the "Journal" typeface designed by Fontourist  (http://www.dafont.com/journal.font), which gave me a good balance of  readability and organic feel, but of course it had the same issues as  all other fonts of its ilk.

 

To address that I wrote a  script to trawl the taxt frames in a specified CS5 INDD document,  looking fist to see if they had that font as their active one, after  which the script shifts each glyph up or down the baseline by a random  amount, gives each glyph a random stroke weight change, and finally  tints each glyph a random amount off of its basic tint.

 

Each  of these changes is very subtle, with the result being something that  looks considerably more organic and hand-made than the font did out of  the can. The script should be easily modified by anyone who wants to run  it using a different font instead of "Journal". Here it is. Enjoy!

 

--

 

-- This script changes the  baseline offset, stroke width, and color tint
-- of any type set in the "Journal" typeface to randomized values,  giving
-- the text a much more organic look and feel.

 

-- Written by Warren Ockrassa,  http://indigestible.nightwares.com/
-- Free to use, modify and distribute, but I'd prefer attribution.

 

-- Note that this script can take quite a while to execute with  larger
-- or more complex files.

 

set theItem to 0

 

set theItem to choose file with prompt "Select a CS5 InDesign  document to modify..."

 

if theItem is not equal to 0 then
    
     tell application "Adobe InDesign CS5"
        
         open theItem
        
         tell active document
            
             -- Determine how many text frames we need to change
            
             set myFrames to the number of text frames
            
             if myFrames is not equal to 0 then
                
                 set theFrame to 1
                
                 repeat until theFrame > myFrames
                    
                     set myText to text frame theFrame
                     set myFont to applied font of character 1 of myText  as string
                    
                     -- Check to make sure we're only modifying text  frames
                     -- that have been set in the "Journal" typeface
                    
                     if word 1 of myFont is "Journal" then
                        
                         repeat with thisCharacter in (characters of  myText)
                            
                             -- Randomize the values of baseline shift,  stroke, and tint
                            
                             set baselineShift to ((random number from -5  to 5) / 10)
                             set strokeWeight to (((random number 10)) /  100)
                             set myTint to (100 - (random number 10))
                             set fillColor to fill color of thisCharacter
                             set baseline shift of thisCharacter to  baselineShift
                             set stroke color of thisCharacter to  fillColor
                             set stroke weight of thisCharacter to  strokeWeight
                             set fill tint of thisCharacter to myTint
                             set stroke tint of thisCharacter to myTint
                            
                         end repeat
                        
                     end if
                    
                     set theFrame to (theFrame + 1)
                    
                 end repeat
                
             end if
            
         end tell
        
     end tell
    
     beep
     display dialog "Modifications finished!" buttons {"Groovy!"} default  button 1
    
else
    
     display dialog "Operation cancelled" buttons {"OK"} default button 1
    
end if

 
Replies
  • Currently Being Moderated
    Dec 17, 2010 3:00 PM   in reply to warnoh

    Hi, can you tell me how to make that script compatible with windows vbscript

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 19, 2012 5:38 PM   in reply to warnoh

    I need to do something similar to this - but need to vary the size and font.  I need to have a script assign random fonts to words (I'd have a set of three or four fonts I'd want the script to choose from).

     

    How to I revise this type script to make that happen?

     

    Thanks!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2012 7:00 AM   in reply to warnoh

    Thanks for the help here.  I was able to put together a solution for exactly what I needed with the help of some others here too, using Javascript, shown here in this discussion: http://forums.adobe.com/message/4220016#4220016

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)