View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038123 | Lazarus | Packages | public | 2020-11-24 09:47 | 2020-11-27 15:03 |
Reporter | virgo | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 2.0.10 | ||||
Summary | 0038123: fpReport TFPReportExportCanvas does not translate ps font names to font families for TFont | ||||
Description | When font design uses bold font, then Lazarus preview window is not showing it as bold. Reason is, that TFPReportExportCanvas.GetFont assignes original report font name (which is PS font name Arial-BoldMT to TFont.Name. I added fpTTF to implementation uses of fpreportlclexport unit and changed TFPReportExportCanvas.GetFont to: Var ftFont : TFont; CI : TFPFontCacheItem; begin Result:=Nil; Result:=TFont(FFonts.Items[AFontName]); If (Result=Nil) then begin ftFont:=TFont.create; CI:=gTTFontCache.Find(AFontName); if CI <> nil then ftFont.Name:=CI.FamilyName else ftFont.Name:=AFontName; ftFont.Bold := CI.IsBold; ftFont.Italic := CI.IsItalic; Result:=ftFont; FFonts.Add(AFontName,Result); end; end; | ||||
Steps To Reproduce | Design report with Bold font, preview it with TFPreportPreviewExport using TFPReportPreviewForm as DefaultPreviewFormClass. | ||||
Additional Information | It probably means, that all fonts are replaced with default font. Because even standard font is Arial-MT, not Arial, that is expected by TFont. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | |||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
|
correction: original version would result in Access Violation, when font is not found in gTTFontCache. Var ftFont : TFont; CI : TFPFontCacheItem; begin Result:=Nil; Result:=TFont(FFonts.Items[AFontName]); If (Result=Nil) then begin ftFont:=TFont.create; CI:=gTTFontCache.Find(AFontName); if CI <> nil then begin ftFont.Name:=CI.FamilyName; ftFont.Bold := CI.IsBold; ftFont.Italic := CI.IsItalic; end else ftFont.Name:=AFontName; Result:=ftFont; FFonts.Add(AFontName,Result); end; end; |
|
Issue was also in report designer and this fixed it for that too. |