14.1 Overview

Plugins that have the capability flag HWPLUG_CAPS_FONT set will be called whenever Hollywood opens a font. The plugin can check then whether the font is in a format that the plugin recognizes and if it is, it can open the font and take over the handling. This makes it possible to load custom font formats with Hollywood.

Font plugins aren't limited to providing loaders for new font formats but they can also take over Hollywood's text engine completely by providing their own layout mechanism. This is done by setting the HWFONTFLAGS_LAYOUT flag in the plugin's LoadFont() implementation. By default, Hollywood's font layouter is used also for fonts loaded by plugins which means that Hollywood will take care of handling word-wrapping, kerning, justification, alignment, text formatting codes and so on. This means that your plugin just needs to deliver the glyph extents and bitmaps and Hollywood will do the rest. If your plugin wants to do its own layouting, though, it can set the HWFONTFLAGS_LAYOUT flag. In that case, Hollywood's layouter won't be used at all and your plugin can process the text layout on its own.

By default, font plugins are automatically activated when Hollywood loads them. This behaviour can be changed by setting the HWEXT_FONT_NOAUTOINIT extension bit. If this bit is set, Hollywood will not automatically activate your plugin at load time. Instead, you will have to manually call hw_AddLoaderAdapter() to activate your plugin. For example, you could call hw_AddLoaderAdapter() from your RequirePlugin() implementation. In that case, the font plugin would only be activated if the user called @REQUIRE on it. If you do not call hw_AddLoaderAdapter() on a plugin that has auto-initialization disabled, it will only be available if the user addresses it directly through the Loader tag. See Extension plugins to learn how to use plugin extension bits.

This plugin type is supported since Hollywood 10.0.


Show TOC