Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

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

$
0
0

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


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>