FontExtent:
   movem.l  d2-d6/a2-a6,-(sp)
   move.l   a0,a2
   move.l   a1,a6
   move.w   #-32767,a1
   move.w   #32767,d4
   clr.w d2
   clr.w d3
   clr.l d0
   move.b   (33,a2),d0
   clr.l d1
   move.b   (32,a2),d1
   sub.l d1,d0
   bmi   .L4
   move.l   (48,a2),d6
   clr.l d5
   clr.l d1
   even
.L6:
   sub.l a4,a4
   move.w   d3,a3
   tst.l d6
   beq   .L7
   move.l   d6,a0
   move.w   (a0,a3.l*2),a4
.L7:
   move.w   a4,d0
   cmp.w a4,d4
   bge   .L8
   move.w   d4,d0
.L8:
   move.w   d0,d4
   move.w   a1,a1
   move.l   (40,a2),a0
   clr.l d0
   move.w   (2,a0,a3.l*4),d0
   move.l   d0,a5
   lea   (a5,a4.w),a0
   cmp.l a0,a1
   ble   .L9
   move.l   a1,a0
.L9:
   move.w   a0,a1
   move.l   (44,a2),a0
   tst.l a0
   beq   .L10
   move.w   a4,d0
   add.w (a0,a3.l*2),d0
   bra   .L11
   even
.L10:
   move.w   a4,d0
   add.w (24,a2),d0
.L11:
   btst  #2,(23,a2)
   beq   .L12
   cmp.w d2,d0
   bge   .L5
   bra   .L17
   even
.L12:
   cmp.w d2,d0
   ble   .L5
.L17:
   move.w   d0,d2
.L5:
   addq.w   #1,d3
   move.w   d3,a0
   move.b   (33,a2),d5
   move.b   (32,a2),d1
   move.l   d5,d0
   sub.l d1,d0
   cmp.l a0,d0
   bge   .L6
.L4:
   move.w   d2,(a6)
   move.w   (20,a2),(2,a6)
   move.w   d4,(4,a6)
   subq.w   #1,a1
   move.w   a1,(8,a6)
   move.w   (26,a2),d0
   neg.w d0
   move.w   d0,(6,a6)
   move.w   (20,a2),d0
   sub.w (26,a2),d0
   subq.w   #1,d0
   move.w   d0,(10,a6)
   movem.l  (sp)+,d2-d6/a2-a6
   rts

