Fixed missing fprintf argument.
[AROS.git] / rom / graphics / remfont.c
blobd8fc8f396f41b9198677024dfcae3d7ae4bf861c
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Remove a font from the list of public available fonts.
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include <proto/exec.h>
12 /*****************************************************************************
14 NAME */
15 #include <graphics/text.h>
16 #include <proto/graphics.h>
18 AROS_LH1(void, RemFont,
20 /* SYNOPSIS */
21 AROS_LHA(struct TextFont *, textFont, A1),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 81, Graphics)
26 /* FUNCTION
27 Remove a font from the list of public available fonts. Afterwards,
28 you can close it.
30 INPUTS
31 textFont - Remove this font.
33 RESULT
34 None.
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 OpenFont(), CloseFont(), SetFont(), AddFont()
45 INTERNALS
47 HISTORY
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
52 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
54 struct TextFontExtension *tfe;
55 BOOL can_remove = TRUE;
57 ASSERT_VALID_PTR(textFont);
59 Forbid();
60 tfe = (struct TextFontExtension *)textFont->tf_Extension;
61 if (tfe)
63 if ((tfe->tfe_MatchWord == TFE_MATCHWORD) && (tfe->tfe_BackPtr == textFont))
65 if (tfe->tfe_Flags0 & TE0F_NOREMFONT)
67 can_remove = FALSE;
73 if (can_remove)
75 if (!(textFont->tf_Flags & FPF_REMOVED))
77 textFont->tf_Flags |= FPF_REMOVED;
78 Remove (&textFont->tf_Message.mn_Node);
80 #if DEBUG
81 else
83 D(bug("Someone tried to remove font which is already removed!"));
85 #endif
87 StripFont(textFont);
91 Permit();
93 AROS_LIBFUNC_EXIT
95 } /* RemFont */