Skip to Content
Amiga Assembly Library v41.21 — Motorola 68020 shared library for Commodore Amiga
DocumentationGraphicsTextFmtSizeArgs

TextFmtSizeArgs

Synopsis

TextFmtSizeArgs(rp, ibox, TextFmt, ArgList) A1 A3 A0 A2

C Prototype

void TextFmtSizeArgs(struct RastPort *rp, struct IBox *ibox, STRPTR TextFmt, APTR args);

Varargs stub:

void TextFmtSize(struct RastPort *rp, struct IBox *ibox, STRPTR TextFmt, ...);

Description

Determines the area occupied by the formatted text TextFmt in the given RastPort. The results are written into an IBox structure, describing the width and height in pixels of the text, using (0, 0) as the LeftEdge and TopEdge coordinates. The first two WORDs of the IBox structure are always zeroed; you simply need to add ibox_Width and ibox_Height to your initial coordinates.

Inputs

  • rp — Address of the same RastPort where the text will be printed.
  • ibox — Address of an IBox structure.
  • TextFmt — Address of a C-style format string.
  • ArgList — Array of arguments for the format commands.

Result

The IBox structure passed in the inputs is filled as follows:

  • ibox_Left = NULL
  • ibox_Top = NULL
  • ibox_Width = width of the text, in pixels.
  • ibox_Height = height of the text, in pixels.

See Also

  • TextFmtRastPortArgs
  • graphics.library/TextExtent(), TextFit(), TextLength()
  • graphics/text.h, graphics/rastport.h
  • intuition/intuition.h

Implementation

The original 68020 assembly implementation:

; (07-Jan-1995) --- TextFmtSizeArgs(rp, ibox, TextFmt, ArgList) (a0,a3,a0,a2) _LVOTextFmtSizeArgs movem.l a2-a3,-(sp) moveq #0,d0 moveq #0,d1 moveq #0,d2 move.w #TEXTF_PRIVATE,d2 ; Set Private Flags Result bsr.s _LVOTextFmtRastPortArgs moveq #0,d0 movem.l d0-d1,(a3) move.l a6,a3 ; Free the memory from the formatted move.l ab_ExecBase(a6),a6 ; and allocated text. move.l -(a1),d0 jsr _LVOFreeMem(a6) move.l a3,a6 movem.l (sp)+,a2-a3 rts
Last updated on