View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0038899||Packages||TAChart||public||2021-05-16 11:12||2021-05-16 22:55|
|Reporter||Johannes W. Dietrich||Assigned To||wp|
|Summary||0038899: Saving a chart as SVG crashes|
|Description||An app using TAChart crashes or creates an incomplete (and unusable) file when saving the chart as SVG. Bevor crashing, it displays an error message stating that it doesn't find the font "default". This applies to both the Carbon and the Cocoa widgetset and to both 32-bit and 64-bit processors.|
|Steps To Reproduce||The error can be reproduced with the "save" demo project that comes with TAChart in Lazarus.|
|Tags||fonts, MacOS, SVG, TAChart|
|Fixed in Revision|
This issue has been discussed in the forum (https://forum.lazarus.freepascal.org/index.php/topic,45461.msg321532.html). The solution was (presented by yourself) to add IFDEFs for carbon and cocoa defining the default font directiories on macOS:
in procedure PopulatefontDirList in unit tafonts add:
This has been fixed in Laz-trunk (but was not back-ported to v2.0.12).
||Thanks, but this seems to be a partial solution only. After amending the PopulatefontDirList procedure, the Cocoa version of the app still hangs and has to be killed. The carbon version is able to produce a valid SVG file, but it delivers four consecutive error messages that it cannot create a font instance, see screenshot.|
OK, the apps work outside the IDE now. This is an old , but still not fully resolved issue, as discussed at https://forum.lazarus.freepascal.org/index.php/topic,45461 and https://forum.lazarus.freepascal.org/index.php/topic,54623.
> This is an old , but still not fully resolved issue
You mean the exception raised in case of a faulty font file? Well, there's no way I can fix the faulty file. But there is the new EFreeType exception which you can put on the list of ignored exceptions of your application(s), and the exception will no longer interrupt working in the IDE (outside the IDE, the exception will be handled silently anyway). (see https://forum.lazarus.freepascal.org/index.php/topic,45461.msg321564.html#msg321564).
> that it cannot create a font instance
Can you find out which font is it that is creating the issue? Can you upload the font file for me to have a look? Maybe it's the same issue as in the old forum post.
Does the issue happen in the InitFonts procedure? Or does it happen during painting the chart? You can add a custom option -gw2 in "Additions and overrides" which allows you to debug into the TAChart units.
|2021-05-16 11:12||Johannes W. Dietrich||New Issue|
|2021-05-16 11:12||Johannes W. Dietrich||Status||new => assigned|
|2021-05-16 11:12||Johannes W. Dietrich||Assigned To||=> Alexander S. Klenin|
|2021-05-16 11:12||Johannes W. Dietrich||File Added: TAChart_SVG_Error_macOS.png|
|2021-05-16 11:14||Johannes W. Dietrich||Tag Attached: TAChart|
|2021-05-16 11:14||Johannes W. Dietrich||Tag Attached: SVG|
|2021-05-16 11:14||Johannes W. Dietrich||Tag Attached: MacOS|
|2021-05-16 11:14||Johannes W. Dietrich||Tag Attached: fonts|
|2021-05-16 13:36||wp||Assigned To||Alexander S. Klenin => wp|
|2021-05-16 13:52||wp||Note Added: 0130918|
|2021-05-16 13:53||wp||Status||assigned => feedback|
|2021-05-16 13:53||wp||LazTarget||=> -|
|2021-05-16 13:53||wp||Note Edited: 0130918||View Revisions|
|2021-05-16 22:24||Johannes W. Dietrich||Note Added: 0130923|
|2021-05-16 22:24||Johannes W. Dietrich||File Added: TAChart_SVG_Error_macOS_2.png|
|2021-05-16 22:24||Johannes W. Dietrich||Status||feedback => assigned|
|2021-05-16 22:30||Johannes W. Dietrich||Note Added: 0130924|
|2021-05-16 22:32||Johannes W. Dietrich||Note Edited: 0130924||View Revisions|
|2021-05-16 22:46||wp||Note Added: 0130925|
|2021-05-16 22:51||wp||Note Edited: 0130925||View Revisions|
|2021-05-16 22:55||wp||Note Edited: 0130925||View Revisions|