Text alignment for [heb] tag

Questions and discussion about B-Hebrew policies or the B-Hebrew forum.
User avatar
Jason Hare
Posts: 1920
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Text alignment for [heb] tag

Post by Jason Hare »

Just wanted to suggest that you add dir="rtl" to the heb tag. This would help it with placement of geresh and punctuation at the end of lines or words.

Would it be possible with the phpBB software?

Thanks!
Jason Hare
Tel Aviv, Israel
The Hebrew Café
יוֹדֵ֣עַ צַ֭דִּיק נֶ֣פֶשׁ בְּהֶמְתּ֑וֹ וְֽרַחֲמֵ֥י רְ֝שָׁעִ֗ים אַכְזָרִֽי׃
ספר משלי י״ב, י׳
User avatar
Kirk Lowery
Site Admin
Posts: 363
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Post by Kirk Lowery »

Jason,

We can do any html. Is "dir-rtl" an attribute for the <span> tag?
Kirk E. Lowery, PhD
B-Hebrew Site Administrator & Moderator
blog: https://blogs.emdros.org/eh
User avatar
Jason Hare
Posts: 1920
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Post by Jason Hare »

Kirk Lowery wrote:Jason,

We can do any html. Is "dir-rtl" an attribute for the <span> tag?
Yes. "dir" is an attribute that can be added to any regular HTML tag.

Code: Select all

<span style="font-family: SBL BibLit, SBL Hebrew, Times New Roman; font-size: 12pt;" dir="rtl">
There is also a style (CSS) tag that can be added for bidirectionality.

Code: Select all

style="direction: rtl; unicode-bidi: embed;"
This can be added if you're using CSS.

Thanks!
Jason Hare
Tel Aviv, Israel
The Hebrew Café
יוֹדֵ֣עַ צַ֭דִּיק נֶ֣פֶשׁ בְּהֶמְתּ֑וֹ וְֽרַחֲמֵ֥י רְ֝שָׁעִ֗ים אַכְזָרִֽי׃
ספר משלי י״ב, י׳
User avatar
Kirk Lowery
Site Admin
Posts: 363
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Post by Kirk Lowery »

I've added the attribute to the tag. Jason, could you please check (or even post test cases here), to verify it's working as you'd expect?

Thanks!
Kirk E. Lowery, PhD
B-Hebrew Site Administrator & Moderator
blog: https://blogs.emdros.org/eh
User avatar
Jason Hare
Posts: 1920
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Post by Jason Hare »

בודק את הקוד. תודה רבה!

It works perfectly. Thanks a lot. :)
Jason Hare
Tel Aviv, Israel
The Hebrew Café
יוֹדֵ֣עַ צַ֭דִּיק נֶ֣פֶשׁ בְּהֶמְתּ֑וֹ וְֽרַחֲמֵ֥י רְ֝שָׁעִ֗ים אַכְזָרִֽי׃
ספר משלי י״ב, י׳
User avatar
Kirk Lowery
Site Admin
Posts: 363
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Post by Kirk Lowery »

Jason Hare wrote:This would help it with placement of geresh and punctuation at the end of lines or words.
Jason,

Have you checked geresh and other punctuation with cantillated text? Does it meet your expectations?
Kirk E. Lowery, PhD
B-Hebrew Site Administrator & Moderator
blog: https://blogs.emdros.org/eh
User avatar
Jason Hare
Posts: 1920
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Post by Jason Hare »

Kirk Lowery wrote:
Jason Hare wrote:This would help it with placement of geresh and punctuation at the end of lines or words.
Jason,

Have you checked geresh and other punctuation with cantillated text? Does it meet your expectations?
All cantillation works according to the settings of the font, not the layout of the code. Because it's coded to SBL Hebrew, it works according to the font specifications.

Here's a check:

אַ֥שְֽׁרֵי הָאִ֗ישׁ אֲשֶׁ֤ר ׀ לֹ֥א הָלַךְ֮ בַּֽעֲצַ֪ת רְשָׁ֫עִ֥ים
וּבְדֶ֣רֶךְ חַ֭טָּאִים לֹ֥א עָמָ֑ד וּבְמוֹשַׁ֥ב לֵ֝צִ֗ים לֹ֣א יָשָֽׁב׃


Even alignment wouldn't be affected here, since the sof-pasuk is encoded automatically for right-to-left, unlike periods and commas, which are common to the English keyboard.

The issue in the example that I just posted is line-height, which isn't wide enough to allow for the points and cantillation. Can you see the issue on your side?
Jason Hare
Tel Aviv, Israel
The Hebrew Café
יוֹדֵ֣עַ צַ֭דִּיק נֶ֣פֶשׁ בְּהֶמְתּ֑וֹ וְֽרַחֲמֵ֥י רְ֝שָׁעִ֗ים אַכְזָרִֽי׃
ספר משלי י״ב, י׳
User avatar
Kirk Lowery
Site Admin
Posts: 363
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Post by Kirk Lowery »

I see two problems here: the line spacing as you mentioned, and the text is not right-aligned.

Is there an html attribute for line spacing, ideally something we can increase by something more granular than "line and a half; double spaced", in picas or inches, mm or something?

As for the alignment problem, I thought I had tested this. There are two conditions to deal with: (1) inline Hebrew text surrounded by Latin text; (2) a paragraph of Hebrew only. I wonder if the dir attribute is confusing the UTF-8 bidi algorithm...

I'll do more research on this.
Kirk E. Lowery, PhD
B-Hebrew Site Administrator & Moderator
blog: https://blogs.emdros.org/eh
User avatar
Kirk Lowery
Site Admin
Posts: 363
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Post by Kirk Lowery »

I've resolved (at least for my display) the line spacing issue. Jason, check it out: your text should now have sufficient space. The attribute is line-height and I've set it to 130%.
Kirk E. Lowery, PhD
B-Hebrew Site Administrator & Moderator
blog: https://blogs.emdros.org/eh
User avatar
Jason Hare
Posts: 1920
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Post by Jason Hare »

Kirk Lowery wrote:I see two problems here: the line spacing as you mentioned, and the text is not right-aligned.

Is there an html attribute for line spacing, ideally something we can increase by something more granular than "line and a half; double spaced", in picas or inches, mm or something?

As for the alignment problem, I thought I had tested this. There are two conditions to deal with: (1) inline Hebrew text surrounded by Latin text; (2) a paragraph of Hebrew only. I wonder if the dir attribute is confusing the UTF-8 bidi algorithm...

I'll do more research on this.
The line-height is now fine. Thanks.

If you want a paragraph aligned on the right, you need to add / dir="rtl" / to an entire <p> tag or <div> tag - not to a <span> tag, which doesn't govern an entire chunk of text in the same sense.

On my forum, I created the tags / he / for Hebrew text within English text and / hep / (that is, "Hebrew Paragraph") for text that needs to be aligned on the right.

The way your forum is currently set up, you could just use the right-alignment tag to align it on the right:
אַ֥שְֽׁרֵי הָאִ֗ישׁ אֲשֶׁ֤ר ׀ לֹ֥א הָלַךְ֮ בַּֽעֲצַ֪ת רְשָׁ֫עִ֥ים
וּבְדֶ֣רֶךְ חַ֭טָּאִים לֹ֥א עָמָ֑ד וּבְמוֹשַׁ֥ב לֵ֝צִ֗ים לֹ֣א יָשָֽׁב׃
That is:

Code: Select all

[right][heb]אַ֥שְֽׁרֵי הָאִ֗ישׁ אֲשֶׁ֤ר ׀ לֹ֥א הָלַךְ֮ בַּֽעֲצַ֪ת רְשָׁ֫עִ֥ים
וּבְדֶ֣רֶךְ חַ֭טָּאִים לֹ֥א עָמָ֑ד וּבְמוֹשַׁ֥ב לֵ֝צִ֗ים לֹ֣א יָשָֽׁב׃[/heb][/right]
Hope this helps.

Jason
Jason Hare
Tel Aviv, Israel
The Hebrew Café
יוֹדֵ֣עַ צַ֭דִּיק נֶ֣פֶשׁ בְּהֶמְתּ֑וֹ וְֽרַחֲמֵ֥י רְ֝שָׁעִ֗ים אַכְזָרִֽי׃
ספר משלי י״ב, י׳
Post Reply