Forum
× Components and Libraries for Reports Development, discussions, problems and suggestions

Question Missing Font "Arial" CT 6.8

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 month 1 day ago #13815 by Jose Ceravolo
Missing Font "Arial" CT 6.8 was created by Jose Ceravolo
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.

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 month 23 hours ago #13817 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
1 month 23 hours ago - 1 month 23 hours ago #13818 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
Thanks Sir
please, your attach file ?
only the source, please.

Did you try and CT 6.9 ?

PilotLogic Architect and Core Programmer
Last edit: 1 month 23 hours ago by Sternas Stefanos.

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 month 19 hours ago #13819 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 month 14 hours ago #13820 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
CT 6.9, same error.
Attachments:

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
1 month 13 hours ago #13821 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
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.

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 6 days ago #13823 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 weeks 6 days ago #13824 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
Thanks Sir

PilotLogic Architect and Core Programmer

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 6 days ago #13825 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 weeks 6 days ago - 3 weeks 6 days ago #13826 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
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
Last edit: 3 weeks 6 days ago by Sternas Stefanos.

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 6 days ago #13827 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
Same error, I am getting the error on fpreport.pp.
I am attaching the images.
Attachments:

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 weeks 5 days ago - 3 weeks 5 days ago #13828 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
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:
Last edit: 3 weeks 5 days ago by Sternas Stefanos.

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 5 days ago #13829 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
I still get the same error.


Attachments:

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 5 days ago #13830 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 weeks 5 days ago #13831 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
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.

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 5 days ago #13832 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 weeks 5 days ago - 3 weeks 5 days ago #13834 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
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
Last edit: 3 weeks 5 days ago by Sternas Stefanos.

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 5 days ago #13838 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 weeks 5 days ago - 3 weeks 5 days ago #13839 by Sternas Stefanos
Replied by Sternas Stefanos on topic Missing Font "Arial" CT 6.8
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:
Last edit: 3 weeks 5 days ago by Sternas Stefanos.

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

  • Jose Ceravolo
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 weeks 4 days ago #13840 by Jose Ceravolo
Replied by Jose Ceravolo on topic Missing Font "Arial" CT 6.8
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.