2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Graphics function OpenFont()
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include <graphics/text.h>
14 /*****************************************************************************
17 #include <graphics/text.h>
18 #include <proto/graphics.h>
20 AROS_LH1(struct TextFont
*, OpenFont
,
23 AROS_LHA(struct TextAttr
*, textAttr
, A0
),
26 struct GfxBase
*, GfxBase
, 12, Graphics
)
45 29-10-95 digulla automatically created from
46 graphics_lib.fd and clib/graphics_protos.h
48 *****************************************************************************/
51 AROS_LIBBASE_EXT_DECL(struct GfxBase
*,GfxBase
)
53 struct TextFont
*tf
, *best_so_far
= NULL
;
56 ASSERT_VALID_PTR(textAttr
);
58 if (!textAttr
->ta_Name
) return NULL
;
60 /* Search for font in the fontlist */
62 ForeachNode(&GfxBase
->TextFonts
, tf
)
64 if (0 == strcmp(tf
->tf_Message
.mn_Node
.ln_Name
, textAttr
->ta_Name
))
67 struct TagItem
*tags
= NULL
;
68 struct TextAttr match_ta
=
70 tf
->tf_Message
.mn_Node
.ln_Name
,
76 if (ExtendFont(tf
, NULL
))
78 tags
= ((struct TextFontExtension
*)tf
->tf_Extension
)->tfe_Tags
;
81 match
= WeighTAMatch(textAttr
, &match_ta
, tags
);
82 if (match
> bestmatch
)
90 if (best_so_far
) best_so_far
->tf_Accessors
++;