You are not logged in.
I'm using VCLCanvas to render TextOut text but I noticed that not all font supporting arabic script are rendered correctly.
For example, while on screen canvas both "Calibri" and "Segoe UI" are producing readable text, on VCLCanvas the Calibri is not good.
With other fonts is even worst.
I'm calling always same TextOut API preceded by SetTextAlign(ACanvas.Handle, TA_CENTER) to change allignment
if SameText(lTextAlign, 'LEFT') then
begin
lDX := lRect.Left;
SetTextAlign(ACanvas.Handle, TA_LEFT);
end
else if SameText(lTextAlign, 'CENTER') then
begin
lDX := lRect.Left + (lRect.Width div 2);
SetTextAlign(ACanvas.Handle, TA_CENTER);
end
else if SameText(lTextAlign, 'RIGHT') then
begin
lDX := lRect.Left + lRect.Width;
SetTextAlign(ACanvas.Handle, TA_RIGHT);
end
else
begin
lDX := lRect.Left;
SetTextAlign(ACanvas.Handle, TA_LEFT);
end;
ACanvas.TextOut(lDX, lRect.Top, lBlock);
SetTextAlign(ACanvas.Handle, TA_LEFT);
Any idea or is a bug?
Thanks
Offline
yes
UseUniScribe := True but is not rendered well for all arabic font families, in details some arabic ligatures are rendered in a bad way and the same text with same TextOut api render good on PaintBox Canvas on screen.
I can add a sample is there is a way to add attachment.
Thanks
Last edited by pierangelo.dalben (Today 08:36:30)
Offline
Have you tried to set UseFontFallBack to True and defined a FontFallBackName ?
Here is a list of fallback fonts which should work based on the language:
Chinese (Simplified): "Simsun" or "Microsoft YaHei"
Chinese (Traditional): "MingLiU" or "Microsoft JhengHei"
Japanese: "MS Mincho" or "Meiryo"
Korean: "Malgun Gothic" or "Batang"
Arabic: "Tahoma" or "Amiri"
Hebrew: "David" or "Arial Hebrew"
Hindi/Devanagari: "Mangal" or "Nirmala UI"
Thai: "Tahoma" or "LilyUPC"
Tamil: "Latha" or "Nirmala UI"
Greek: "Arial" or "Georgia"
Cyrillic (Russian): "Arial" or "Times New Roman"
Vietnamese: "Arial" or "Tahoma"
Bengali: "Vrinda" or "Nirmala UI"
Ethiopic (Amharic): "Nyala" or "Ebrima"
Georgian: "Sylfaen"
Armenian: "Sylfaen"
Khmer: "Khmer UI"
Lao: "Lao UI"
Offline
No, I'm not using FontFallBackName as I the font render correctly on PaintBox.Canvas I'm expecting that the same TextOut render in the same way on SynPDF.VCLCanvas.
More not all words are wrong, just some words depending on the font used. That's a bit wired.
Also for example same text with Segoe UI render correctly in PDF, but testing the same text is not render good with Calibri or "Adobe Arabic".
All these 3 fonts otherwise are rendered well on display PaintBox Canvas.
Have you tried to set UseFontFallBack to True and defined a FontFallBackName ?
Last edited by pierangelo.dalben (Today 09:38:14)
Offline