Hebrew Support

6,076 views
Skip to first unread message

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 5, 2011, 12:48:43โ€ฏPM10/5/11
to dompdf
Hi All

I read the post on the Persian support. tryed to follow it but got
lost somewhere in the process, so if you could help me i would
appreciete it

i downloaded a hebrew font from this site http://www.pement.org/hebfonts.htm
, with the afm file(heb_fonts/webhebrew.zip).

i copied the afm file to the server folder on /www/dompdf_0-6-0_beta2/
dompdf/lib/fonts and renamed it hebrew.afm
now, i went to
http://localhost/dompdf_0-6-0_beta2/dompdf/www/setup.php, pressed the
clear font cache, but didnt saw the font
then i tried to edit the dompdf_font_family_cache.dist.php like this

'Hebrew' => array (
'normal' => DOMPDF_FONT_DIR . 'Hebrew',
'bold' => DOMPDF_FONT_DIR . 'Hebrew',
'italic' => DOMPDF_FONT_DIR . 'Hebrew',
'bold_italic' => DOMPDF_FONT_DIR . 'Hebrew'
),

this show me four new entries in the setup.phh fonts table but the
afm cell is not highlighted (mean it wasnt loaded)

two questions:

1.how to configure this new afm?
2.how to use this new font on the utf_8 sample?

thanks
Hana

BrianS

unread,
Oct 5, 2011, 11:24:31โ€ฏPM10/5/11
to dom...@googlegroups.com
It's awesome they provide the AFM but what you really need is a UFM. Using your font with standard PDF encoding (Windows ANSI) is a lot more difficult than copying over the files. However, we have outlined the steps for enabling Unicode support, which makes the process much easier. Reading through this support document:ย How-to: Enable Unicode support

If you're still having issues after following the steps in that how-to post back here.

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 7, 2011, 7:48:47โ€ฏAM10/7/11
to dompdf
Thanks Alot. i will go thru the steps.

On Oct 6, 5:24ย am, BrianS <eclecticg...@gmail.com> wrote:
> It's awesome they provide the AFM but what you really need is a UFM. Using
> your font with standard PDF encoding (Windows ANSI) is a lot more difficult
> than copying over the files. However, we have outlined the steps for
> enabling Unicode support, which makes the process much easier. Reading
> through this support document: How-to: Enable Unicode support<http://code.google.com/p/dompdf/wiki/CPDFUnicode>

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 10, 2011, 3:27:52โ€ฏAM10/10/11
to dompdf
So,i went thru the document, had some issues in the tt2afm cmd, so i
used the alternative there from http://eclecticgeek.com/dompdf/load_font.php.
copyed both ttf and ufm files, and they were loaded correctly in the
setup page
Now, the last issue is the content in hebrew is backward, instead of
"abcd", its "dcba" .
I read in earlier posts here in the group, the guy that used the
persian font had the same problem?
is it something you can set a patch or do i need to reverse the
content my self ?

thanks
Hana.

On Oct 6, 5:24ย am, BrianS <eclecticg...@gmail.com> wrote:
> It's awesome they provide the AFM but what you really need is a UFM. Using
> your font with standard PDF encoding (Windows ANSI) is a lot more difficult
> than copying over the files. However, we have outlined the steps for
> enabling Unicode support, which makes the process much easier. Reading
> through this support document: How-to: Enable Unicode support<http://code.google.com/p/dompdf/wiki/CPDFUnicode>

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 10, 2011, 8:05:16โ€ฏAM10/10/11
to dompdf
Hi.here is an update : i revered the text and it did print in the pdf
the word readable, BUT it didn't saved the order of the paragraphs

I will explain my self:

assuming my original content is :
{paragraph a}
{paragraph b}
{paragraph c}
(each paragraph contains many word)

I make a reverse action on the content
now, i use it with the dompdf and what i get is something like this
{paragraph b}
{paragraph c}
{paragraph a}
So, word comes readble but the order is incorrect
Is there a way to solve it?
thanks
Hana


On Oct 10, 9:27ย am, ื—ื ื” ืื“ืœืจ <hana.b.ad...@gmail.com> wrote:
> So,i went thru the document, had some issues in the tt2afm cmd, so i
> used the alternative there fromhttp://eclecticgeek.com/dompdf/load_font.php.

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 10, 2011, 8:56:15โ€ฏAM10/10/11
to dompdf
So, i still testng this issue.
i used this online tool
http://textmechanic.com/Reverse-Text-Generator.html
to play around with the text but it never game me the excat original
text

can you explain what method u use when insert the content(r u putting
in the pdf in reverse or in flipped)
this way it will be easier to me to send the correct reversed info so
it will be reversed by the engine, and displayed correctly in hebrew



On Oct 10, 2:05ย pm, ื—ื ื” ืื“ืœืจ <hana.b.ad...@gmail.com> wrote:
> Hi.here is an update : i revered the text and it did print in the pdf
> the word readable, BUT it didn't saved the order of the paragraphs
>
> I will explain my self:
>
> assuming my original content is :
> {paragraph a}
> {paragraph b}
> {paragraph c}
> ย (each paragraph contains many word)
>
> I make a reverse action on the content
> now, i use it with the dompdf and what i get is something like this
> {paragraph b}
> {paragraph c}
> {paragraph a}
> So, word comes readble but the order is incorrect
> Is there a way to solve it?
> thanks
> Hana
>
> On Oct 10, 9:27ย am, ื—ื ื” ืื“ืœืจ <hana.b.ad...@gmail.com> wrote:
>
>
>
>
>
>
>
> > So,i went thru the document, had some issues in the tt2afm cmd, so i
> > used the alternative there fromhttp://eclecticgeek.com/dompdf/load_font.php.
> > copyed both ttf and ufm files, and they were loaded correctly in the
> > setup page
> > Now, the last issue is the content in ย hebrewis backward, instead of
> > "abcd", its "dcba" .
> > I read in earlier posts here in the group, the guy that used the
> > persian font had the same problem?
> > is it something you can set a patch or do i need to reverse the
> > content my self ?
>
> > thanks
> > Hana.
>
> > On Oct 6, 5:24ย am, BrianS <eclecticg...@gmail.com> wrote:
>
> > > It's awesome they provide the AFM but what you really need is a UFM. Using
> > > your font with standard PDF encoding (Windows ANSI) is a lot more difficult
> > > than copying over the files. However, we have outlined the steps for
> > > enabling Unicode support, which makes the process much easier. Reading
> > > through this support document: How-to: Enable Unicode support<http://code.google.com/p/dompdf/wiki/CPDFUnicode>
>
> > > If you're still having issues after following the steps in that how-to post
> > > back here.
>
> > > On Wednesday, October 5, 2011 12:48:43 PM UTC-4, ื—ื ื” ืื“ืœืจ wrote:
>
> > > > Hi All
>
> > > > I read the post on the Persian support. tryed to follow it but got
> > > > lost somewhere in the process, so if you could help me i would
> > > > appreciete it
>
> > > > i downloaded ahebrewfont from this site

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 10, 2011, 3:16:06โ€ฏPM10/10/11
to dompdf
ok. So i finally get it
The nearest thing i managed was to reverse letter and then it was in
the correct order but the from left to right (instead of right to
left)
So, i was wondering if you can guide me to the nearest place in the
include folder(in all those classess there), where i might be able to
make the content show (or reverse it) with rtl aligment

On Oct 10, 2:56ย pm, ื—ื ื” ืื“ืœืจ <hana.b.ad...@gmail.com> wrote:
> So, i still testng this issue.
> i used this online toolhttp://textmechanic.com/Reverse-Text-Generator.html

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 11, 2011, 6:25:24โ€ฏAM10/11/11
to dompdf
So, here is another update

I looked at the file include/style.cls.php
i changed two values in

$d["direction"] = "rtl";//original was ltr
$d["text_align"] = "right";//original was left

but still no improvment
the contetn is written from left to right
i.e.
assume my content is hello word(translated in hebrew)
thus the output is
word hello .
can u guide me where i control the direction of the text rendering in
the pdf (in the include folder)? i can change it mannualy

please help

thank
Hana

BrianS

unread,
Oct 12, 2011, 6:22:44โ€ฏPM10/12/11
to dom...@googlegroups.com
Directionality is going to require a lot of work on our part to implement correctly. There is currently noย  support for it in dompdf. Can you post a sample document with Hebrew text? Ideally it would be nice to also see a version that displays correctly (maybe a Word document?). That would help in trying to work out the problem.

What I take from your posts is that you write your code left-to-right (since that's how most editors work), but you expect that the text to correctly display right-to-left when rendered. Is this accurate? I can think of a quick hack that might get you up-and-running. It's likely to consist of both some manual styling, and a patch to the code. Before I post anything, though, I'd like to test it out first.

Ideally the PDF spec would have some kind of implementation of RTL, but I haven't found anything in a cursory search of the document.

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 16, 2011, 12:13:27โ€ฏAM10/16/11
to dompdf
Hi Brian

here is the sample html i use:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style>

body {
color: #555555;
direction: rtl;
font-family: ariel;
font-size: 12px;
line-height: 20px;
text-align:right;
}
</style>
</head>
<body>

<div class="jWizard" id="jWizard">

<div class="jbox gray" id="jbbpsdf8101">
<div class="jbox-title gray">ORIGINAL CONTENT</div>

<div class="jbox-content">
<div align="center" style="display:block;clear:both;margin:0;padding:
0;">
<table width="100%" cellspacing="0" cellpadding="0" border="0"
style="margin:0;table-layout:fixed;">
<tbody><tr valign="top">

<td width="20%" valign="top" align="right" style=""><div
align="right" style="margin:0;padding:0;;"></td><td width="6"
style="margin:0;padding:0;border-right:1px solid #d1d1d1;"></td><td
width="6" style="margin:0;padding:0;"></td><td width="80%"
valign="top" align="right" style=""><div align="right" style="margin:
0;padding:0;;"><div id="psdf8101"><div style="background:#F9F9F9;">


ื›ื•ืœื ื™ื•ื“ืขื™ื ืžื”ื• ื‘ื™ืช ื—ืœื•ืžื•ืชื™ื”ื, ื—ื–ื•ืŸ ืžื•ืฉืœื ืœื“ืจืš ืฉื‘ื” ื‘ื™ืช ืฆืจื™ืš ืœื”ื™ื•ืช. ืืš
ืื™ืŸ ื–ื” ืžืฉื ื” ื›ืžื” ื›ืกืฃ ื ื—ืœื™ื˜ ืœื”ืฉืงื™ืข, ืœื—ืœืงื ื• ื”ื’ื“ื•ืœ ืื™ืŸ ืืช ื”ื”ื›ืฉืจื”, ื”ื™ื“ืข
ื”ืžืงืฆื•ืขื™, ื”ื–ืžืŸ ืื• ื”ืกื‘ืœื ื•ืช ืœืชื›ื ืŸ ื”ื›ืœ ืžืืคืก - ื•ืœื›ืŸ ื‘ืžืงืจื™ื ื›ืืœื” ืื ื• ืžืขื“ื™ืคื™ื
ืœืฉื›ื•ืจ ืžืงืฆื•ืขื ื™ื ื‘ืชื—ื•ื ืฉื™ืกื™ื™ืขื• ืœื ื• ื‘ืžืฉื™ืžื”.

ืฆืจื™ื›ื™ื ืœืžืฆื•ื ืืœื•ืžื™ื ื™ื•ื? ืžืขื•ื ื™ื™ื ื™ื ืœื“ืขืช ืื™ืคื” ืœืžืฆื•ื ืจืฉืชื•ืช ืœื—ืœื•ื ื•ืช?
ืœืคื ื™ื›ื ืžื™ื“ืข ืฉื™ื•ื›ืœ ืœืขื–ื•ืจ ืœื›ื ืœื”ื™ื•ื•ื“ืข ืœืชื—ื•ื.

ืื“ืจื™ื›ืœื•ืช ื”ื™ื ืฉื ืœืชื—ื•ื ืจื—ื‘ ืžืื•ื“ ืืฉืจ ื ื—ืœืง ืœื›ืžื” ืงื˜ื’ื•ืจื™ื•ืช ืขื™ืงืจื™ื•ืช:
ืื“ืจื™ื›ืœื•ืช ื•ื”ื ื“ืกืช ืžื‘ื ื™ื, ืขื™ืฆื•ื‘ ื•ืื“ืจื™ื›ืœื•ืช ืคื ื™ื ื•ืชื—ื•ื ืื“ืจื™ื›ืœื•ืช ื”ื ื•ืฃ.
ื‘ืฉืœื‘ื™ื ื”ืจืืฉื•ื ื™ื, ืคื•ื ื™ื ืœืื“ืจื™ื›ืœ ื”ืžื‘ื ื™ื, ืฉืžืขืฆื‘ ืืช ื”ืžื‘ื ื” ื”ืžื•ื–ืžืŸ ืขืœ ื—ืœืงื™ื•
ื”ืฉื•ื ื™ื, ืชื•ืš ื›ื“ื™ ืžื—ืฉื‘ื” ืขืœ ืฉื™ืœื•ื‘ ื ื›ื•ืŸ ื‘ื™ืŸ ืžื” ืฉื™ืคื” ืœืžื” ืฉืฉื™ืžื•ืฉื™, ื•ืขื•ืจืš ืืช
ื›ืœ ื”ืชื›ื ื•ื ื™ื ืืฉืจ ื“ืจื•ืฉื™ื ืœื›ืœ ืžืฉื ื”, ื•ื‘ื™ื ื™ื”ื ืžืขืจื›ื•ืช ืžื™ื, ืื™ื•ื•ืจื•ืจ, ื—ืฉืžืœ,
ืชืื•ืจื” ื•ื’ื–.

ืื“ืจื™ื›ืœื™ ื”ืคื ื™ื ืชืคืงื™ื“ื ืœื”ืคื•ืš ืืช ื—ืœืœื™ื• ื”ืคื ื™ืžื™ื™ื ืฉืœ ื”ื‘ื ื™ื™ืŸ ืœืคืจืงื˜ื™ื™ื
ื•ื—ื™ื ื ื™ื™ื, ื‘ืืžืฆืขื•ืช ื‘ื—ื™ืจืช ืคืจื™ื˜ื™ ื”ืจื™ื”ื•ื˜, ื”ืืœืžื ื˜ื™ื ื”ืงื™ืฉื•ื˜ื™ื™ื
ื•ื”ืงื•ื ืกื˜ืจื•ืงื˜ื™ื‘ื™ื™ื ืข"ืคื™ ื”ืชืคืงื™ื“ ืฉืœ ื—ืœืœื™ ื”ืžื‘ื ื” ื”ืฉื•ื ื™ื - ืžื’ื•ืจื™ื, ืขื‘ื•ื“ื”
ืื™ื–ื•ืจ ืžืกื—ืจื™ ื•ืขื•ื“.

ืœื‘ืกื•ืฃ, ืžืขืฆื‘ื™ ื”ื ื•ืฃ ื”ื ืืœื” ื”ืืžื•ื ื™ื ืขืœ ื”ืชืืžืช ืกื‘ื™ื‘ืชื• ืฉืœ ื”ื‘ื ื™ื™ืŸ ืœืชื ืื™ื ื‘ืฉื˜ื—
ื•ืœื”ืขื“ืคื•ืช ื”ืœืงื•ื—ื•ืช - ื”ื—ืœ ืžื‘ื—ื™ืจืช ืกื•ื’ ืงืจืงืข ื•ืฆืžื—ื™ื™ื” ืžืชืื™ืžื™ื, ื•ื›ืœื” ื‘ื‘ื—ื™ืจืช
ืคืชืจื•ื ื•ืช ืœื™ืฆื™ืจืช ืฆืœ, ื™ืฆื™ืจืช ืคื™ืฆ'ืจื™ื ื‘ืžื™ื ื•ืฆืžื—ื™ื, ื•ืฉื™ืœื•ื‘ ืฉืœ ืืกืชื˜ื™ืงื” ืขื
ืคืจืงื˜ื™ื•ืช.

ืžื—ืคืฉื™ื ืžื™ื“ืข ืขืœ ื—ืœื•ื ื•ืช ืืœื•ืžื™ื ื™ื•ื?

ืฆืจื™ื›ื™ื ืžืงืฆื•ืขืŸ ืžืชื—ื•ื ื”ืืจื›ื™ื˜ืงื˜ื•ืจื”? ืฉืืœื• ื™ื“ื™ื“ื™ื ื•ืงืจื•ื‘ื™ ืžืฉืคื—ื” ืื ื”ื ื™ื›ื•ืœื™ื
ืœื”ืžืœื™ืฅ ืœื›ื ืขืœ ืื“ืจื™ื›ืœ ืžืกื•ื™ื™ื ืฉื™ืฆื ืœื”ื ืœืฉื›ื•ืจ ืœืฉื™ืจื•ืช ื‘ืขื‘ืจ.

ื‘ื–ืžืŸ ื—ื™ืคื•ืฉ ืื™ืฉ ืžืงืฆื•ืข ืžื”ืชื—ื•ื, ื”ื“ืจืš ื”ื˜ื•ื‘ื” ื‘ื™ื•ืชืจ ืœื”ืชืจืฉืžื•ืช ื”ื™ื ื“ืจืš ืขื™ื•ืŸ
ื‘ืชื™ืง ืขื‘ื•ื“ื•ืช. ืื‘ืœ ืื™ืŸ ืœื”ืกืชืคืง ืจืง ื‘ื–ื”, ื‘ืงืฉื• ืœืจืื•ืช ื‘ื ื•ืกืฃ ืฉืชื™ื™ื ืื• ืฉืœื•ืฉ
ืขื‘ื•ื“ื•ืช ื‘ืžื‘ื ื” ืื• ืกื‘ื™ื‘ื” ืฉืชื•ื›ื ื ื• ืขืœ ื™ื“ื™ ื”ืื“ืจื™ื›ืœื™ื ืฉื‘ื”ื ืืชื ืžืขื•ื ื™ื™ื ื™ื.

ืœื‘ืกื•ืฃ, ื”ื’ื™ืขื• ืœืคื’ื™ืฉื” ื›ืฉื‘ื™ื“ื›ื ืจืขื™ื•ื ื•ืช ืžื•ื’ื“ืจื™ื ื›ื›ืœ ื”ืืคืฉืจ, ืื•ืœื ื”ื™ื• ื’ื
ืžื•ื›ื ื™ื ืœื”ืชื’ืžืฉ ื•ืœืืคืฉืจ ืœืื™ืฉ ื”ืžืงืฆื•ืข ืœื”ืฆื™ืข ื›ื™ื•ื•ื ื™ื ืžืฉืœ
ืขืฆืžื•.


</tr>
</tbody></table>
</div></div></div>


</div>

</body>
</html>

You can download the arial.ttf font from this link

http://www.sipurey.com/dompdf_0-6-0_beta2/dompdf/lib/fonts/arial.ttf

i really apprentice your help.
thanks
Hana

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 17, 2011, 6:17:19โ€ฏAM10/17/11
to dompdf
Hi Again

I was trying to look at this function call:

$pdf->addText( $x, $this->y($y)- ($pdf->fonts[$pdf->currentFont]
['FontBBox'][3]*$size)/1000, $size, $text, $angle, $word_space,
$char_space);

at the cpdf_adapter

then i went i looked at the dompdf class.
i think that this might be the clue.The Text is rendered accordingly
to x and y corrdinates from the botton-left of the page, and in a left
to right order.


so, what if we can change to refernce located to botto right and......
i dont know.
Frustrating...

i am investigating it for 2 weeks, looking at the code day and night.
well, i hope you can help me
thanks
Hana

BrianS

unread,
Oct 17, 2011, 10:10:23โ€ฏPM10/17/11
to dom...@googlegroups.com
FYI I'm starting to look at this now. I think you're on the right track for a temporary hack. However, I don't think you need go as far as modifying the coordinates. You're already forcing text-align: right, so then all we need to do is reverse the order of the letters using something like the str_rev() php function. Since the adapter doesn't know anything about the text styling, though, we'd have to modify the code where the method is called based on the text styling.

Unless I'm not quite understanding the issue. Is the text straight-up reversed, or is it supposed to be displayed mirrored? Forgive my ignorance, I just haven't ever really looked into the RTL in that much detail before.

I'm having some problems getting dompdf to render the text correctly in the document. To make sure it's not a copy/paste problem could you post it as an attachment instead of inline? Or post it somewhere on the web I could access?


On Monday, October 17, 2011 6:17:19 AM UTC-4, ื—ื ื” ืื“ืœืจ wrote:
Hi Again

I was trying to look at this function call:

ย  ย  $pdf->addText( $x, $this->y($y)- ($pdf->fonts[$pdf->currentFont]
['FontBBox'][3]*$size)/1000, ย $size, $text, $angle, $word_space,
$char_space);

at the cpdf_adapter

then i went i looked at the dompdf class.
i think that this might be the clue.The Text is rendered accordingly
to x and y corrdinates from the botton-left of the page, and in a left
to right order.


so, what if we can change to refernce located to botto right and......
i dont know.
Frustrating...

i am investigating it for 2 weeks, looking at the code day and night.
well, i hope you can help me
thanks
Hana

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 18, 2011, 11:54:04โ€ฏAM10/18/11
to dompdf
Hi Brain

Thanks for the corporation ( i really intend to either donate or pay
something in return- i understand the situation)

I set up at this link dompdf installation with the hebrew arial font

http://sipurey.com/dompdf_0-6-0_beta2/dompdf/www/examples.php

in the examples page , at the "other" section there is an html called
"TestHana52.html"

i set there same content with all the text manipulations
the first section is the original content and below that i wrote which
manipulation i did on the text.
Once you press on the PDF link, check the original section which
rendered and you will see the text is written from left to right in
mirrored way (check the letters)

if you need access to the fileserver tell me and i will send you u/p
for access

thanks again
Hana

On Oct 18, 4:10ย am, BrianS <eclecticg...@gmail.com> wrote:
> FYI I'm starting to look at this now. I think you're on the right track for
> a temporary hack. However, I don't think you need go as far as modifying the
> coordinates. You're already forcing text-align: right, so then all we need

> to do is reverse the order of the letters using something like the str_rev()php function. Since the adapter doesn't know anything about the text

BrianS

unread,
Oct 21, 2011, 11:24:17โ€ฏPM10/21/11
to dom...@googlegroups.com
Thanks for the sample document, it helped to see it visually.

So take a look at a sample document with RTL rendering. How does it look? If it looks O.K. I can give you some guidance on how to get the desired output. (FYI, I was basing the output on how Safari rendered the HTML.)

The sample render is a pretty big hack job. The code modifications that were needed to create that rendering were pretty minor, but they only cover displaying each individual line of text RTL. The overall document structure still requires manual layout. Take a look at the HTML source of my sample to see what I mean.

After looking over your document and perusing the W3C specs related to directionality I feel that the problem of accurate RTL rendering will require more work than we'll be able to put in for the 0.6.0 release. Even if we implement some basic RTL support in 0.6.0 I don't know that we would be able to support bidi at all, so you would have to isolate any RTL text in its own styled element.

Let me know what you think.

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 22, 2011, 3:41:25โ€ฏAM10/22/11
to dompdf
WOW.

Thats EXACTLY right!!!

for me that gives me the desired output- its readable and good enough

Can u write the steps to accomplish it?

regards

Hana


On Oct 22, 5:24ย am, BrianS <eclecticg...@gmail.com> wrote:
> Thanks for the sample document, it helped to see it visually.
>
> So take a look at a sample document with RTL rendering<http://eclecticgeek.com/dompdf/debug.php?identifier=91fa1063959135cb3...>.

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 22, 2011, 8:35:32โ€ฏAM10/22/11
to dompdf
Ok.

So, part of the solution will be setting a css class such as

.rtl {
font-family: arial hebrew, sans-serif;
direction: rtl;
text-align: right;
}
than, setting this class for the text sections
Other than this, i understand its a php work (minor as you wrote).

BrianS

unread,
Oct 22, 2011, 2:03:20โ€ฏPM10/22/11
to dom...@googlegroups.com
On Saturday, October 22, 2011 8:35:32 AM UTC-4, ื—ื ื” ืื“ืœืจ wrote:
> Ok.
>
> So, part of the solution will be setting a css class such as
>
> .rtl {
> font-family: arial hebrew, sans-serif;
> direction: rtl;
> text-align: right;
> }
> than, setting this class for the text sections
> Other than this, i understand its a php work (minor as you wrote).
>

That's exactly right. I can post the updated php later today.

BrianS

unread,
Oct 22, 2011, 9:00:24โ€ฏPM10/22/11
to dom...@googlegroups.com
And here's the one file that I updated, just place it in your dompdf/include directory.

Since this is a fix just for 0.6.0 beta 2, let me pass along the actual modification in case you need to use it in the future. In any location whereย canvas->text() (or any variant of, such as $this->_canvas->text()) is called add the following above it:

if (strtolower($style->direction) == 'rtl') {
ย  preg_match_all('/./us', $text, $ar);
ย  $text = join('',array_reverse($ar[0]));
}

There are actually more locations than the attached file, but this is likely the only one you'll need to modify.

text_renderer.cls.php

ื—ื ื” ืื“ืœืจโ€Ž

unread,
Oct 23, 2011, 3:58:50โ€ฏAM10/23/11
to dompdf
Thank you very much,
It did the job
I just passed you a small donation for gratitude
I really appreciate your help
thank
Hana
> ย text_renderer.cls.php
> 6KViewDownload

synapse India

unread,
Jan 30, 2014, 1:26:53โ€ฏAM1/30/14
to dom...@googlegroups.com
Brian can you please tell me how to use this tool (http://eclecticgeek.com/dompdf/load_font.php) to generate pdf. I have never seen form on the site where I can upload ttfor afm to generate the dompdf font package.

I would like to install angelina font without command line.

thanks
Reply all
Reply to author
Forward
0 new messages