Page 1 of 1

TRichView 22.0 - RAD Studio 12 and Skia

Posted: Thu Nov 23, 2023 8:37 am
by Sergey Tkachenko
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.

Previous version
https://www.trichview.com/forums/viewtopic.php?t=12182

RAD Studio 12

Posted: Thu Nov 23, 2023 8:39 am
by Sergey Tkachenko
RAD Studio 12

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.
  • A 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

Re: TRichView 22.0 - RAD Studio 12 and Skia

Posted: Thu Nov 23, 2023 8:43 am
by Sergey Tkachenko
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.
TRichView-Skia-SVG.png
TRichView-Skia-SVG.png (99.15 KiB) Viewed 78737 times

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

Posted: Thu Nov 23, 2023 8:44 am
by Sergey Tkachenko
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

Posted: Thu Nov 23, 2023 8:45 am
by Sergey Tkachenko
Other changes

Graphics

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.

What's next

Posted: Thu Nov 23, 2023 8:46 am
by Sergey Tkachenko
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.)

TRichView 22.0.1

Posted: Mon Nov 27, 2023 7:48 pm
by Sergey Tkachenko
TRichView 22.0.1

A minor update.
A workaround for FMXLinux 1.75 problem is removed. TRichView FireMonkey trial version is recompiled with FMXLinux v1.76.
A critical bug with TRVMemoryStream in 64-bit platforms in Delphi12 is fixed.

TRichView 22.1

Posted: Sun Dec 03, 2023 3:18 pm
by Sergey Tkachenko
TRichView 22.1

This update includes important fixes and a support of <svg> tag in HTML loading (i.e., of SVG images embedded directly in HTML code).

Requirements for SVG images:
  • FireMonkey: Skia4Delphi
  • VCL: Skia4Delphi or third-party graphic classes
  • Lazarus: third-party graphic classes

TRichView 22.2

Posted: Sun Jan 28, 2024 4:50 pm
by Sergey Tkachenko
TRichView 22.2

Main changes in this version:
  • ability to use Markdown in data-aware components and in LiveBindings
  • ability to specify text code page in all methods and components that load/save text and Markdown
  • more properties controlling saving and loading Markdown and text to/from DB
Additionally, this update includes several fixes and tweaks for file saving and loading operations.
Changes were made to compile in Lazarus 3.0 without warnings and hints.