home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / FontConversion.tops < prev    next >
Text File  |  1995-03-30  |  5KB  |  128 lines

  1.  
  2. replace "NX_IDENTITYMATRIX" with "NSFontIdentityMatrix"
  3.  
  4. replace "NX_FLIPPEDMATRIX" with "NSFontFlippedMatrix"
  5.  
  6.  
  7. /*********** FontConversion: newFont:size:... ***********/
  8.  
  9. replace "[<rec> newFont:<font> size:<size> style:<style> matrix:<matrix>]" with  "[<rec> fontWithName:<font> size:<size>]"
  10.     where "<matrix>" isOneOf {
  11.     "NSFontIdentityMatrix",
  12.     "NSFontFlippedMatrix"
  13.     }
  14.  
  15. replace "[<rec> newFont:<font> size:<size> style:<style> matrix:<matrix>]" with "[<rec> fontWithName:<font> matrix:<matrix>]"
  16.     warning "FontConversion: 'fontWithName:matrix:' used to be 'newFont:size:style:matrix:'.  In NSFont, size or matrix may be specified, but not both. Size was: <size>. Either factor the size into the matrix or, if the matrix is a unit matrix, use 'fontWithName:size:'"
  17.  
  18. replace "[<rec> newFont:<font> size:<size> matrix:<matrix>]" with  "[<rec> fontWithName:<font> size:<size>]"
  19.     where "<matrix>" isOneOf {
  20.     "NSFontIdentityMatrix",
  21.     "NSFontFlippedMatrix"
  22.     }
  23.  
  24. replace "[<rec> newFont:<font> size:<size> matrix:<matrix>]" with "[<rec> fontWithName:<font> matrix:<matrix>]"
  25.     warning "FontConversion: 'fontWithName:matrix:' used to be 'newFont:size:matrix:'; in NSFont, size or matrix may be specified, but not both. Size was: <size>. Either factor the size into the matrix or, if the matrix is an identity matrix, use 'fontWithName:size:'. Note: NSFonts correctly orient themselves in accordance with the focused view, so flipped matrices are not required."
  26.  
  27. replacemethod "newFont:size:" with "fontWithName:size:" 
  28.  
  29. /*********** FontConversion: userFont..., systemFont ***********/
  30.  
  31. replace "[<rec> userFontOfSize:<size> matrix:<matrix>]" with "[<rec> userFontOfSize:<size>]"
  32. where "<matrix>" isOneOf {
  33.     "NSFontIdentityMatrix",
  34.     "NSFontFlippedMatrix"
  35. }
  36.  
  37. replace "[<rec> userFixedPitchFontOfSize:<size> matrix:<matrix>]" with "[<rec> userFixedPitchFontOfSize:<size>]"
  38. where "<matrix>" isOneOf {
  39.     "NSFontIdentityMatrix",
  40.     "NSFontFlippedMatrix"
  41. }
  42.  
  43. replace "[<rec> systemFontOfSize:<size> matrix:<matrix>]" with "[<rec> systemFontOfSize:<size>]"
  44. where "<matrix>" isOneOf {
  45.     "NSFontIdentityMatrix",
  46.     "NSFontFlippedMatrix"
  47. }
  48.  
  49. replace "[<rec> boldSystemFontOfSize:<size> matrix:<matrix>]" with "[<rec> boldSystemFontOfSize:<size>]"
  50. where "<matrix>" isOneOf {
  51.     "NSFontIdentityMatrix",
  52.     "NSFontFlippedMatrix"
  53. }
  54.  
  55. replace "[<rec> <sel>:<size> matrix:<matrix>]" with "[<rec> <sel>:<size>]"
  56.     warning "FontConversion: <sel>: used to be <sel>:matrix:; in NSFont, a matrix cannot be specified for this method.  If a non-unit matrix is required, use 'fontName' to extract the name, and then create that font with '+fontWithName:matrix:'; note: NSFonts correctly orient themselves in accordance with the focused view, so flipped matrices are not required"
  57.     where "<sel>" isOneOf {
  58.     "userFontOfSize",
  59.     "userFixedPitchFontOfSize"
  60.     "systemFontOfSize",
  61.     "boldSystemFontOfSize"
  62.     }
  63.  
  64. /*********** FontConversion: name changes ***********/
  65.  
  66. replacemethod "getWidthOf:" with "widthOfString:"
  67.  
  68. /*********** FontConversion: obsolete methods ***********/
  69.  
  70. replacemethod "fontNum" with same
  71.     error "FontConversion: 'fontNum' is obsolete"
  72.  
  73. replacemethod "metrics" with same
  74.     error "FontConversion: 'metrics' is obsolete; this information is now accessed by method"
  75.      
  76. replacemethod "hasMatrix" with same
  77.     error "FontConversion: 'hasMatrix' is obsolete"
  78.  
  79. /**** FontConversion: FontManager - getFamily:traits:weight:size:ofFont: *****/
  80.  
  81. replace ";<w w>;" with "CONVERSION_SEMI_COLON <w w>CONVERSION_SEMI_COLON"
  82.  
  83. replace "[<rec> getFamily:<family> traits:<traits> weight:<weight> size:<size> ofFont:<font>];" with "{
  84.     *<family> = [<font> familyName];
  85.     *<traits> = [<rec> traitsOfFont:<font>];
  86.     *<weight> = [<rec> weightOfFont:<font>];
  87.     *<size> = [<font> pointSize];
  88.     }"
  89.  
  90. replace "*&" with ""
  91.  
  92. replace "*NULL = [<rec> familyName];" with  ";"
  93.  
  94. replace "; *NULL = [<rec> traitsOfFont:<font>];" with  ";"
  95.  
  96. replace "; *NULL = [<rec> weightOfFont:<font>];" with  ";"
  97.  
  98. replace "; *NULL = [<rec> pointSize];" with  ";"
  99.  
  100. replace ";<w w>;" with ";<w w>"
  101.  
  102. replace "CONVERSION_SEMI_COLON" with ";"
  103.  
  104. /*********** FontConversion: FontManager name changes ***********/
  105.  
  106. replacemethod "<old>" with "<new>" 
  107.     where ("<old>", "<new>") isOneOf {
  108.     ("convert:toSize:", "convertFont:toSize:"), 
  109.     ("convert:toFace:", "convertFont:toFace:"), 
  110.     ("convert:toFamily:", "convertFont:toFamily:"), 
  111.     ("convert:toHaveTrait:", "convertFont:toHaveTrait:"), 
  112.     ("convert:toNotHaveTrait:", "convertFont:toNotHaveTrait:"), 
  113.     ("convertWeight:of:", "convertWeight:ofFont:"),
  114.     ("selFont", "selectedFont"),
  115.     ("getFontMenu:", "fontMenu:"),
  116.     ("getFontPanel:", "fontPanel:"),
  117.     ("selSelFont:isMultiple:", "setSelectedFont:isMultiple:"),
  118.     ("findFont:traits:weight:size:", "fontWithFamily:traits:weight:size:")
  119.     } 
  120.  
  121. /*********** FontConversion: availableFonts ***********/
  122.  
  123. replacemethod "availableFonts" with same {
  124.     replace "<rettype>" with "(NSArray *)"
  125.     }
  126.     error "FontConversion: 'availableFonts' now returns an NSArray of NSString (used to return 'char **')."
  127.     
  128.