TRichView 22.0 – RAD Studio 12 and Skia

We have released TRichView 22 and related updates of all TRichView add-ons (including RichViewActions, ScaleRichView, and ReportWorkshop).

Main changes in this version:

  • support of Delphi and C++Builder 12
  • support of Skia4Delphi

A trial version can be download here: https://www.trichview.com/download/

This update is free for customers who ordered TRichView (ScaleRichView, ReportWorkshop) in 2022 and 2023.

RAD Studio 12 Athens

TRichView (and add-ons) supports Delphi and C++Builder 12 Athens.

The most noticeable changes (apart from Skia) are changes in FireMonkey Android platform supported by TRichView:

  • Keyboard input is completely rewritten.
    Instead of using IME, Delphi 12 uses keyboard events (but replacements suggested by a virtual keyboard are still supported).
    This is a very important change for TRichView, because you can use OnKeyDown and OnKeyPress events in Android (for example, to detect URLs on typing), like in all other platforms.
  • The default position of touchscreen selection handles is changed for Android.
    They are displayed below the selection bounds, which is normally expected by Android users.
  • A new selection handle to set the caret position.
  • magnifying glass is shown to help selecting or setting the caret position.

Setting the caret position. You can see a magnifying glass and a special caret positioning handle

Selecting text. You can see how the selection handles are positioned, and a magnifying glass

Skia4Delphi

Skia is a cross-platform Google’s graphic library.
Skia4Delphi allows using Skia in Delphi, starting from Delphi XE7.
Skia4Delphi is included in RAD Studio 12 by default. For older versions of Delphi, you can download it from GetIt package manager, or, better, from https://github.com/skia4delphi/skia4delphi/releases (v6.0.0 is needed for TRichView)

Skia4Delphi in FireMonkey

To use Skia4Delphi features with TRichView, include fmxRVSkiaFM unit in your project.

1. Better canvases

Skia4Delphi implements its own canvases for all platforms. These canvases usually work faster and provide better drawing quality than the standard FireMonkey canvases (especially on mobile platforms). TRichView 22 supports Skia4Delphi canvases. No special code is needed, just add fmxRVSkiaFM unit in your project.

2. SVG graphics

SVG (Scalable Vector Graphics) is an XML-based vector image format.
Previously, TRichView for FireMonkey supported only raster images. TRVGraphic (that was also available as TRVBitmap) was a wrapper for FireMonkey’s TBitmap.
In this version, TRVGraphic is an abstract class , the actual graphic classes are inherited from it:

  • TRVRasterGraphicFM (also available as TRVBitmap) – wrapper for TBitmap
  • TRVSvgImageSkiaFM – uses Skia4Delphi to draw SVG images.

Note: previously, to get a filter string for an image insertion dialog, you could use TBitmapCodecManager.GetFilterString.
Since TRichView 12, I recommend to use RVGraphicHandler.GetFileDialogFilter instead. It includes all formats supported by TBitmapCodecManager, and also additional formats (like SVG), if they are available.

3. More graphic formats

Skia4Delphi adds support for additional raster graphic formats, including WebP.
WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression and alpha transparency.
With Skia4Delphi, you can use WebP images in TRichView documents.

4. PDF saving

Two new methods were added: TRVPrint.SavePDF and TRVReportHelper.SavePDF.
While these methods were added for all versions of TRichView, they work only if PDF saving engine is available. You can check it by calling CanSavePDF method.
Currently, PDF saving by these methods is implemented only in FireMonkey + Skia4Delphi.
This is a basic saving. Creating PDF bookmarks, links and outlines is not possible.

Skia4Delphi in VCL

In VCL version, Skia4Delphi adds graphic classes supporting SVG, WebP, and WBMP formats.
Unfortunately, these classes are hidden in the implementation section, so the only use of these classes is loading graphic from files via TPicture (recognizing format by the file extension). In the new version of Delphi, these classes can be used to load WebP and WBMP from streams (detecting format by content).

To allow loading SVG from streams, add RVSkia unit to your project. This unit uses a trick to get SVG graphic class and allows using it as SVG format in TRichView (together with our own function that recognizes a graphic format by content). It is very important, otherwise SVG images embedded in RVF, DocX, HTML or Markdown files cannot be loaded (only external pictures).

Other changes

New formats are added in TRVGraphicType: JPEG XR and WebP.

WebP is available in FireMonkey and VCL with Skia4Delphi.
JPEG XR (also known as HD Photo and Windows Media Photo; file extensions: HDP, JXR, WDP) is available in FireMonkey for Windows.

Several functions of RVGraphicHandler were improved:
– the functions that recognize a graphic format by content support WebP and JPEG XR;
– the functions that choose which graphic class to use to save and load the specific file format.

Plans

Plans for future related to Skia4Delphi:

  • to implement insertion of animated webp images (+ animated gifs in FireMonkey)
  • in FireMonkey, drawing text using Skia functions directly, without intermediate TTextLayot, to improve performance and to allow using additional Skia features
  • adding effects to text (like shadows, outlines, gradients, etc.)
Share this article

2 thoughts on “TRichView 22.0 – RAD Studio 12 and Skia”

  1. A minor update has been released: TRichView 22.0.1.
    It fixes a problem with 64-bit applications compiled with Delphi 12.
    FMXLinux 1.76 is recommended for Linux FireMonkey version.

  2. Sergey Tkachenko

    TRichView is updated to version 22.1
    This update includes fixed and a support of <svg> tag in HTML import (i.e., of SVG images inserted directly in HTML code)

Comments are closed.