Welcome, Guest
Username: Password: Remember me
Components and Libraries for Reports Development, discussions, problems and suggestions
  • Page:
  • 1
  • 2

TOPIC:

Missing Font "Arial" CT 6.8 5 years 2 months ago #13815

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Hi All,


After trying to make this work for days I found out the component I was using maybe wasn't the right one.
So I switched it to tfpjsonReport now I can preview the report in design time, during runtime it gives me that message.
I am attaching the source code.

fprPersonListing.LoadFromFile(ExtractFilePath(ParamStr(0)) + '\Reports\PersonListing.json');
fprPersonListing.RunReport;
fprPersonListing.RenderReport(fprPreview);

Thanks in advance,

Jose.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 2 months ago #13817

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
If that helps I am using Windows 10 and the Arial font is not missing.
Any ideas?
I don't want to give up on CT, but I am getting to the point where it's too much time wasted.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 2 months ago #13818

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
please, your attach file ?
only the source, please.

Did you try and CT 6.9 ?
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Missing Font "Arial" CT 6.8 5 years 2 months ago #13819

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I will install CT 6.9 and try then.
Then, if it does not work. I'll post the source here.

Thanks.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 2 months ago #13820

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
CT 6.9, same error.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 2 months ago #13821

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Try this
go to
C:\codetyphon\CodeOcean\pl_FontEngine\samples\xmedia\
and copy arial.ttf to your app folder
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13823

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Putting Arial.ttf in the project folder does not help.

I spent a couple of days digging.
In the FPReport source code I found out that for some reason this is not working:

lFC := gTTFontCache.FindFont(Font.Name); ===>>>> Font.Name in this case is 'Arial'
if not Assigned(lFC) then ====>>>> IFC is nil here, so the above line does not return the font object
raise EReportFontNotFound.CreateFmt(SErrFontNotFound, [Font.Name]);


This is a problem with the code in fpTTF that might be related with Windows 10. I wonder if there's an update to this function.
This is located in: \codetyphon\fpc\fpc64\units\x86_64-win64\fcl-pdf
Unfortunately I can't keep digging.

Thanks,

Jose.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13824

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Thanks Sir
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13825

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I created a program to get the list of fonts in the fpTTF class.
That should help since all fonts are listed there, but still fpReport can't fint it on the list.
I hope this helps, I am still a noobie here.
Attachments:

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13826

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
I think we found the problem
please, go to

C:\codetyphon\typhon\components\lz_FpReport\source\base\fpreportpdfexport.pp

replace line 126
fnt := gTTFontCache.Find(AFontName); // we are doing a PostScript Name lookup (it contains Bold, Italic info)
with
fnt := gTTFontCache.FindFont(AFontName); //=== ct9999 ======

and the same...

C:\codetyphon\typhon\components\lz_FpReport\source\base\fpreportfpimageexport.pp

replace line 199
fnt := gTTFontCache.Find(AFontName); // we are doing a PostScript Name lookup (it contains Bold, Italic info)
with
fnt := gTTFontCache.FindFont(AFontName); //=== ct9999 ====
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13827

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Same error, I am getting the error on fpreport.pp.
I am attaching the images.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13828

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
1) Put fixes above in FpReport source.

2) copy C:\codetyphon\CodeOcean\pl_FontEngine\samples\xmedia\arial.ttf
to your FpReport font folder

We get the same with error with you, without arial.ttf



with arial.ttf in FpReport font folder, ALL OK




The above CodeOcean sample project is:
C:\codetyphon\CodeOcean\lz_FpReport\samples\demos\fcldemo.ctpr
PilotLogic Architect and Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13829

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I still get the same error.


Attachments:

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13830

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I tried running that project,. fcldemo, but nothing happens.
It compiles, but that's it.

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13831

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
It's NOT GUI app.
Look at fcldemo.ctpr out directory
C:\codetyphon\CodeOcean\lz_FpReport\samples\xbin\

fcldemo app build fpreportdemo-grouping2.pdf


PilotLogic Architect and Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13832

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Yes, the report is there.
It's a wonder why it does not work in an application.
Folder issues maybe?

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13834

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Maybe,
without your app full source we can't give you more help

FpReport it's a new package and maybe has problems.
We try to fix all problems but .... :huh:
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13838

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
I used the Address Book sample to duplicate the problem.
I am attaching the whole project.
Attachments:

Please Log in or Create an account to join the conversation.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13839

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
A) Solution A

-First of All
make a folder "fonts" into your addrbook app
copy to new "fonts" folder arial.ttf from CodeOcean Samples

-In Report1.json Line 89 replace "Arial-BoldMT" with "Arial"

-In your main app unit frmmain
add to uses fpTTF unit

uses
  SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Dbf, Grids, DBGrids, DBCtrls, ExtCtrls, ActnList, Menus,
  StdCtrls, Buttons, fpjsonreport, fpreportdb, fpreportformexport,
  fpTTF,    //<<<<==== ct9999 ====
  FPReport;

and 2 lines at
procedure TMainForm.btPrintClick(Sender: TObject);
begin
                                               
  gTTFontCache.SearchPath.Add('fonts/'); //<<<== ct9999 ==============
  gTTFontCache.BuildFontCache;              //<<<== ct9999 ==============

  FPJSONReport1.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'Report1.json');
  FPJSONReport1.RunReport;
  FPJSONReport1.RenderReport(FPExport);
end;

gTTFontCache is Variable in fpTTF.pp

I think now you can continue by your self... :)


PilotLogic Architect and Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Missing Font "Arial" CT 6.8 5 years 1 month ago #13840

  • Jose Ceravolo
  • Jose Ceravolo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Excellent!!!

I changed it a bit.
I added LCLIntf to the uses clause and changed the lines to update the font cache to:
gTTFontCache.SearchPath.Add(GetEnvironmentVariable('WINDIR') + '\Fonts\');
gTTFontCache.BuildFontCache;

This way all fonts in windows work.

Thanks for your help!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2