View Issue Details

IDProjectCategoryView StatusLast Update
0038899PackagesTAChartpublic2021-05-16 22:55
ReporterJohannes W. Dietrich Assigned Towp  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformMacintoshOSmacOS 
Product Version2.0.12 
Summary0038899: Saving a chart as SVG crashes
DescriptionAn 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 ReproduceThe error can be reproduced with the "save" demo project that comes with TAChart in Lazarus.
Tagsfonts, MacOS, SVG, TAChart
Fixed in Revision
LazTarget-
WidgetsetCarbon, Cocoa
Attached Files

Activities

Johannes W. Dietrich

2021-05-16 11:12

reporter  

TAChart_SVG_Error_macOS.png (43,398 bytes)   
TAChart_SVG_Error_macOS.png (43,398 bytes)   

wp

2021-05-16 13:52

developer   ~0130918

Last edited: 2021-05-16 13:53

View 2 revisions

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:

{$IFDEF LCLCarbon}
  AList.Add('/Library/Fonts/');
  AList.Add('/System/Library/Fonts/');
  AList.Add('/Network/Library/Fonts/');
  AList.Add('~/Library/Fonts/');
 {$ENDIF}
 {$IFDEF LCLCocoa}
  AList.Add('/Library/Fonts/');
  AList.Add('/System/Library/Fonts/');
  AList.Add('/Network/Library/Fonts/');
  AList.Add('~/Library/Fonts/');
 {$ENDIF}

This has been fixed in Laz-trunk (but was not back-ported to v2.0.12).

Johannes W. Dietrich

2021-05-16 22:24

reporter   ~0130923

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.
TAChart_SVG_Error_macOS_2.png (37,867 bytes)   
TAChart_SVG_Error_macOS_2.png (37,867 bytes)   

Johannes W. Dietrich

2021-05-16 22:30

reporter   ~0130924

Last edited: 2021-05-16 22:32

View 2 revisions

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.

wp

2021-05-16 22:46

developer   ~0130925

Last edited: 2021-05-16 22:55

View 3 revisions

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

Issue History

Date Modified Username Field Change
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