some fixes to accented characters
[tangerine.git] / rom / graphics / stripfont.c
blobb563229470d61db6c2273b4ac6febb7b79d465c5
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function StripFont()
6 Lang: english
7 */
8 #include <proto/graphics.h>
9 #include <proto/exec.h>
10 #include <proto/utility.h>
11 #include <proto/oop.h>
12 #include "graphics_intern.h"
14 /*****************************************************************************
16 NAME */
17 #include <clib/graphics_protos.h>
19 AROS_LH1(void, StripFont,
21 /* SYNOPSIS */
22 AROS_LHA(struct TextFont *, font, A0),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 137, Graphics)
27 /* FUNCTION
28 Removes a TextFontExtension from a font.
30 INPUTS
31 font - font to remove extension from.
33 RESULT
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 ExtendFont()
44 INTERNALS
46 HISTORY
47 27-11-96 digulla automatically created from
48 graphics_lib.fd and clib/graphics_protos.h
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 struct TextFontExtension *tfe;
55 struct tfe_hashnode *hn;
57 /* Valid parameter ? */
58 if (font == NULL)
59 return;
61 /* Does the font have an extension ? */
63 ObtainSemaphore(&PrivGBase(GfxBase)->fontsem);
65 hn = tfe_hashlookup(font, GfxBase);
66 if (NULL != hn)
68 tfe = hn->ext;
70 if (hn->font_bitmap) OOP_DisposeObject(hn->font_bitmap);
71 if (hn->chunky_colorfont) FreeVec(hn->chunky_colorfont);
73 /* Remove the hashitem (tfe_hashdelete() has semaphore protection) */
74 tfe_hashdelete(font, GfxBase);
76 if (NULL != tfe)
78 font->tf_Extension = tfe->tfe_OrigReplyPort;
80 /* Font is not tagged anymore */
81 font->tf_Style &= ~FSF_TAGGED;
83 FreeTagItems(tfe->tfe_Tags);
84 FreeMem(tfe, sizeof (struct TextFontExtension_intern));
89 ReleaseSemaphore(&PrivGBase(GfxBase)->fontsem);
91 return;
93 AROS_LIBFUNC_EXIT
94 } /* StripFont */