home *** CD-ROM | disk | FTP | other *** search
/ Blender Volume 2 #3 / Blender_2_3.iso / BLENDER / FILES / SHARED.DIR / 00837.ls < prev    next >
Encoding:
Text File  |  1996-04-01  |  3.4 KB  |  121 lines

  1. on printBitmap theCast
  2.   if the castType of cast theCast <> #bitmap then
  3.     alert("PrintBitmap can only print bitmapped castmembers.")
  4.     exit
  5.   end if
  6.   if the machineType = 256 then
  7.     set XObjFile to "pmatic.dll"
  8.   else
  9.     set XObjFile to "BLENDER3:FILES:pmatic.xobj"
  10.   end if
  11.   openXLib(XObjFile)
  12.   set printer to PrintOMatic(mnew)
  13.   if not objectp(printer) then
  14.     alert("There is no currently selected printer. Printing features are disabled.")
  15.   else
  16.     printer(mRegister, "PMAT130-925-01031")
  17.     set pw to printer(mGetPageWidth)
  18.     set ph to printer(mGetPageHeight)
  19.     set w to the width of cast theCast
  20.     set h to the height of cast theCast
  21.     set scaling to min(float(pw) / float(w), float(ph) / float(h))
  22.     if (scaling < 1.0) and (w > h) then
  23.       printer(mSetLandscapeMode, 1)
  24.       set pw to printer(mGetPageWidth)
  25.       set ph to printer(mGetPageHeight)
  26.       set scaling to min(float(pw) / float(w), float(ph) / float(h))
  27.     end if
  28.     set scaling to min(scaling, 1.0)
  29.     set w to integer(w * scaling)
  30.     set h to integer(h * scaling)
  31.     set left to (pw - w) / 2
  32.     set top to (ph - h) / 2
  33.     printer(mNewPage)
  34.     printer(mPicture, the picture of cast theCast, left, top, left + w, top + h)
  35.     if printer(mDoJobSetup) = 1 then
  36.       updateStage()
  37.       printer(mPrint)
  38.     end if
  39.     printer(mdispose)
  40.   end if
  41.   closeXLib(XObjFile)
  42. end
  43.  
  44. on min a, b
  45.   if a < b then
  46.     return a
  47.   else
  48.     return b
  49.   end if
  50. end
  51.  
  52. on PrintTexta textStringBig, textStringLittle
  53.   if the machineType = 256 then
  54.     set printingFont to "arial"
  55.     set XObjFile to "pmatic.dll"
  56.   else
  57.     set printingFont to "helvetica"
  58.     set XObjFile to "BLENDER3:FILES:pmatic.xobj"
  59.   end if
  60.   openXLib(XObjFile)
  61.   set printer to PrintOMatic(mnew)
  62.   if not objectp(printer) then
  63.     alert("There is no currently selected printer. Printing features are disabled.")
  64.   else
  65.     printer(mRegister, "PMAT130-925-01031")
  66.     printer(mSetMargins, 72, 72, 72, 72)
  67.     set w to printer(mGetPageWidth)
  68.     set h to printer(mGetPageHeight)
  69.     printer(mSetTextFont, printingFont)
  70.     printer(mSetTextSize, 10)
  71.     printer(mSetTextStyle, "normal")
  72.     printer(mNewPage)
  73.     printer(mTextBox, 0, 0, w, h, 0)
  74.     printer(mSetText, textStringBig, 1)
  75.     printer(mSetTextSize, 7)
  76.     printer(mAppendText, textStringLittle, 1)
  77.     if printer(mDoJobSetup) = 1 then
  78.       updateStage()
  79.       if the optionDown then
  80.         printer(mPrintPreview)
  81.       else
  82.         printer(mPrint)
  83.       end if
  84.     end if
  85.     printer(mdispose)
  86.   end if
  87.   closeXLib(XObjFile)
  88. end
  89.  
  90. on printText textString
  91.   if the machineType = 256 then
  92.     set printingFont to "arial"
  93.     set XObjFile to "pmatic.dll"
  94.   else
  95.     set printingFont to "helvetica"
  96.     set XObjFile to "BLENDER3:FILES:pmatic.xobj"
  97.   end if
  98.   openXLib(XObjFile)
  99.   set printer to PrintOMatic(mnew)
  100.   if not objectp(printer) then
  101.     alert("There is no currently selected printer. Printing features are disabled.")
  102.   else
  103.     printer(mRegister, "PMAT130-925-01031")
  104.     printer(mSetMargins, 72, 72, 72, 72)
  105.     set w to printer(mGetPageWidth)
  106.     set h to printer(mGetPageHeight)
  107.     printer(mSetTextFont, printingFont)
  108.     printer(mSetTextSize, 10)
  109.     printer(mSetTextStyle, "normal")
  110.     printer(mNewPage)
  111.     printer(mTextBox, 0, 0, w, h, 0)
  112.     printer(mSetText, textString, 1)
  113.     if printer(mDoJobSetup) = 1 then
  114.       updateStage()
  115.       printer(mPrint)
  116.     end if
  117.     printer(mdispose)
  118.   end if
  119.   closeXLib(XObjFile)
  120. end
  121.