home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 517a.lha / VFont_v2.0 / asm / vfont.i
Text File  |  1991-06-09  |  9KB  |  295 lines

  1.  IFND  VFONT_VFONT_I
  2. VFONT_VFONT_I     SET  1
  3.  
  4.  IFND EXEC_TYPES_I
  5.  INCLUDE "exec/types.i"
  6.  ENDC
  7.  IFND EXEC_LIBRARIES_I
  8.  INCLUDE "exec/libraries.i"
  9.  ENDC
  10.  IFND EXEC_LISTS_I
  11.  INCLUDE "exec/lists.i"
  12.  ENDC
  13.  IFND EXEC_SAMAPHORES_I
  14.  INCLUDE "exec/semaphores.i"
  15.  ENDC
  16.  IFND GRAPHICS_GFX_I
  17.  INCLUDE "graphics/gfx.i"
  18.  ENDC
  19.  
  20.  
  21. FIXOFFSET  equ 2097152
  22.  
  23. ;**********************
  24. ;* VFont Class stuff. *
  25. ;**********************
  26.  
  27. CharWidth   MACRO
  28.     movea.l vf_Class(\1),a0
  29.     movea.l vfc_Chars(a0),a0
  30.     muls.l  vfcc_SIZEOF,\2
  31.     move.w  vfcc_Width(a0),\2
  32.     move.w  \2,d0
  33.     ENDM
  34.  
  35. CharHeight MACRO
  36.     movea.l vf_Class(\1),a0
  37.     movea.l vfc_Chars(a0),a0
  38.     muls.l  vfcc_SIZEOF,\2
  39.     move.w  vfcc_Height(a0),\2
  40.     move.w  \2,d0
  41.     ENDM
  42.  
  43. VC_FILL         equ      $01        ;# Draw solid characters. 
  44. VC_WIRE         equ      $02        ;# Draw wire character. Contour otherwise
  45. VC_CONTINUES    equ      $04        ;# Continue on next curve.     
  46. VC_BEND         equ      $08        ;# Bend the line. 
  47. VC_CURVE        equ      $10        ;# No end points. 
  48. VC_CONTINUED    equ      $20        ;# Continued from the previous curve. 
  49. VC_ROUND        equ      $40        ;# Bended line with no end points. 
  50. VC_THINCURVE    equ      $80        ;# Should be shrunk when mapped.
  51.  
  52.  STRUCTURE VCurve,0
  53.     APTR    vc_Next                 ;# The next. 
  54.     APTR    vc_Verticies            ;# The verticies. 
  55.     UWORD   vc_Used                 ;# The number of verticies. 
  56.     UWORD   vc_Size                 ;# The actual space for the curve. 
  57.     WORD    vc_R                    ;# The roundness. 
  58.     UBYTE   vc_E                    ;# The edginess. 
  59.     UBYTE   vc_Flags                ;# Flags. 
  60.     BYTE    vc_FgPen                ;# Foreground color. 
  61.     BYTE    vc_BgPen                ;# Background color. 
  62.     BYTE    vc_OlPen                ;# Outline color. 
  63.     BYTE    vc_DMode                ;# Draw mode 
  64.     WORD    vc_sym_x                ;# Symetry point. 
  65.     WORD    vc_sym_y                ;# -"- 
  66.     LABEL   vc_SIZEOF
  67.  
  68.  STRUCTURE VClassChar,0
  69.     APTR    vcc_Curve 
  70.     UWORD   vcc_Width 
  71.     UWORD   vcc_Height 
  72.     LABEL   vcc_SIZEOF
  73.  
  74.  
  75.  STRUCTURE VFontClass,0
  76.     APTR    vfcl_Next        ;# Next font class. 
  77.     APTR    vfcl_Name        ;# Symbolic name of the font class. 
  78.     APTR    vfcl_Author      ;# The name of the author. 
  79.     UWORD   vfcl_XSize       ;# Size of the average template chars. 
  80.     UWORD   vfcl_YSize       ;# Size of the average template chars. 
  81.     LONG    vfcl_UpVector    ;# Default Up direction of char. 
  82.     LONG    vfcl_Tilt        ;# Factor of italic text. 
  83.     UBYTE   vfcl_Flags       ;# The flags. 
  84.     UBYTE   vfcl_Style       ;# The styles. 
  85.     UBYTE   vfcl_Locked      ;# Semaphore of exlusive use of class. 
  86.     UBYTE   vfcl_LowChar     ;# First defined character. 
  87.     UBYTE   vfcl_HighChar    ;# The last defined character. 
  88.     UBYTE   vfcl_Space       ;# Default spacing between char. 
  89.     APTR    vfcl_Chars       ;# The actual definition of chars. 
  90.     UWORD   vfcl_Baseline    ;# Baseline. 
  91.     UWORD   vfcl_Users       ;# Pad. 
  92.     LABEL   vfcl_SIZEOF
  93.  
  94.  
  95.  
  96. ;************************
  97. ;# VFont instance stuff *
  98. ;************************
  99.  
  100. VFC_FILL         equ        $01        ;# Area fill the character. 
  101. VFC_MAPPED       equ        $02        ;# Character is mapped. 
  102. VFC_NOCOOKIECUT  equ        $04        ;# Don't render a'la cookie-cut. 
  103. VFC_CACHED       equ        $08
  104. VFC_RESERVED     equ        $f0        ;# Reserved for future use. 
  105.  
  106. VCM_NAME         equ        $01
  107. VCM_SIZE         equ        $02
  108. VCM_STYLE        equ        $04
  109. VCM_UP           equ        $08
  110. VCM_PATH         equ        $10
  111. VCM_TILT         equ        $20
  112. VCM_BOLD         equ        $40
  113.  
  114. VFCB_FILL        equ        0          ;# Area fill the character.
  115. VFCB_MAPPED      equ        1          ;# Character is mapped.
  116. VFCB_NOCOOKIECUT equ        2          ;# Don't render a'la cookie-cut.
  117. VFCB_CACHED      equ        3
  118.  
  119. VCMB_NAME        equ        0
  120. VCMB_SIZE        equ        1
  121. VCMB_STYLE       equ        2
  122. VCMB_UP          equ        3
  123. VCMB_PATH        equ        4
  124. VCMB_TILT        equ        5
  125. VCMB_BOLD        equ        6
  126.  
  127.  
  128.  STRUCTURE Lines,0
  129.     APTR    l_Next
  130.     APTR    l_XY
  131.     UWORD   l_Count
  132.     BYTE    l_FgPen
  133.     BYTE    l_BgPen
  134.     BYTE    l_OlPen
  135.     BYTE    l_DMode 
  136.     LABEL   l_SIZEOF
  137.  
  138.  STRUCTURE charDef,0
  139.     WORD    cd_charOffset 
  140.     WORD    cd_charBitWidth 
  141.     LABEL   cd_SIZEOF
  142.  
  143.  STRUCTURE VFontChar,0
  144.     APTR    vfc_Lines 
  145.     ULONG   vfc_DeltaX
  146.     ULONG   vfc_DeltaY
  147.     UBYTE   vfc_Flags
  148.     STRUCT  vfc_pad,3
  149.     LABEL   vfc_SIZEOF
  150.  
  151.  
  152.  STRUCTURE VFont,0
  153.  
  154.     ;# struct TextFont compatible part 
  155.     APTR    vf_ln_Succ 
  156.     APTR    vf_ln_Pred 
  157.     UBYTE   vf_ln_Type 
  158.     BYTE    vf_ln_Pri 
  159.     APTR    vf_Name 
  160.     APTR    vf_ReplyPort 
  161.     UWORD   vf_Length 
  162.  
  163.     UWORD   vf_TFYSize 
  164.     UBYTE   vf_Style 
  165.     UBYTE   vf_Flags 
  166.     UWORD   vf_TFXSize 
  167.     UWORD   vf_TFBaseline 
  168.     UWORD   vf_BoldSmear 
  169.     UWORD   vf_Accessors 
  170.     UBYTE   vf_LoChar 
  171.     UBYTE   vf_HiChar 
  172.     APTR    vf_CharData 
  173.     UWORD   vf_Modulo 
  174.     APTR    vf_CharLoc 
  175.     APTR    vf_CharSpace 
  176.     APTR    vf_CharKern  
  177.  
  178.     ;# struct ColorTextFont compatible extension. 
  179.     UWORD   vf_ColorFlags 
  180.     UBYTE   vf_Depth 
  181.     UBYTE   vf_FgColor 
  182.     UBYTE   vf_Low 
  183.     UBYTE   vf_High 
  184.     UBYTE   vf_PlanePick 
  185.     UBYTE   vf_PlaneOnOff 
  186.     APTR    vf_ColorFontColors 
  187.     STRUCT  vf_ColorCharData,8*4
  188.  
  189.     ;# The Vector specific part. 
  190.     UWORD   vf_XSize 
  191.     UWORD   vf_YSize 
  192.     UWORD   vf_Baseline 
  193.     APTR    vf_BasePoints       ;# The origin of each character within CharData.
  194.     LONG    vf_UpVector         ;# The Up direction of char. 
  195.     LONG    vf_AlfaPath         ;# The direction of text: X-Y angle 
  196.     LONG    vf_BetaPath         ;# The direction of text: Y-Z angle 
  197.     LONG    vf_Tilt             ;# Factor of italic text. 
  198.     STRUCT  vf_Lock,SS_SIZE     ;# Semaphore for mutual exclusion. 
  199.     APTR    vf_Chars             ;# Character data. 
  200.     APTR    vf_Class            ;# The definition of the font. 
  201.     STRUCT  vf_BM,bm_SIZEOF     ;# A bitmap 
  202.     UWORD   vf_FreeCharOffset   ;# Next free bitoffset in the bitmap. 
  203.     UWORD   vf_CacheSize        ;# Size of the cache. 
  204.     APTR    vf_Next 
  205.     LABEL   vf_SIZEOF
  206.  
  207.  
  208.  
  209. ;********************
  210. ;# RasterPort hook. *
  211. ;********************
  212.  
  213. MAXBINDS    equ 256
  214.  
  215.  STRUCTURE VFontBind,0
  216.     APTR    vfbi_VFont      ;# The font. 
  217.     APTR    vfbi_RPort      ;# The rastport. 
  218.     APTR    vfbi_Next       ;# The next. 
  219.     LABEL   vfbi_SIZEOF
  220.  
  221.  
  222. ;*****************
  223. ;# LoadSeg hook. *
  224. ;*****************
  225.  
  226.  STRUCTURE LoadSegs,0
  227.     APTR    lss_Next        ;# The next loadseg. 
  228.     ULONG   lss_Seg         ;# The Segment list. 
  229.     LABEL   lss_SIZEOF
  230.  
  231.  
  232. ;*****************************
  233. ;# VFont library base stuff. *
  234. ;*****************************
  235.  
  236.  
  237. VFB_MUTE         equ        $0000
  238. VFB_DEBUG        equ        $0001
  239. VFB_VERBOSE      equ        $0002
  240. VFB_FLUSHCLASS   equ        $0004
  241. VFB_FLUSHFONTS   equ        $0008
  242. VFB_MAPPED       equ        $0010
  243. VFB_EXCLUSIVE    equ        $0020
  244. VFB_FORCED       equ        $0040
  245. VFB_NOCONVERT    equ        $0080
  246. VFB_ANYSIZE      equ        $0100
  247. VFB_NOBITCACHE   equ        $0200
  248. VFB_RESERVED     equ        $fc00
  249.  
  250.  STRUCTURE vFontBase,0
  251.     STRUCT      vfb_Lib,LIB_SIZE        ;# Library stuff. 
  252.     ULONG       vfb_SegList 
  253.     APTR        vfb_VFontClass          ;# List of font classes. 
  254.     APTR        vfb_VFontBinds          ;# List of binding RPort<->VFont. 
  255.     APTR        vfb_DefVFont            ;# List of instansiated fonts. 
  256.     APTR        vfb_DiskFonts           ;# List of loadsegs of diskfonts. 
  257.     STRUCT      vfb_mpool,LH_SIZE       ;# List with MemLists 
  258.     STRUCT      vfb_epool,LH_SIZE       ;# List with MemEntries. 
  259.     WORD        vfb_Flags               ;# For debug purpose etc. 
  260.     APTR        vfb_drawable            ;# Private. 
  261.     APTR        vfb_li                  ;# -""-
  262.     ULONG       vfb_Users               ;# Numbers of clients.
  263.     STRUCT      vfb_Lock,SS_SIZE        ;# Semaphore for mutual exclusion.
  264.     LABEL       vfb_SIZEOF
  265.  
  266.  
  267.  
  268. ;**********************
  269. ;# Vector Text stuff. *
  270. ;**********************
  271.  
  272.  STRUCTURE TextVAttr,0
  273.     APTR    tva_Name            ;# The name of the desired class or Bitmap font. 
  274.     STRUCT  tva_VectorFont,0    ;# TRUE if vector font. 
  275.     UWORD   tva_YSize           ;# The height. 
  276.     UBYTE   tva_Style           ;# The desired style. 
  277.     UBYTE   tva_Flags           ;# Flags. 
  278.     APTR    tva_FontName        ;# The vector font name. 
  279.     UWORD   tva_XSize           ;# Horizontal size. 
  280.     UWORD   tva_VFlags          ;# Flags for vector fonts. 
  281.     APTR    tva_Type            ;# Indicates the storage format. 
  282.     LABEL   tva_SIZEOF
  283.  
  284.  STRUCTURE VectorText,0
  285.     UBYTE   vt_FrontPen, BackPen 
  286.     UBYTE   vt_DrawMode 
  287.     WORD    vt_LeftEdge, TopEdge 
  288.     APTR    vt_VFontAttr 
  289.     APTR    vt_Text 
  290.     APTR    vt_Next 
  291.     LABEL   vt_SIZEOF
  292.  
  293.  
  294.  ENDC
  295.