Recent

Author Topic: Fortes report does not print Arabic text in Ubuntu  (Read 15051 times)

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Fortes report does not print Arabic text in Ubuntu
« on: May 22, 2011, 07:43:23 pm »
I face this problem today after testing some reports. The printer prints only English text, numbers, and lines, but it leave Arabic text empty in paper. In Windows it is working fine.

My environment:

- Ubuntu 11.4
- Lazarus 0.9.30
- fortesreport-3.24-LCL-R2
- Printer: HP Deskjet color 1050

Note: other applications such as office writer prints Arabic letters normally
Any suggestions?
« Last Edit: May 22, 2011, 08:02:23 pm by motaz »

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #1 on: May 23, 2011, 12:55:48 am »
The arabic text is show in the Preview?

Can you post a small example?

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #2 on: May 23, 2011, 07:12:45 pm »
Yes, it is visible normaly in Preview. See atacheed

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #3 on: May 23, 2011, 07:23:43 pm »
And this is the printed paper. All Arabic text is invisible

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #4 on: May 23, 2011, 08:44:34 pm »
Please post an small example so i can test and try to fix

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #5 on: May 23, 2011, 09:16:26 pm »
This is the example

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #6 on: May 28, 2011, 02:39:50 am »
This is not a specific Fortes issue

Lazreport has the same problem

See http://bugs.freepascal.org/view.php?id=19435

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #7 on: May 28, 2011, 07:48:24 am »
Thank's for posting it as a Bug. I could wait to be solved.

Fortunately all my customers are using Windows currently.

zeljko

  • Hero Member
  • *****
  • Posts: 1144
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #8 on: May 28, 2011, 04:06:30 pm »
Thank's for posting it as a Bug. I could wait to be solved.

Fortunately all my customers are using Windows currently.

Have you tried if qt lazarus prints ? Also, add cwstring unit to your .lpr, maybe it can raise problems.

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #9 on: May 28, 2011, 04:39:52 pm »
I tried cwstring, but there is no effect.

I tried to compile with QT, but Lazarus failes to compile because FortesReport:

/home/motaz/projects/fortes324/rlprintdialog.pas(1,1) Fatal: Unit PrintersDlgs searched but Printers found

Zaher

  • Hero Member
  • *****
  • Posts: 600
    • parmaja.com
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #10 on: June 24, 2011, 09:07:14 pm »
The problem when generate the ps file (PostScript) not FortesReport.
If you create a PostSctipt Canvas and do the same print, save it to file, open the in both Windows or Linux you will see the same problem.

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #11 on: January 21, 2012, 09:51:47 am »
PostScript has the same problem.
Here is the code sample:
Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
const
  LEFTMARGIN = 100;
  HEADLINE = 'I Printed My Very First Text On ';
var
  YPos, LineHeight, VerticalMargin: Integer;
  SuccessString: String;
  Num: Integer;
begin
  with Printer do
  try
    BeginDoc;
    Canvas.Font.Name := 'Courier New';
    Canvas.Font.Size := 10;
    Canvas.Font.Color := clBlack;
    LineHeight := Round(1.2 * Abs(Canvas.TextHeight('I')));
    VerticalMargin := 4 * LineHeight;
    // There we go
    YPos := VerticalMargin;
    SuccessString := HEADLINE + DateTimeToStr(Now);
    SuccessString:= UTF8ToSys(SuccessString);
    Caption:= SuccessString;
    Canvas.TextOut(LEFTMARGIN, YPos, 'A');
    Canvas.TextOut(LEFTMARGIN, YPos + 45, 'بسم الله الرحمن الرحيم');
    TPostScriptPrinterCanvas(Canvas).SaveToFile('/home/motaz/tmp/test.ps');
  finally
    EndDoc;
  end;
end;

Arabic letters does not appear on the page

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #12 on: February 07, 2012, 06:26:10 am »
Today I've recompiled Lazarus using QT widget in Ubuntu, and Arabic font is printed !

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #13 on: February 07, 2012, 07:01:54 am »
Good news.

While I probably won't be printing Arabic anytime soon, I'm glad these improvements happen - not all of us write and speak only English  :D
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: Fortes report does not print Arabic text in Ubuntu
« Reply #14 on: February 07, 2012, 07:45:49 am »
I'm afraid that there is no improvement in this issue, the bug is still open:
http://bugs.freepascal.org/view.php?id=19435
We still can't print Arabic text in Linux/GTK, but there is a work around to use QT. I don't know what is the consequences of using QT in addition to deployment of QT bridge library. Is there any licensing issue about using QT?

 

TinyPortal © 2005-2018