- Posts: 25
- Thank you received: 0
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- Reports Development
- Missing Font "Arial" CT 6.8
Question Missing Font "Arial" CT 6.8
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
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 Member
-
- Posts: 25
- Thank you received: 0
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
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
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.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
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 Member
-
- Posts: 25
- Thank you received: 0
Attachments:
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
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 Member
-
- Posts: 25
- Thank you received: 0
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
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
PilotLogic Architect and Core Programmer
Please Log in or Create an account to join the conversation.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
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
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
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)
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)
fnt := gTTFontCache.FindFont(AFontName); //=== ct9999 ====
PilotLogic Architect and Core Programmer
Please Log in or Create an account to join the conversation.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
I am attaching the images.
Attachments:
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
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.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
Attachments:
Please Log in or Create an account to join the conversation.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
It compiles, but that's it.
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
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 Member
-
- Posts: 25
- Thank you received: 0
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
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
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 ....

PilotLogic Architect and Core Programmer
Please Log in or Create an account to join the conversation.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
I am attaching the whole project.
Attachments:
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
-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.
- Jose Ceravolo
- Topic Author
- Offline
- Junior Member
-
- Posts: 25
- Thank you received: 0
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.