Skip to main content

Monotype's Spark Engine

Introduction to Monotype’s Spark engine

The Spark engine is Monotype’s lightweight font engine, with a focus on devices with a limited feature set.

This is a powerful engine with many capabilities able to provide high quality font rasterization and shaping.

However, to support resource constrained devices, certain restrictions have been placed on the font forming.

For more details regarding the types of restrictions in place, please contact Monotype directly.

Integrating the Spark engine

Copy the source package provided by Monotype for the Spark engine to the following location,

  • cgi_studio_3psw/src/Monotype/spark

The final folder’s substructure should be as follows,

  • cgi_studio_3psw/src/Monotype/spark/itypespark
  • cgi_studio_3psw/src/Monotype/spark/shaperspark

Additional content may differ depending on the package received from Monotype.

By completing these steps, the Spark engine has now been integrated into CGI Studio.

Configuring the Spark engine

Configure the following entries within CMake as listed below,

  • Go to the CANDERA group, then change CANDERA_FONTENGINE to Monotype.
    • This setting is necessary as the Spark engine is comprised of the iType Shaper and WorldType Shaper software.
    • After changing this setting, perform a reconfigure to update the available text shaper options based on the newly selected font engine.
  • If you are planning on using a shaper, change CANDERA_TEXTSHAPER to WorldType-Shaper.
    • Perform another reconfigure after updating this entry.
  • To switch to the Spark engine, go to the MONOTYPE group, then enable the MONOTYPE_SPARK_LIGHTENGINE_ENABLED flag.
    • Perform a reconfigure to complete the configuration process.
  • CMake also provides an optional configuration flag, MONOTYPE_SPARK_ENGINE_INSTANCE_COUNT, which can impact both overall performance and memory usage.
    • For improved performance, this flag must be set to the number of fonts concurrently in use within your asset. For example, if your asset contains a total of 50 fonts, but at a maximum only 5 fonts are in simultaneous use, then this flag should be set to 5.
    • However, this flag also creates instances of the engine, including caches. This will in turn lead to more memory usage.
  • After making the stipulated updates, click the Generate button to complete the process.

The version of the Spark engine provided by Monotype must contain the MS_STORE_SOURCE_INDEX feature.

If this feature is not present, some text features may not work as intended, such as truncation.

Which versions of the Spark engine support this feature are listed in the “Versions” text file contained in the following file path: cgi_studio_3psw\src\Monotype\Versions.txt

By integrating the Spark engine into CGI Studio,

  • Basic support for text shaping using the Spark engine will be available.
  • FontMaps are currently supported at this time.
  • Supported glyph caching methods are provided by the iType Shaper.
    • Bitmap and GlyphAtlas are supported.
  • MI_SYNC_MODE is currently not supported.

Updating the Spark engine configuration files

The following configuration flag must be present within the shaper’s configuration file (msconfig.h),

#define MS_STORE_SOURCE_INDEX

If this flag is not present, a warning message will be shown requesting that this flag be set.

General limitations

As a result of the Spark engine containing a minimal set of features, many optional features are not available. Some of these features include,

  • Handling different type faces.
  • Retrieving font style names.
  • Family name inside the font.
  • Complex runtime hint flags.
  • Complex shaping flags (for example, turning on or off different ligature features).
  • OpenType is not supported. Please contact Monotype for support converting fonts into equivalent internal table structures.

Another limitation arises when importing a Photoshop files using the Smart Importer or Import from Photoshop option. Due to a difference in how text positioning is calculated within the Spark engine and Photoshop, the positioning of the text within CGI Studio may differ from the original Photoshop file.