home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / fractal / progs / booker / Library / CreateDraw < prev    next >
Encoding:
Text File  |  1991-11-03  |  28.8 KB  |  10 lines

  1.  
  2. Æ;ô  ><BasicV$Lib>.CreateDraw   Create Draw files.  v0.07
  3. Ðô
  4. ÚHô  Routines to help create a Draw file that resides totally inside a
  5. äIô  heap block.  Can print text as path objects, handles text objects,
  6. îDô  handles sprite objects, handles group objects, handles tagged
  7. øGô  objects, font table objects.  Does NOT handle text area objects.
  8. ô
  9.  ô  MACHINE:  Archimedes
  10. #ô  LANGUAGE: BBC BASIC V, v1.04
  11.  ô  AUTHOR:   Cy Booker,
  12. *Gô            86 Church View, Main Road, Crockenhill, Swanley, Kent.
  13. 4ô            BR8 8JW
  14. >ô  FUNCTIONS:
  15. Hô   Char_Width( C% )
  16. R%ô   Char_Draw_Width( C%, width% )
  17. \ ô   Draw_Font_Name( Style% )
  18. f ô   Draw_Font_Style( name$ )
  19. pô  :
  20. z!ô   Inches_To_Draw_Units( i )
  21. ☓ô  :
  22. ‰&ô   Claim_Draw_Sub_Buffer( need% )
  23. —ô  :
  24. ¢ô  PROCEDURES:
  25. ¬(ô   Open_DrawFile( min_mem%, name$ )
  26. ¶+ô   Close_DrawFile( file_name$, keep% )
  27. À?ô   Open_Draw_Path_Object( fill%, colour%, width%, flags% )
  28. Ê/ô    Bezier( x0%, y0%, x1%, y1%, x2%, y2% )
  29. Ôô    Draw( x%, y% )
  30. Þô    Move( x%, y% )
  31. è#ô    Line( x0%, y0%, x1%, y1% )
  32. òô    Close_Path()
  33. üô    Close_SubPath()
  34. ô   Close_Draw_Path_Object
  35. #ô   Open_Draw_Font_Table_Object
  36. *ô    Draw_Font_Table( number%, font$ )
  37. $%ô    Draw_Font_Table_Add( font$ )
  38. .$ô   Close_Draw_Font_Table_Object
  39. 87ô   Open_Draw_Text_Object( X%, Y%, W%, H%, Style% )
  40. B"ô    Draw_Text_Object( text$ )
  41. L ô   Close_Draw_Text_Object()
  42. VFô   Draw_Sprite_Object( name$, base%, xmin%, ymin%, xmax%, ymax% )
  43. `(ô   Open_Draw_Group_Object( group$ )
  44. j!ô   Close_Draw_Group_Object()
  45. t.ô   Open_Draw_Tagged_Object( identifier% )
  46. ~.ô    Draw_Tagged_Object( start%, length% )
  47. ⇦)ô    Draw_Tagged_Object_Byte( byte% )
  48. ‹)ô    Draw_Tagged_Object_Word( word% )
  49. †)ô    Draw_Tagged_Object_Text( text$ )
  50. ¦"ô   Close_Draw_Tagged_Object()
  51. °'ô   Open_Draw_Font( font$, cache% )
  52. º-ô    Draw_Character( C%, X%, Y%, W%, H% )
  53. Ä ô   Close_Draw_Font( font$ )
  54. Îô  :
  55. ØFô   Draw_Check( n_bytes% )            Ensure bytes free in buffer.
  56. â1ô   Draw_Path_Bounding_Box( h%, fill_style% )
  57. ìô  :
  58. öGô   Draw_Rotate_Path( in%, out%, xo%, yo%, radians )  ---> Untested
  59. =ô   Draw_Translate_Path( in%, out%, dx%, dy% )          /
  60. 
  61. <ô   Init_Draw_Out_Path( size% )                        /
  62. ;ô   Draw_Scale_Path( in%, out%, dx, dy )              /
  63. ô  :
  64. (!ô   Release_Draw_Sub_Buffer()
  65. 2:
  66. <ô  EXTERNALS:
  67. Fô   Wimp heap.
  68. Pô  :
  69. Zô  UPDATES:
  70. d.ô   14.04.1991 CJB Wrote (from crossword).
  71. nGô   30.04.1991 CJB Sub-buffers written, transformations documented.
  72. x1ô   02.05.1991 CJB Characters now functional.
  73. ŵ,ô   03.05.1991 CJB Close font now works!
  74. …Jô   18.05.1991 CJB When open file, sets ..Cache$, so error handled OK.
  75. „@ô   23.05.1991 CJB Close_Path_Object() badly set Draw_xmax%.
  76.  Kô   25.10.1991 CJB Draw_Font_Style() added, error message in .._Name().
  77. ªIô   03.11.1991 CJB So proper error if attempt text before font table.
  78. ´:
  79. ¾$Ý ¤_CreateDraw_version  :  = 007
  80. È:
  81. Ò"Ý ¤_hard_initialise_CreateDraw
  82. Üê Ŷ
  83. æCî Ŷ ê ÷ Ŷ  :  ò_e( "%.CreateDraw: hard_initialise_CreateDraw" )
  84. ð0  ò_load_library( "<BasicV$Lib>.Heap", 011 )
  85. ú3  ò_load_library( "<BasicV$Lib>.IntMath", 004 )
  86. 0  ò_load_library( "<BasicV$Lib>.Wimp", 015 )
  87. ,  ò_Claim_Heap_Block( TransMatrix%, 24 )
  88. = 0
  89. ":
  90. ,Kô *********************************************************************
  91. 6Lô * Start creating a draw file inside a Heap block.  This gets extend as
  92. @<ô * and when.  If an error is generated, you should call
  93. JKô * PROC_Handle_DrawFile_Error, before processing the errors as normal.
  94. TJô * The following "globals" will be used - to save passing six million
  95. ^!ô * parameters to everything:
  96. h:
  97. rGê Draw_Buffer%, D%, E%, Draw_Group%, Draw_Group_Buffer%, Draw_xmin%
  98. |Jê Draw_Group_Max%, Draw_Group%, Draw_Object%, O%, M%, Draw_Font_Cache%
  99. ŷHê Draw_Font_Cache_X%, Draw_Font_Cache_Y%, Draw_Font_Cache_W%, O%, M%
  100. ‘Jê Draw_Font_Cache_H%, Draw_Design_Size%, Draw_ymax%, Draw_Font_Colour%
  101. Œ?ê Draw_ymin%, Draw_xmax%, Draw_Font_Fill%, Draw_Font_Width%
  102. ¤=ê Draw_Chars_Defined%, Draw_Font_Table%, Draw_Font_Cache$
  103. ®;ê Draw_Text_Colour%, Draw_Text_Hint%, Draw_Text_Object%
  104. ¸ê Draw_Font_Table_Style%
  105. Â:
  106. Ì9: ô  Draw_Buffer%         == Draw file memory buffer.
  107. ÖE: ô  D%                   == Rove inside draw file memory buffer.
  108. à@: ô  E%                   == End of draw file memory buffer.
  109. êI: ô  Draw_xmin%           == Local to groups, but extend to "globals"
  110. ôL: ô  Draw_ymin%           ==  for calculation of groups and, indeed, the
  111. þG: ô  Draw_xmax%           ==  the whole file.  min's are inclusive,
  112. J: ô  Draw_ymax%           ==  max's are exclusive draw internal units.
  113. F: ô  Draw_Group_Buffer%[] == Start of group header in draw buffer.
  114. 8: ô  Draw_Group%          == Index into it [0, max).
  115. &7: ô  Draw_Group_Max%      == Maximum group nesting.
  116. G: ô  Draw_Object%         == Start of object header in draw buffer.
  117. :I: ô  Draw_Font_Cache%[]   == Used when caching fonts (6Kbytes total).
  118. DK: ô  Draw_Font_Cache_D%[] == Offset in draw file of previously rendered
  119. NL: ô  Draw_Font_Cache_X%[] == character.  This points to the header.  The
  120. XK: ô  Draw_Font_Cache_Y%[] == other arrays detail the original rendering
  121. bK: ô  Draw_Font_Cache_W%[] == parameters.  Thus could lose resolution if
  122. lF: ô  Draw_Font_Cache_H%[] == first one is very small.  Not likely.
  123. v?: ô  Draw_Font_Cache$     == Name of font currently "open".
  124. €B: ô  O%                   == File handle of outline font file.
  125. ⇩B: ô  M%                   == File handle of metrics font file.
  126. “4: ô  Draw_Design_Size%    == Set when open font.
  127. fi4: ô  Draw_Chars_Defined%  == Set when open font.
  128. ¨F: ô  Draw_Font_Colour%    == Must be explicitly set before calling
  129. ²C: ô  Draw_Font_Fill%      ==  PROC_Draw_Character.  Colours are
  130. ¼G: ô  Draw_Font_Width%     ==  standard, as is the width definition.
  131. ÆC: ô  Draw_Font_Table%     == Used internally to ensure created.
  132. ÐE: ô  Draw_Font_Table_Style%= Used internally while making object.
  133. Ú9: ô  Draw_Text_Colour%    == Text object font colour.
  134. äD: ô  Draw_Text_Hint%      == Text object background hint colour.
  135. îA: ô  Draw_Text_Object%    == Offset into draw file of header.
  136. øE: ô  Draw_Sub_Buffer%     == Offset into draw file of sub-buffer.
  137.  : ô  /.
  138.  :
  139. (Ý ò_Open_DrawFile( min_mem%, name$ )
  140.  ê Ŷ
  141. *6î Ŷ ê ÷ Ŷ  :  ò_e( "%.CreateDraw: Open_DrawFile" )
  142. 4  Draw_Buffer%       = 0
  143. >  Draw_Group_Buffer% = 0
  144. H  Draw_Group%        = 0
  145. R  Draw_Group_Max%    = 12
  146. \  Draw_Font_Cache%   = 0
  147. f  Draw_Font_Cache$   = ""
  148. p  Draw_Font_Table%   = 0
  149. z  O%                 = 0
  150. ☓  M%                 = 0
  151. ‰6  min_mem%           = ¤_max_int( min_mem%, 1024 )
  152. —I  ò_Claim_Heap_Block( Draw_Group_Buffer%, (Draw_Group_Max% * 5 * 4) )
  153. ¢2  ò_Claim_Heap_Block( Draw_Buffer%, min_mem% )
  154. ¬  D% = Draw_Buffer%
  155. ¶"  E% = Draw_Buffer% + min_mem%
  156. À  :
  157. Ê  $D%      = "Draw"
  158. Ô  D%!4     = 201
  159. Þ  D%!8     = 0
  160. è(  $(D%+12) = Àname$+ Ä12, " "), 12 )
  161. ò  D%       += 40
  162. ü  :
  163.   Draw_xmin% = &7FFFFFFF
  164.   Draw_ymin% = &7FFFFFFF
  165.   Draw_xmax% = &80000000
  166. $  Draw_ymax% = &80000000
  167. .á
  168. 8:
  169. BKô *********************************************************************
  170. LKô * IN   file_name$ == Full name to save as (time-stamped/typed), or ""
  171. VFô *      keep% == Boolean, TRUE if keep drawfile in heap block, at
  172. `*ô *               Draw_Buffer% ... D%.
  173. j2ô * OUT  File may be created (error-generated)
  174. tKô *      All ancillary heap blocks released, and draw file if not keep.
  175. ~:
  176. ⇦+Ý ò_Close_DrawFile( file_name$, keep% )
  177. ‹  ç Draw_Group%<>0 …
  178. †+    Ŷ 1, "Group's not closed properly."
  179. ¦  Í
  180. °D  Draw_Buffer%!24 = Draw_xmin%                  :  ô  Bound low.
  181. º"  Draw_Buffer%!28 = Draw_ymin%
  182. ÄE  Draw_Buffer%!32 = Draw_xmax%                  :  ô  Bound high.
  183. Î"  Draw_Buffer%!36 = Draw_ymax%
  184. Ø  ç file_name$<>"" …
  185. â=    È− "OS_File", 10, file_name$, &AFF,, Draw_Buffer%, D%
  186. ì  Í
  187. ö0  ò_Release_Heap_Block( Draw_Group_Buffer% )
  188.   ò_Close_Draw_Font( "" )
  189. 
  190.   ç keep% …
  191.     D% -= Draw_Buffer%
  192.     E% -= Draw_Buffer%
  193. (6    ò_Extend_Heap_Block( Draw_Buffer%, (D% - E%) )
  194. 2    D% += Draw_Buffer%
  195. <    E% = D%
  196. F  Ì
  197. P,    ò_Release_Heap_Block( Draw_Buffer% )
  198. Z  Í
  199. dá
  200. n:
  201. xÝ ò_Handle_DrawFile_Error
  202. ŵ  ò_Close_DrawFile( "", £ )
  203. …á
  204. „:
  205.  Kô *********************************************************************
  206. ª8ô * fill%/colour% == &BBGGRR00 or -1.  Usually -1/0.
  207. ´Kô * width% == 0 for thinnest, else output dependent pixels.  Usually 0.
  208. ¾Jô * flags% == Bit significant, defininig join style/caps/winding rule/
  209. ÈIô *           dash included/triangle caps.  Usually just 1 << 6 = 64.
  210. Ò:
  211. Ü?Ý ò_Open_Draw_Path_Object( fill%, colour%, width%, flags% )
  212. æ  ò_Draw_Check( 40 )
  213. ð&  Draw_Object% = D% - Draw_Buffer%
  214. ú  D%!0 = 2
  215.   D%!24 = fill%
  216.   D%!28 = colour%
  217.   D%!32 = width%
  218. "  D%!36 = flags%
  219. ,  ç (flags% € &80)<>0 …
  220. 6E    Ŷ 1, "Bad Open Draw Path Object - dashes not supported, yet."
  221. @  Í
  222. J  D% += 40
  223. Tá
  224. ^:
  225. hÝ ò_Close_Draw_Path_Object
  226. rê o%
  227. |T  o%=D%!-4:ç (o%<>0) € (o%<>5) … Ŷ 1, "Close Draw Path object: path not closed."
  228. ŷ&  o% = Draw_Buffer% + Draw_Object%
  229. ‘  o%!4 = D% - o%
  230. ŒJ  È− "Draw_ProcessPath", o%+40, &7000003A, 0, 0, 0, 0, 0, o%+&80000008
  231. ¤0  Draw_xmin% = ¤_min_int( Draw_xmin%, o%!8 )
  232. ®1  Draw_ymin% = ¤_min_int( Draw_ymin%, o%!12 )
  233. ¸1  Draw_xmax% = ¤_max_int( Draw_xmax%, o%!16 )
  234. Â1  Draw_ymax% = ¤_max_int( Draw_ymax%, o%!20 )
  235. Ìá
  236. Ö:
  237. à"Ý ò_Line( x0%, y0%, x1%, y1% )
  238. ê  ò_Move( x0%, y0% )
  239. ô  ò_Draw( x1%, y1% )
  240. þá
  241.  :
  242.  Ý ò_Move( x%, y% )
  243.    ò_Draw_Check( 12 )
  244.  &
  245.   !D% = 2
  246.  0  D%!4 = x%
  247.  :  D%!8 = y%
  248.  D  D% += 12
  249.  Ná
  250.  X:
  251.  bÝ ò_Draw( x%, y% )
  252.  l  ò_Draw_Check( 12 )
  253.  v
  254.   !D% = 8
  255.  €  D%!4 = x%
  256.  ⇩  D%!8 = y%
  257.  “  D% += 12
  258.  fiá
  259.  ¨:
  260.  ².Ý ò_Bezier( x0%, y0%, x1%, y1%, x2%, y2% )
  261.  ¼  ò_Draw_Check( 28 )
  262.  Æ
  263.   !D% = 6
  264.  Ð  D%!4 = x0%
  265.  Ú  D%!8 = y0%
  266.  ä  D%!12 = x1%
  267.  î  D%!16 = y1%
  268.  ø  D%!20 = x2%
  269. !  D%!24 = y2%
  270. !   D% += 28
  271. !á
  272. ! :
  273. !*Ý ò_Close_Path
  274. !4  ò_Draw_Check( 4 )
  275. !>
  276.   !D% = 0
  277. !H
  278.   D% += 4
  279. !Rá
  280. !\:
  281. !fÝ ò_Close_SubPath
  282. !p  ò_Draw_Check( 4 )
  283. !z
  284.   !D% = 5
  285. !☓
  286.   D% += 4
  287. !‰á
  288. !—:
  289. !¢Kô *********************************************************************
  290. !¬Jô * Font table object.  Only used to map font numbers to actual fonts.
  291. !¶:
  292. !À#Ý ò_Open_Draw_Font_Table_Object
  293. !Ê  ò_Draw_Check( 8 )
  294. !Ô*  Draw_Font_Table% = D% - Draw_Buffer%
  295. !Þ   Draw_Font_Table_Style% = 1
  296.   !D% = 0
  297.   D% += 8
  298. !üá
  299. ":
  300. ")Ý ò_Draw_Font_Table( number%, font$ )
  301. "ê l%
  302. "$!  ç number%<1 ☓ number%>255 …
  303. ".?    Ŷ 1, "Bad font table index, while adding to font table"
  304. "8  Í
  305. "B  l% = ©(font$) + 2
  306. "L  ò_Draw_Check( l%+1 )
  307. "V  ?D% = number%
  308. "`  $(D%+1) = font$+ ½(0)
  309. "j  D% += l%
  310. "tá
  311. "~:
  312. "⇦-: ô  Only adds it if not already in there
  313. "‹:
  314. "†$Ý ò_Draw_Font_Table_Add( font$ )
  315. "¦ê l%, F%, found%
  316. "°.  F% = Draw_Buffer% + Draw_Font_Table% + 8
  317. "º  found% = £
  318. "Ä  È” F%<D% € ¬(found%)
  319. "Î%    found% = ¤getname(F%+1)=font$
  320. "Ø    ç ¬(found%) …
  321. "â      F%+=1
  322. "ì      È” ?F%:F%+=1:Î
  323. "ö        Í
  324. #  Î
  325. #
  326.   ç ¬(found%) …
  327. #'    ç Draw_Font_Table_Style%>=256 …
  328. #.      Ŷ 1, "Too many fonts for font table"
  329. #(        Í
  330. #2    l% = ©(font$) + 2
  331. #<    ò_Draw_Check( l%+1 )
  332. #F$    ?D% = Draw_Font_Table_Style%
  333. #P#    Draw_Font_Table_Style% += 1
  334. #Z    $(D%+1) = font$+ ½(0)
  335. #d    D% += l%
  336. #n  Í
  337. #xá
  338. #ŵ:
  339. #…$Ý ò_Close_Draw_Font_Table_Object
  340. #„ê F%
  341. #  ò_Draw_Check( 4 )
  342. #ª  È” (D% € 3)<>0
  343. #´    ?D% = 0
  344. #¾    D% += 1
  345. #È  Î
  346. #Ò*  F% = Draw_Buffer% + Draw_Font_Table%
  347. #Ü  F%!4 = D% - F%
  348. #æá
  349. #ð:
  350. #ú Ý ¤_Draw_Font_Name( Style% )
  351. $ê F%, n$, G%, found%
  352. $      ê Ŷ
  353. $5  î Ŷ ê ÷ Ŷ : ò_e("%.CreateDraw: Draw_Font_Name")
  354. $"      ê Ŷ
  355. $,M  î Ŷ ê ÷ Ŷ : Ŷ 1, "Can't create text object before a font table object."
  356. $6$  ç Draw_Font_Table%=0 … Ŷ 1, ""
  357. $@      ÷ Ŷ
  358. $J*  F% = Draw_Buffer% + Draw_Font_Table%
  359. $T  G% = F% + (F%!4)
  360. $^
  361.   F% += 8
  362. $h  found% = £
  363. $r  È” F%<G% € ¬(found%)
  364. $|    ç (?F%)=Style% …
  365. $ŷ      n$ = ¤getname( F%+1 )
  366. $‘      found% = ¹
  367. $Œ        Ì
  368. $¤      F%+=1
  369. $®      È” ?F%<>0:F%+=1:Î
  370. $¸      F%+=1
  371. $        Í
  372. $Ì  Î
  373. $ÖY  ç ¬(found%) … Ŷ 1, "Can't find a font style of #"+ Ã(Style%)+ " in the font table."
  374. $à= n$
  375. $ê:
  376. $ô Ý ¤_Draw_Font_Style( name$ )
  377. $þê F%, G%, found%
  378. %      ê Ŷ
  379. %6  î Ŷ ê ÷ Ŷ : ò_e("%.CreateDraw: Draw_Font_Style")
  380. %      ê Ŷ
  381. %&M  î Ŷ ê ÷ Ŷ : Ŷ 1, "Can't create text object before a font table object."
  382. %0$  ç Draw_Font_Table%=0 … Ŷ 1, ""
  383. %:      ÷ Ŷ
  384. %D*  F% = Draw_Buffer% + Draw_Font_Table%
  385. %N  G% = F% + (F%!4)
  386. %X
  387.   F% += 8
  388. %b  found% = £
  389. %l  È” F%<G% € ¬(found%)
  390. %v%    found% = ¤getname(F%+1)=name$
  391. %€    ç ¬ found% …
  392. %⇩      F%+=1
  393. %“      È” ?F%:F%+=1:Î
  394. %fi      F%+=1
  395. %¨        Í
  396. %²  Î
  397. %¼K  ç ¬(found%) … Ŷ 1, "Can't find font `"+ name$+ "' in the font table."
  398. %Æ    = ?F%
  399. %Ð:
  400. %ÚKô *********************************************************************
  401. %ä/ô * Uses Draw_Text_Colour%, Draw_Text_Hint%
  402. %îLô * Place text$ in font Style% at base line X%, Y%.  Font starts of with
  403. %ø+ô * a size of W% by H% 1/640'ths point.
  404. &:
  405. & 7Ý ò_Open_Draw_Text_Object( X%, Y%, W%, H%, Style% )
  406. &  ò_Draw_Check( 53 )
  407. & +  Draw_Text_Object% = D% - Draw_Buffer%
  408. &*
  409.   !D% = 1
  410. &4  D%!24 = Draw_Text_Colour%
  411. &>  D%!28 = Draw_Text_Hint%
  412. &H  D%!32 = Style%
  413. &R  D%!36 = W%
  414. &\  D%!40 = H%
  415. &f  D%!44 = X%
  416. &p  D%!48 = Y%
  417. &z  D% += 52
  418. &☓á
  419. &‰:
  420. &—G: ô  Gets concatonated onto end of current text.  Thus getting over
  421. &¢$: ô  BASIC 256 charactert limit.
  422. &¬:
  423. &¶!Ý ò_Draw_Text_Object( text$ )
  424. &À"  ò_Draw_Check( ©(text$) + 1 )
  425. &Ê  $D% = text$
  426. &Ô  D% += ©(text$)
  427. &Þá
  428. &è:
  429. &òÝ ò_Close_Draw_Text_Object
  430. &ü ê T%, h%
  431. '  õ
  432. '    ?D% = 0
  433. '    D% += 1
  434. '$  ý (D% € 3)=0
  435. '.+  T% = Draw_Buffer% + Draw_Text_Object%
  436. '8  T%!4 = D% - T%
  437. 'BQ  È− "Font_FindFont",, ¤_Draw_Font_Name( T%!32 ), (T%!36)*40, (T%!40)*40 ¸ h%
  438. 'LI  È− "Font_StringBBox", h%, text$+ ½(0) ¸ , T%!8, T%!12, T%!16, T%!20
  439. 'V0  Draw_xmin% = ¤_min_int( Draw_xmin%, T%!8 )
  440. '`1  Draw_ymin% = ¤_min_int( Draw_ymin%, T%!12 )
  441. 'j1  Draw_xmax% = ¤_max_int( Draw_xmax%, T%!16 )
  442. 't1  Draw_ymax% = ¤_max_int( Draw_ymax%, T%!20 )
  443. '~á
  444. '⇦:
  445. '‹Kô *********************************************************************
  446. '†1ô * Define a sprite, inside the bounding box.
  447. '¦Hô * base% = +1 for Wimp, 0 for system, else pointer to sprites base.
  448. '°1ô * A side affect, this sprite is "selected".
  449. 'º:
  450. 'ÄFÝ ò_Draw_Sprite_Object( name$, base%, xmin%, ymin%, xmax%, ymax% )
  451. ê sp%, i%
  452. 'Ø  È‰ base% Ê
  453. 'â2  É 0 : È− "OS_SpriteOp", &18,, name$ ¸ ,, sp%
  454. 'ì5  É +1 : È− "Wimp_SpriteOp", &18,, name$ ¸ ,, sp%
  455. 'ö7   : È− "OS_SpriteOp", &118, base%, name$ ¸ ,, sp%
  456. (  Ë
  457. (
  458. !  ò_Draw_Check( (!sp%) + 24 )
  459. (
  460.   !D% = 5
  461. (  D%!4 = (!sp%) + 24
  462. ((  D%!8 = xmin%
  463. (2  D%!12 = ymin%
  464. (<  D%!16 = xmax%
  465. (F  D%!20 = ymax%
  466. (P  D% += 24
  467. (Z  ã i%= 0 ¸ (!sp%) - 1 ⇦ 4
  468. (d    D%!i% = sp%!i%
  469. (n
  470.   í i%
  471. (x  D% += !sp%
  472. (ŵá
  473. (…:
  474. („Kô *********************************************************************
  475. ( @ô * Grouped objects can be nested as deep as memory permits.
  476. (ª:
  477. (´(Ý ò_Open_Draw_Group_Object( group$ )
  478. (¾ê G%
  479. (È  ò_Draw_Check( 37 )
  480. (Ò)  ç Draw_Group%=(Draw_Group_Max%-1) …
  481. (Ü?    ò_Extend_Heap_Block( Draw_Group_Buffer%, (16 * 5 * 4) )
  482. (æ    Draw_Group_Max% += 16
  483. (ð  Í
  484. (ú5  G% = Draw_Group_Buffer% + (Draw_Group% * 5 * 4)
  485. )  G%!0 = D% - Draw_Buffer%
  486. )  G%!4 = Draw_xmin%
  487. )  G%!8 = Draw_ymin%
  488. )"  G%!12 = Draw_xmax%
  489. ),  G%!16 = Draw_ymax%
  490. )6
  491.   !D% = 6
  492. )@(  $(D%+24) = Àgroup$+ Ä12, " "), 12)
  493. )J  D% += 36
  494. )T  Draw_Group% += 1
  495. )^  Draw_xmin% = &7FFFFFFF
  496. )h  Draw_ymin% = &7FFFFFFF
  497. )r  Draw_xmax% = &80000000
  498. )|  Draw_ymax% = &80000000
  499. )ŷá
  500. )‘:
  501. )ŒÝ ò_Close_Draw_Group_Object
  502. )¤ ê G%, H%
  503. )®  ç Draw_Group%=0 …
  504. )¸'    Ŷ 1, "Bad Draw Group Close!!!!"
  505. )  Í
  506. )Ì  Draw_Group% -= 1
  507. )Ö8  G%    = Draw_Group_Buffer% + (Draw_Group% * 5 * 4)
  508. )à#  H%    = ¤_Draw_Address( !G% )
  509. )ê  H%!4  = D% - H%
  510. )ô  H%!8  = Draw_xmin%
  511. )þ  H%!12 = Draw_ymin%
  512. *  H%!16 = Draw_xmax%
  513. *  H%!20 = Draw_ymax%
  514. *0  Draw_xmin% = ¤_min_int( Draw_xmin%, G%!4 )
  515. *&0  Draw_ymin% = ¤_min_int( Draw_ymin%, G%!8 )
  516. *01  Draw_xmax% = ¤_max_int( Draw_xmax%, G%!12 )
  517. *:1  Draw_ymax% = ¤_max_int( Draw_ymax%, G%!16 )
  518. *Dá
  519. *N:
  520. *XKô *********************************************************************
  521. *b@ô * A tagged object can be nested as deep as memory permits.
  522. *l>ô * This uses the Group "stack" to store the bounding box.
  523. *vLô * Just open it, define an object, then write to D%, and finally close.
  524. *€:
  525. *⇩.Ý ò_Open_Draw_Tagged_Object( identifier% )
  526. *“ê G%
  527. *fi  ò_Draw_Check( 28 )
  528. *¨)  ç Draw_Group%=(Draw_Group_Max%-1) …
  529. *²?    ò_Extend_Heap_Block( Draw_Group_Buffer%, (16 * 5 * 4) )
  530. *¼    Draw_Group_Max% += 16
  531. *Æ  Í
  532. *Ð5  G% = Draw_Group_Buffer% + (Draw_Group% * 5 * 4)
  533. *Ú  G%!0 = D% - Draw_Buffer%
  534. *ä  G%!4 = Draw_xmin%
  535. *î  G%!8 = Draw_ymin%
  536. *ø  G%!12 = Draw_xmax%
  537. +  G%!16 = Draw_ymax%
  538. +
  539.   !D% = 7
  540. +  D%!24 = identifier%
  541. +   D% += 28
  542. +*  Draw_Group% += 1
  543. +4  Draw_xmin% = &7FFFFFFF
  544. +>  Draw_ymin% = &7FFFFFFF
  545. +H  Draw_xmax% = &80000000
  546. +R  Draw_ymax% = &80000000
  547. +\á
  548. +f:
  549. +pK: ô  If prepared tag information externally, can use this to copy it to
  550. +z: ô  the output buffer.
  551. +☓:
  552. +‰-Ý ò_Draw_Tagged_Object( start%, length% )
  553. +—ê i%
  554. +¢  ò_Draw_Check( length% )
  555. +¬  ã i%= 0 ¸ length% - 1
  556. +¶    D%?i% = start%?i%
  557.   í i%
  558. +Ê  D% += length%
  559. +Ôá
  560. +Þ:
  561. +èB: ô  These can be used if creating tag information on the fly.
  562. +ò:
  563. +ü(Ý ò_Draw_Tagged_Object_Byte( byte% )
  564. ,  ò_Draw_Check( 1 )
  565. ,  ?D% = byte%
  566. ,
  567.   D% += 1
  568. ,$á
  569. ,.:
  570. ,8(Ý ò_Draw_Tagged_Object_Word( word% )
  571. ,B  ò_Draw_Check( 4 )
  572. ,L  !D% = word%
  573. ,V
  574.   D% += 4
  575. ,`á
  576. ,j:
  577. ,t(Ý ò_Draw_Tagged_Object_Text( text$ )
  578. ,~"  ò_Draw_Check( ©(text$) + 2 )
  579. ,⇦  $D% = text$+ ½(0)
  580. ,‹  D% += ©(text$) + 1
  581. ,†á
  582. ,¦:
  583. ,°<: ô  Stop writing tag information, word align, then end.
  584. ,º:
  585. ,Ä Ý ò_Close_Draw_Tagged_Object
  586. ,Π ò_Draw_Check( 4 )
  587. ,Ø  È” (D% € 3)<>0
  588. ,â    ?D% = 0
  589. ,ì    D% += 1
  590. ,ö  Î
  591. -  ò_Close_Draw_Group_Object
  592. -
  593. -:
  594. -Kô *********************************************************************
  595. -(=ô * IN   X%,Y% == Draw units of bottom left of character.
  596. -23ô *      W%,H% == Draw units size of character.
  597. -<.ô *      C%    == ASCII code of character.
  598. -F-ô * OUT  [D%++] <-- Draw file path object
  599. -P:
  600. -Z,Ý ò_Draw_Character( C%, X%, Y%, W%, H% )
  601. -d ê o%, i%
  602. -n  C% = C% << 2
  603. -x   o% = 0
  604. -ŵ  ç Draw_Font_Cache%<>0 …
  605. -…"    o% = Draw_Font_Cache_D%!C%
  606. -„  Í
  607. -   ç o%=0 …
  608. -ª    ç Draw_Font_Cache%<>0 …
  609. -´I      Draw_Font_Cache_D%!C% = D% - Draw_Buffer%         :  ô  Offset!
  610. -¾$      Draw_Font_Cache_X%!C% = X%
  611. -È$      Draw_Font_Cache_Y%!C% = Y%
  612. -Ò$      Draw_Font_Cache_W%!C% = W%
  613. -Ü$      Draw_Font_Cache_H%!C% = H%
  614. -æ        Í
  615. -ð_    ò_Open_Draw_Path_Object( Draw_Font_Fill%, Draw_Font_Colour%, Draw_Font_Width%, 1 << 6 )
  616. -ú;    ò_Draw_Define_Character( C% >>> 2, X%, Y%, W%, H% )
  617. .     ò_Close_Draw_Path_Object
  618. .  Ì
  619. .,    ò_Draw_Check( !(o%+Draw_Buffer%+4) )
  620. ."    o% += Draw_Buffer%
  621. .,    D%!0 = 2
  622. .6    D%!4 = o%!4
  623. .@    D%!24 = Draw_Font_Fill%
  624. .J!    D%!28 = Draw_Font_Colour%
  625. .T     D%!32 = Draw_Font_Width%
  626. .^!    ã i%= 36 ¸ (o%!4) - 1 ⇦ 4
  627. .h      D%!i% = o%!i%
  628. .r     í i%
  629. .|D    TransMatrix%!0  = (W% / (Draw_Font_Cache_W%!C%)) * (1 << 16)
  630. .ŷ    TransMatrix%!4  = 0
  631. .‘    TransMatrix%!8  = 0
  632. .ŒD    TransMatrix%!12 = (H% / (Draw_Font_Cache_H%!C%)) * (1 << 16)
  633. .¤6    TransMatrix%!16 = X% - (Draw_Font_Cache_X%!C%)
  634. .®6    TransMatrix%!20 = Y% - (Draw_Font_Cache_Y%!C%)
  635. .¸:    È− "Draw_TransformPath", D%+40, 0, TransMatrix%, 0
  636. .Â1    ò_Draw_Path_Bounding_Box( D%, &7000003A )
  637. .Ì    D% += (D%!4)
  638. .Ö  Í
  639. .àá
  640. .ê:
  641. .ôH: ô  Recursive routine to define character, ie insert sub-paths into
  642. .þE: ô  buffer until character drawn.  Recursive because of accents.
  643. /:
  644. /3Ý ò_Draw_Define_Character( C%, X%, Y%, W%, H% )
  645. /#ê Char%, x%, y%, Include%, Ptr%
  646. /&!ê Chunk%, Chunk_Alpha%, Char%
  647. /0"ê W, H, J%, K%, Flag%, Ignore%
  648. /:*  Chunk%       = 16 + ((C% Ŵ 32) << 2)
  649. /D&  Chunk_Alpha% = ¤getofw( Chunk% )
  650. /NK  Char%        = ¤getofw( Chunk_Alpha%+((C% ◰ 32) << 2) )+ Chunk_Alpha%
  651. /X  ç Char%=0 …
  652. /b1    Ŷ 1, "Character "+ Ã(C%)+ " not defined."
  653. /l  Í
  654. /v  :
  655. /€  Ï#O% = Char%
  656. /⇩C  Flag% = Œ#O%               :  ô  Bit 0 set if 12-bit co-ords.
  657. /“  ç (Flag% € 8)=0 …
  658. /fi5    Ŷ 1, "Character "+Ã(C%)+" is not an outline."
  659. /¨  Í
  660. /²  ç (Flag% € 1)<>0 …
  661. /¼    x% = Œ#O%
  662. /Æ    y% = Œ#O%
  663. /Р   x% += (y% € &F) << 8
  664. /Ú'    y% = (y% >>> 4) + ((Œ#O%) << 4)
  665. /ä(    ç x%>=&800 … x% = x% ☓ &FFFFF000
  666. /î(    ç y%>=&800 … y% = y% ☓ &FFFFF000
  667. /ø    J% = Œ#O% + Œ#O% + Œ#O%
  668. 0  Ì
  669. 0     x% = Œ #O%
  670. 0    y% = Œ #O%
  671. 0 '    ç x%>=&80 … x% = x% ☓ &FFFFFF00
  672. 0*'    ç y%>=&80 … y% = y% ☓ &FFFFFF00
  673. 04    J% = Œ#O% + Œ#O%
  674. 0>  Í
  675. 0H   W = W% / Draw_Design_Size%
  676. 0R   H = H% / Draw_Design_Size%
  677. 0\  J% = X% + (x% * W)
  678. 0f  K% = Y% + (y% * H)
  679. 0p  :
  680. 0z  Ignore% = £
  681. 0☓  õ
  682. 0‰    Seg% = Œ#O%
  683. 0—    È‰ (Seg% € 3) Ê
  684. 0¢     É 0
  685. 0¬"      ç (Seg% € (1 << 3))<>0 …
  686. 0¶?        Include% = Œ#O%      :  ô  Sub-character(s) follow.
  687.         õ
  688. 0Ê          Ptr% = •#O%
  689. 0ÔA          ò_Draw_Define_Character( Include%, X%, Y%, W%, H% )
  690. 0Þ          Ï#O% = Ptr%
  691. 0è          Include% = Œ#O%
  692. 0ò        ý (Include%=0)
  693. 0ü        Seg% = 0
  694. 1       Í
  695. 1"      ç (Seg% € (1 << 2))<>0 …
  696. 1;        Ignore% = ¹          :  ô  Stroke path follows.
  697. 1$       Í
  698. 1.      ç Seg%=0 …
  699. 18        ò_Draw_Check( 4 )
  700. 1B5        !D% = 0                 :  ô  Close path.
  701. 1L        D% += 4
  702. 1V       Í
  703. 1`3    É 1                      :  ô  Move to X, Y
  704. 1j      ç ¬(Ignore%) …
  705. 1t        ò_Draw_Check( 12 )
  706. 1~        !D% = 2
  707. 1⇦        D% += 4
  708. 1‹       Í
  709. 1†%      ò_Get_Draw_Font_Coordinates
  710. 1¦3    É 2                      :  ô  Line to X, Y
  711. 1°      ç ¬(Ignore%) …
  712. 1º        ò_Draw_Check( 12 )
  713. 1Ä        !D% = 8
  714. 1Π       D% += 4
  715. 1Ø       Í
  716. 1â%      ò_Get_Draw_Font_Coordinates
  717. 1ìD    É 3                      :  ô  Curve to x1,y1, x2,y2, x3,y3.
  718. 1ö      ç ¬(Ignore%) …
  719. 2        ò_Draw_Check( 28 )
  720. 2
  721.         !D% = 6
  722. 2        D% += 4
  723. 2       Í
  724. 2(%      ò_Get_Draw_Font_Coordinates
  725. 22%      ò_Get_Draw_Font_Coordinates
  726. 2<%      ò_Get_Draw_Font_Coordinates
  727. 2F        Ë
  728. 2P  ý Seg%=0
  729. 2Zá
  730. 2d:
  731. 2nKô *********************************************************************
  732. 2xEô * If cache%>0 then cache every new letter drawn with this font.
  733. 2ŵ7ô * [If cache%>1 then read in definitions into RAM]
  734. 2…8ô * Sets up O%, M% for outline/metrics file handles.
  735. 2„4ô * Also Draw_Design_Size%, Draw_Chars_Defined%.
  736. 2 =ô * Also Draw_Font_Cache%[], index is ASCII code [0..255]
  737. 2ªJô * Draw_Font_Cache%   Draw buffer offset to path object for character
  738. 2´.ô * Draw_Font_Cache_X% Left, in draw units
  739. 2¾0ô * Draw_Font_Cache_Y% Bottom, in draw units
  740. 2È/ô * Draw_Font_Cache_W% Width, in draw units
  741. 2Ò0ô * Draw_Font_Cache_H% Height, in draw units
  742. 2Ü:
  743. 2æ'Ý ò_Open_Draw_Font( font$, cache% )
  744. 2ðê i%
  745. 2ú!  ç Draw_Font_Cache$<>font$ …
  746. 35    O% = ¤_OpenIn_Font_File( font$+ ".Outlines" )
  747. 3    ç O%=0 …
  748. 3;      Ŷ 1, "Outlines not found for font '"+ font$+ "'."
  749. 3"        Í
  750. 3,7    M% = ¤_OpenIn_Font_File( font$+ ".IntMetrics" )
  751. 36    ç M%=0 …
  752. 3@      Ù#O%
  753. 3J:      Ŷ 1, "Metrics not found for font '"+ font$+ "'."
  754. 3T        Í
  755. 3^    Ï#M% = 48
  756. 3h"    Draw_Chars_Defined% = Œ#M%
  757. 3r    Ï#O% = 6
  758. 3|/    Draw_Design_Size% = Œ#O% + (256 * Œ#O%)
  759. 3ŷ    ç cache%>0 …
  760. 3‘2      ò_Release_Heap_Block( Draw_Font_Cache% )
  761. 3Œ@      ò_Claim_Heap_Block( Draw_Font_Cache%, (256 << 2) * 6 )
  762. 3¤/      Draw_Font_Cache_D% = Draw_Font_Cache%
  763. 3®8      Draw_Font_Cache_X% = Draw_Font_Cache_D% + 1024
  764. 3¸8      Draw_Font_Cache_Y% = Draw_Font_Cache_X% + 1024
  765. 3Â8      Draw_Font_Cache_W% = Draw_Font_Cache_Y% + 1024
  766. 3Ì8      Draw_Font_Cache_H% = Draw_Font_Cache_W% + 1024
  767. 3Ö'      ã i%= 0 ¸ ((256 - 1) * 4) ⇦ 4
  768. 3à%        Draw_Font_Cache_D%!i% = 0
  769. 3ê      í i%
  770. 3ô        Í
  771. 3þ     Draw_Font_Cache$ = font$
  772. 4  Í
  773. 4á
  774. 4:
  775. 4&J: ô  Automatically called when close DrawFile, so only needed if using
  776. 40+: ô  more than one font in a draw file.
  777. 4::
  778. 4D Ý ò_Close_Draw_Font( font$ )
  779. 4N   ç Draw_Font_Cache$=font$ …
  780. 4X    ç O%>0 …
  781. 4b      Ù#O%
  782. 4l      O% = 0
  783. 4v        Í
  784. 4€    ç M%>0 …
  785. 4⇩      Ù#M%
  786. 4“      M% = 0
  787. 4fi        Í
  788. 4¨0    ò_Release_Heap_Block( Draw_Font_Cache% )
  789. 4²    Draw_Font_Cache_D% = 0
  790. 4¼    Draw_Font_Cache_X% = 0
  791. 4Æ    Draw_Font_Cache_Y% = 0
  792. 4Р   Draw_Font_Cache_W% = 0
  793. 4Ú    Draw_Font_Cache_H% = 0
  794. 4ä    Draw_Font_Cache$   = ""
  795. 4î  Í
  796. 4øá
  797. 5:
  798. 5 !Ý ¤_OpenIn_Font_File( file$ )
  799. 5ê h%
  800. 5 0  È− "OS_Find", &42, file$, "Font$Path" ¸ h%
  801. 5*= h%
  802. 54:
  803. 5>: ô
  804. 5H7: ô  Returns width in terms of Design co-ordinates.
  805. 5R:
  806. 5\Ý ¤_Char_Width( C% )
  807. 5fê Map_Byte%, Width%
  808. 5p>  ç M%=0 … Ŷ 1, "Bad call to FN_Char_Width, no font open."
  809. 5z  Ï#M% = 52 + C%
  810. 5☓  Map_Byte% = Œ#M%
  811. 5‰C  Ï#M% = 52 + 256 + (8 * Draw_Chars_Defined%) + (2 * Map_Byte%)
  812. 5—"  Width% = Œ#M% + (256 * Œ#M%)
  813. 5¢9  ç (Width% € &8000)<>0 … Width% = Width% ☓ &FFFF0000
  814. 5¬ = Width%
  815. 5¶:
  816. 5ÀJ: ô  Given a character, and a nominal width of font, return Draw Units
  817. 5Ê: ô  width of character.
  818. 5Ô:
  819. 5Þ%Ý ¤_Char_Draw_Width( C%, width% )
  820. 5è7= (¤_Char_Width( C% ) * width%) / Draw_Design_Size%
  821. 5ò:
  822. 5ü: ô
  823. 6;: ô  Read a 32-bit word from outline font at offset O%.
  824. 6:
  825. 6Ý ¤getofw( A% )
  826. 6$  Ï#O% = A%
  827. 6./= Œ#O% + 256*(Œ#O% + 256*(Œ#O% + 256*Œ#O%))
  828. 68:
  829. 6BB: ô  Read two 8/12-bit co-ordinates from roving outlines file.
  830. 6L: ô  Stores in D%++.
  831. 6V!: ô  USES Flag%, J%, K%, W, H
  832. 6`:
  833. 6j!Ý ò_Get_Draw_Font_Coordinates
  834. 6t ê x%, y%
  835. 6~  ç (Flag% € 1)<>0 …
  836. 6⇦    x% = Œ#O%
  837. 6‹    y% = Œ#O%
  838. 6†    x% += (y% € &F) << 8
  839. 6¦'    y% = (y% >>> 4) + ((Œ#O%) << 4)
  840. 6°(    ç x%>=&800 … x% = x% ☓ &FFFFF000
  841. 6º(    ç y%>=&800 … y% = y% ☓ &FFFFF000
  842. 6Ä  Ì
  843. 6Π   x% = Œ#O%
  844. 6Ø    y% = Œ#O%
  845. 6â'    ç x%>=&80 … x% = x% ☓ &FFFFFF00
  846. 6ì'    ç y%>=&80 … y% = y% ☓ &FFFFFF00
  847. 6ö  Í
  848. 7  ç ¬(Ignore%) …
  849. 7
  850.     !D% = J% + (x% * W)
  851. 7    D%!4 = K% + (y% * H)
  852. 7    D% += 8
  853. 7(  Í
  854. 72á
  855. 7<:
  856. 7FKô *********************************************************************
  857. 7PKô * These calls can be used to claim temporary workspace while creating
  858. 7ZHô * the draw file.  They should really only be called when "outside"
  859. 7dJô * any structure - in case future implementations can't handle memory
  860. 7nô * moving about.
  861. 7xKô * Because force callee to remember offset, can be called recursively.
  862. 7ŵGô * Returns an OFFSET, that can be dereferenced by FN_Draw_Address.
  863. 7…0ô * This has to be done over any Draw calls.
  864. 7„:
  865. 7 Jô * Store length of sub-buffr (privately) so know how far to download.
  866. 7ª:
  867. 7´&Ý ¤_Claim_Draw_Sub_Buffer( need% )
  868. 7¾)  need% = (((need% + 3) Ŵ 4) * 4) + 4
  869. 7È  ò_Draw_Check( need% )
  870. 7ÒH  !D% = need%                           :  ô  Store so can download.
  871. 7Ü  D% += need%
  872. 7æ'= (D% - (need% - 4)) - Draw_Buffer%
  873. 7ð:
  874. 7úÝ ¤_Draw_Address( offset% )
  875. 8= offset% + Draw_Buffer%
  876. 8:
  877. 8*Ý ò_Release_Draw_Sub_Buffer( Offset% )
  878. 8"ê i%, e%, d%, s%
  879. 8,(  d% = ¤_Draw_Address( Offset% ) - 4
  880. 86  e% = d% + (!d%)
  881. 8@  s% = D% - e%
  882. 8J  ç s%>0 …
  883. 8T    ã i%= 0 ¸ (s% - 1) ⇦ 4
  884. 8^      d%!i%= e%!i%
  885. 8h     í i%
  886. 8r  Í
  887. 8|  D% = d% + s%
  888. 8ŷá
  889. 8‘:
  890. 8ŒKô *********************************************************************
  891. 8¤:
  892. 8®!Ý ¤_Inches_To_Draw_Units( i )
  893. 8¸= i * 256 * 180
  894. 8Â:
  895. 8ÌÝ ò_Draw_Check( n_bytes% )
  896. 8Ö  ç (D%+n_bytes%)>E% …
  897. 8à    D% -= Draw_Buffer%
  898. 8ê    E% -= Draw_Buffer%
  899. 8ôC    n_bytes% = ¤_max_int( ((n_bytes% + 111) € -4), (4 * 1024) )
  900. 8þ5    ò_Extend_Heap_Block( Draw_Buffer%, n_bytes% )
  901. 9    D% += Draw_Buffer%
  902. 9%    E% += Draw_Buffer% + n_bytes%
  903. 9  Í
  904. 9&á
  905. 90:
  906. 9:Kô *********************************************************************
  907. 9DDô * The following routines transform PATHS - these are the paths
  908. 9NJô * themselves, less the header.  in% *MUST* be valid.  out%=0 if want
  909. 9XFô * to overwrite input, otherwise points to a buffer that contains
  910. 9b$ô * zero, then length of buffer.
  911. 9l:
  912. 9vC: ô  This is used to rotate an input path about a given origin.
  913. 9€:
  914. 9⇩8Ý ò_Draw_Rotate_Path( in%, out%, xo%, yo%, radians )
  915. 9“  ç (xo%<>0) ☓ (yo%<>0) …
  916. 9fi!    !TransMatrix% = &00010000
  917. 9¨    TransMatrix%!4 = 0
  918. 9²    TransMatrix%!8 = 0
  919. 9¼#    TransMatrix%!12 = &00010000
  920. 9Æ    TransMatrix%!16 = -xo%
  921. 9Р   TransMatrix%!20 = -yo%
  922. 9Ú9    È− "Draw_ProcessPath", in%, out%, TransMatrix%, 0
  923. 9ä    ç out%<>0 …
  924. 9î      in% = out%
  925. 9ø      out% = 0
  926. :        Í
  927. :   Í
  928. :,  !TransMatrix% = œ(radians) * (1 << 16)
  929. : -  TransMatrix%!4 = µ(radians) * (1 << 16)
  930. :*(  TransMatrix%!8 = -(TransMatrix%!4)
  931. :4(  TransMatrix%!12 = -(!TransMatrix%)
  932. :>  TransMatrix%!16 = xo%
  933. :H  TransMatrix%!20 = yo%
  934. :R7  È− "Draw_ProcessPath", in%, out%, TransMatrix%, 0
  935. :\á
  936. :f:
  937. :p1: ô  Shift the whole object around the plane.
  938. :z:
  939. :☓2Ý ò_Draw_Translate_Path( in%, out%, dx%, dy% )
  940. :‰  !TransMatrix% = &00010000
  941. :—  TransMatrix%!4 = 0
  942. :¢  TransMatrix%!8 = 0
  943. :¬!  TransMatrix%!12 = &00010000
  944. :¶  TransMatrix%!16 = dx%
  945. :À  TransMatrix%!20 = dy%
  946. :Ê7  È− "Draw_ProcessPath", in%, out%, TransMatrix%, 0
  947. :Ôá
  948. :Þ:
  949. :è : ô  Scale the whole object.
  950. :ò:
  951. :ü,Ý ò_Draw_Scale_Path( in%, out%, dx, dy )
  952. ;$  !TransMatrix% = dx * &00010000
  953. ;  TransMatrix%!4 = 0
  954. ;  TransMatrix%!8 = 0
  955. ;$&  TransMatrix%!12 = dy * &00010000
  956. ;.  TransMatrix%!16 = 0
  957. ;8  TransMatrix%!20 = 0
  958. ;B7  È− "Draw_ProcessPath", in%, out%, TransMatrix%, 0
  959. ;Lá
  960. ;V:
  961. ;`,: ô  [D%] <-- output path of size% (>8).
  962. ;j:
  963. ;t#Ý ò_Init_Draw_Out_Path( size% )
  964. ;~  ò_Check( size% )
  965. ;⇦
  966.   !D% = 0
  967. ;‹  D%!4 = size%
  968. ;†á
  969. ;¦:
  970. ;°Kô *********************************************************************
  971. ;º=ô * Given a path Object header, fill in the bounding box.
  972. ;Ä:
  973. ;Î1Ý ò_Draw_Path_Bounding_Box( h%, fill_style% )
  974. ;Ø.  ç fill_style%=-1 … fill_style%=&7000003A
  975. ;âL  È− "Draw_ProcessPath", h%+40, fill_style%, 0, 0, 0, 0, 0, h%+&80000008
  976. ;ìá
  977. ;ö:
  978. <+ô  Last line of <BasicV$Lib>.CreateDraw
  979. ÿ