Version 11.2 of ScroogeXHTML for Object Pascal, the RTF to HTML5 and XHTML converter for Delphi and Free Pascal, is now available. It can convert nested tables into real tables inside table cells and match font names as a whole, and it takes about 40% less time. No default changes: existing applications get the same output for valid RTF until they switch the new options on.
New
- Nested tables: with the new option
OptionsTable.ConvertNestedTables, a table inside a table cell becomes a table inside the HTML cell, instead of tab-separated text. When table widths are in percent, a nested table’s width is relative to its cell. The option is off by default in 11.2 and is planned to be on by default in 12.0. The Java product converts nested tables the same way. - Whole-name font matching: with the new property
FontNameMatching := fnmExact, a font replacement rule matches the whole font name, ignoring case, and the first matching rule wins. So Arial Unicode MS and Arial Narrow are no longer written as Arial, and Japanese text in Arial Unicode MS keeps a font that has its glyphs. A rule name ending in*still matches by prefix. The default,fnmPrefix, keeps the 11.1 behaviour;fnmExactis planned to become the default in 12.0. - Faster conversion: RTF keywords are looked up in a dictionary instead of a linear table scan, which takes about 40% less time over our sample RTFs. The output is unchanged.
Fixed
- Malformed colour indexes: a colour index above 2147483647 in
\cf,\cb,\highlightor\cbpatwrapped around to a valid colour. It is now out of range, so the text gets no colour, andStrictModeraisesESxConversionError.
Please note
- With nested tables on, a table cell can hold tables as well as paragraphs. A post-process listener that walks the output has to expect that;
MIGRATING.mdexplains it. - The default font replacement list has two more rules, Courier New and Times New Roman. They change no output with the default
fnmPrefix, but code that reads the default list by index, or expects four entries, now sees six. - Compiler support is unchanged: Delphi 2009 and later, Free Pascal 3.2 and later (tested with Delphi 2009 and Free Pascal 3.2.2).
The release notes are at https://www.habarisoft.com/scroogexhtml/11.2/docs/api/version.html#s11_2, and the migration notes at https://www.habarisoft.com/scroogexhtml/11.2/docs/MIGRATING.md.
How to get it: registered users can download version 11.2 from the usual download area now. The product page https://www.scroogexhtml.com/object_pascal.html has a free demo, the Getting Started guide and the API documentation.