Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Seurat-Alphamania
RGB Shifter-Alphamania
Director and online database interaction
FlashMaster
New bitmap from existing member
Copy and Paste inside editable fields
Library for work with formatted text documents
Get Least Common Denominator
Setup Anim
Find angles of a right triangle
 

 

 

Behavior Convert Fonts

Added on 6/27/2000

 

Compatibilities:
D7 D8 Mac PC Script Shockwave

Rating:

Author: MarkBoyd (website)

Converts fonts in text members. convertFonts("Geneva" , "Arial")

on convertFonts oldFont, newFont
  if voidP(oldFont) or voidP(newFont) then
    alert "Usage:  convertFonts(oldFont, newFont)"
    exit
  end if
  numLibs = the number of castLibs
  repeat with n = 1 to numLibs
    libName = castLib(n).name
    textList=""
    myCount=0
    x = the number of members of castLib n
    repeat with i = 1 to x
      myType = member(i,n).type
      if myType=#text then
        myFont = member(i,n).font
        if myFont = oldFont then
          member(i,n).font = newFont
          myCount = myCount + 1
        else
          -- text member not using oldFont
          -- store in a list to report to the user.
          mem = member(i,n).name
          mem = mem &&"(font =" &&myFont &")"
          textList = textList &mem &RETURN
        end if
      end if
    end repeat
    put RETURN &"Converted" &&myCount &&"text members in castLib" &"E &libName "E &"."
    put "Some text members that are NOT" &&oldFont &&"font are using" &RETURN &textList
  end repeat
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail