home *** CD-ROM | disk | FTP | other *** search
/ Painter Bear's Language Bridge — Italian / Bridge_ponte_itialian.iso / pc / xtras / -pmatic.dir / docs_8.txt < prev    next >
Encoding:
Text File  |  1999-09-22  |  3.8 KB  |  110 lines

  1. Setting Text and Graphic Attributes
  2.  
  3. The following routines are used to set the default text and graphic attributes of a document. These attributes determine the color, font, etc. of subsequently added document elements:
  4.  
  5.     setTextFont            Sets the default text font for non-styled text data
  6.     setTextSize            Sets the default text size for non-styled text data
  7.     setTextStyle           Sets the default text style for non-styled text data
  8.     setTextJust            Sets the line justification of text elements
  9.     setTextLineSpacing     Sets the line spacing of text elements
  10.     setColor               Sets the default color of text and graphic elements
  11.     setGray                Sets the default gray value of text and graphic elements
  12.     setLineWeight          Sets the line weight of stroked graphic elements
  13.     
  14.  
  15. setTextFont
  16.  
  17. Syntax:    setTextFont document, fontName
  18.  
  19. Returns:   TRUE if the requested font was available
  20.           FALSE if the requested font could not be found
  21.  
  22. This command sets the text font that will be applied to non-styled text data (such as strings) that are subsequently appended to the PrintOMatic document. If the requested font is not available, the default font (Geneva on the Macintosh, Arial on Windows) is used.
  23.  
  24. Note that the current font set using setTextFont will be overridden by the fonts, sizes and styles within styled text field cast members that you subsequently append to your document. The default font used for non-styled text data after appending a styled text field will be the last font contained within the text field.
  25.  
  26.  
  27. setTextSize
  28.  
  29. Syntax:    setTextSize document, fontSize
  30.  
  31. This command sets the text size that will be applied to non-styled text data (such as strings) that are subsequently appended to the PrintOMatic document. 
  32.  
  33.  
  34. setTextStyle 
  35.  
  36. Syntax:    setTextStyle document, styleString
  37.  
  38. This command sets the text style that will be applied to non-styled text data (such as strings) that are subsequently appended to the PrintOMatic document. The names of the style values correspond exactly to the Director "textStyle" property. Possible values for text styles are:
  39.  
  40.     normal
  41.     plain
  42.     bold
  43.     italic
  44.     underline
  45.  
  46. On the Macintosh, the following additional styles are available:
  47.  
  48.     outline
  49.     condense
  50.     extend
  51.     shadow
  52.  
  53. All values except normal or plain are added together in a call to setTextStyle, so you can combine a number of styles together in a single call. 
  54.  
  55. Example:
  56.  
  57. The following example creates a PrintOMatic document, sets the default font to bold italicized 10 point Helvetica, and prints a short text string:
  58.  
  59.     set doc = new(xtra "PrintOMatic")
  60.     if not objectP(doc) then exit
  61.     setTextStyle doc, "bold, italic"
  62.     setTextFont doc, "Helvetica"
  63.     setTextSize doc, 10
  64.     append doc, "Some sample text to print out."
  65.     if doJobSetup(doc) then print doc
  66.     set doc = 0
  67.  
  68.  
  69. setTextJust
  70.  
  71. Syntax:    setTextJust document, justCode(s)
  72.  
  73. The setTextJust command sets the line justification applied to all subsequently added text elements. Possible values are:
  74.  
  75.     left
  76.     right
  77.     centered 
  78.  
  79. Justification applies to an entire text block (or the set of linked text blocks), so if you set justification to "right" and call append for a block that was previously centered, the justification of the entire block will be changed to right-justified as the new text is added.
  80.  
  81.  
  82. setTextLineSpacing
  83.  
  84. Syntax:    setTextLineSpacing document, spacing
  85.  
  86. Sets the line spacing of text elements
  87.  
  88.  
  89. setColor
  90.  
  91. Syntax:    setColor document, red, green, blue
  92.  
  93. Sets the default color of text and graphic elements
  94.  
  95.  
  96. setGray
  97.  
  98. Syntax:    setGray document, grayLevel
  99.  
  100. Sets the default gray value of text and graphic elements
  101.  
  102.  
  103. setLineWeight
  104.  
  105. Syntax:    setLineWeight document, lineWeight
  106.  
  107. Sets the line weight of stroked graphic elements
  108.  
  109.  
  110.