Topic: [Feature] Changing font and alignment for Perso-Arabic and Urdu words

Posted under Site Bug Reports & Feature Requests

Requested feature overview description.
Change the alignment of all Arabic script based languages from left to right, also changing the font.

Why would it be useful?
All the said languages are aligned from right to left, but e621 shows them from left because its code is based on English language! (Aligned from left)

Example:
سلام عليکم. <-- Is Aligned from left!

also the font is so small that the letters are almost indistinguishable!!! A recommended font for replacement for Arabic-based letters is Tahoma size 2+.

What part(s) of the site page(s) are affected?
everywhere there is a Arabic/Persian/Urdu/... word.

Updated by Lance Armstrong

Hudson

Former Staff

Please use the right template when posting in this category.

Feature Request template
[b]Requested feature overview description.[/b]
[b]Why would it be useful?[/b]
[b]What part(s) of the site page(s) are affected?[/b]
Bug Report template
[b]Bug overview description.[/b]
[b]What part(s) of the site page(s) are affected?[/b]
[b]What is the expected behavior?[/b]
[b]What actual behavior is given instead?[/b]
[b]Time of incident (if applicable).[/b]
[b]Can you reproduce the bug every time?[/b]
[b]What steps did you take to replicate this bug?[/b]
[b]Errors or other messages returned (if any).[/b]

Updated by anonymous

Ok, this userscript should help:

// ==UserScript==
// @name        ArabE6
// @include     /https?://(e621|e926)\.net/forum/show/.*/
// @include     /https?://(e621|e926)\.net/blip/.*/
// @include     /https?://(e621|e926)\.net/post/show/.*/
// @version     1
// @grant       none
// ==/UserScript==

var c = document.getElementsByClassName("body");
for (var i=0; i<c.length; i++)
{
  var p = c[i].getElementsByTagName("p");
  for (var j=0; j<p.length; j++)
  {
    p[j].innerHTML = p[j].innerHTML.replace(/([\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+.*[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+[.!?]?)/gi,"<div style='direction:rtl;font-size:200%;font-family:Tahoma'>$1<\/div>")
  }
}

I included support for these characters:

Arabic (0600–06FF, 255 characters)
Arabic Supplement (0750–077F, 48 characters)
Arabic Extended-A (08A0–08FF, 73 characters)
Arabic Presentation Forms-A (FB50–FDFF, 611 characters)
Arabic Presentation Forms-B (FE70–FEFF, 141 characters)

Tested on Firefox.

Updated by anonymous

شکراً إنك المستخدم المفيد! :D :D :D

The script does not work on http though!

Updated by anonymous

NoIWontBelieve said:
شکراً إنك المستخدم المفيد! :D :D :D

The script does not work on http though!

Fuck. I was sure e621 was https only.

Fixed, copy the new code from above.

Updated by anonymous

  • 1