Candera 3.10

Spark engine support

Support for Monotype's lightweight font engine geared towards lower end devices has been added. This engine will require the third-party provisions from Monotype to function properly. The Spark engine can be selected using a CMake flag after choosing Monotype as your font engine. Further information regarding this process be found in this documentation.

Updated and extended RICOH fonts

Updated and extended RICOH fonts have been provided by RICOH for CGI Studio 3.10.

  • Japanese (HGSHeiseiMarugothictaiW4)
  • Simplified Chinese (HGJHeiM Simplified)
  • Arabic (HG RTSans Arabic)
  • Korean (HGNewGothicM Korean)
  • Thai (Five typefaces)
  • Vietnam (Five typefaces)

Support of colorized glyphs

The CGI Studio TextEngine and its integration of Monotype's iType library now supports colored bitmaps from the CBDT table of truetype/opentype fonts. The freetype integration does not support this yet.

Scope of the new functionality:
  • Monotype must be configured as font engine (see CMake configuration below)
  • TextNode2D must be used (not supported with CanvasText, not supported by deprecated TextEffect)
  • TextNode2D has 2 renderers available when using Monotype: Bitmap and GlyphAtlas. The option "Bitmap" must be used.
  • Colored glyph bitmaps are taken from the font file as they are. No scaling is applied. Matching different font sizes must be achieved by adding different sized glyph bitmaps to the font file.
  • Text color is always applied as color multiplication. Therefore the colored bitmaps are colorized with the text color. Only white text color preserves the original image colors.
CMake configuration
  • Choose "Monotype" for CANDERA_FONTENGINE
  • Turn on new flag CANDERA_TEXTENGINE_COLORBITMAP_ENABLED

The third party library "lodepng" has been added to decode images in PNG format. It was added to the cgi_studio_3psw folder, and its path is set to the CMake variable CGISTUDIO_LODEPNG_INCLUDE_PATH. The third party library "lodepng" is licensed under "zlib License".

Cache

It is possible to change the cache size of the maximum cached colored bitmap elements. The macro is defined as: CANDERA_TEXTENGINE_COLORBITMAP_CACHE_ELEMENT_COUNT - default value: 20 It can be changed by e.g. compiler flag (-D... or cmake add_definitions). Alternatively, it can also be added to the generated config headers directly.

Notes

The colored glyphs will use a 32 bit per pixel RGBA format, while regular glyphs use an 8 bit per pixel alpha format. As soon as a text contains one or more colored glyphs, the bitmap generated by TextNode2D is in RGBA format. This means that the bitmaps generated for such TextNode2D instances require 4 times more memory compared to TextNode2D instances without colored glyphs. The colored glyphs are cached internally by the TextEngine in RGBA format. This cache also contributes to an increased memory consumption.




Revision #3
Created 2023-03-01 05:33:12 UTC by Kanai Tomoaki
Updated 2023-06-13 10:09:26 UTC by Kanai Tomoaki