3 // This source code has been donated to the Public Domain. Do
4 // whatever you want with it.
6 // A module to take care of all of gnash's loaded fonts.
9 #include "gnashconfig.h" // HAVE_ZLIB_H, USE_SWFTREE
14 #include "DefineShapeTag.h"
15 #include "LineStyle.h"
16 #include "movie_definition.h"
18 // Define to the name of a default font.
19 #define DEFAULT_FONT_NAME "_sans"
25 std::vector
< boost::intrusive_ptr
<Font
> > s_fonts
;
26 boost::intrusive_ptr
<Font
> _defaultFont
;
41 boost::intrusive_ptr
<Font
>
44 if ( _defaultFont
) return _defaultFont
;
45 _defaultFont
= new Font(DEFAULT_FONT_NAME
);
50 get_font(const std::string
& name
, bool bold
, bool italic
)
52 // Dumb linear search.
53 for (auto& font
: s_fonts
)
56 if ( font
->matches(name
, bold
, italic
) )
61 Font
* f
= new Font(name
, bold
, italic
);
71 // Make sure font isn't already in the list.
72 for (auto& font
: s_fonts
)
83 } // end namespace fontlib
84 } // end namespace gnash
91 // indent-tabs-mode: t