Text alignment for [heb] tag

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

Text alignment for [heb] tag

Postby Jason Hare » Mon Sep 30, 2013 8:46 am

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

User avatar
Kirk Lowery
Site Admin
Posts: 164
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Postby Kirk Lowery » Mon Sep 30, 2013 8:56 am

Jason,

We can do any html. Is "dir-rtl" an attribute for the <span> tag?
Kirk E. Lowery, PhD
B-Hebrew Site Administrator & Co-moderator
blog: https://blogs.emdros.org/eh
#mb-hga

User avatar
Jason Hare
Posts: 72
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Postby Jason Hare » Mon Sep 30, 2013 9:08 am

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

User avatar
Kirk Lowery
Site Admin
Posts: 164
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Postby Kirk Lowery » Mon Sep 30, 2013 10:40 am

I've added the attribute to the [heb] 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 & Co-moderator
blog: https://blogs.emdros.org/eh
#mb-hga

User avatar
Jason Hare
Posts: 72
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Postby Jason Hare » Mon Sep 30, 2013 11:31 am

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

It works perfectly. Thanks a lot. :)
Jason Hare
Tel Aviv, Israel

User avatar
Kirk Lowery
Site Admin
Posts: 164
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Postby Kirk Lowery » Mon Sep 30, 2013 5:18 pm

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 & Co-moderator
blog: https://blogs.emdros.org/eh
#mb-hga

User avatar
Jason Hare
Posts: 72
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Postby Jason Hare » Mon Sep 30, 2013 9:55 pm

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

User avatar
Kirk Lowery
Site Admin
Posts: 164
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Postby Kirk Lowery » Tue Oct 01, 2013 8:42 am

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 & Co-moderator
blog: https://blogs.emdros.org/eh
#mb-hga

User avatar
Kirk Lowery
Site Admin
Posts: 164
Joined: Fri Aug 09, 2013 12:03 pm
Location: Philadelphia, Pennsylvania
Contact:

Re: Text alignment for [heb] tag

Postby Kirk Lowery » Tue Oct 01, 2013 8:48 am

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 & Co-moderator
blog: https://blogs.emdros.org/eh
#mb-hga

User avatar
Jason Hare
Posts: 72
Joined: Mon Sep 30, 2013 5:07 am
Location: Tel Aviv, Israel
Contact:

Re: Text alignment for [heb] tag

Postby Jason Hare » Tue Oct 01, 2013 4:35 pm

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


Return to “Questions”

Who is online

Users browsing this forum: No registered users and 1 guest