Page MenuHome

Write Arabic Text on Blender 2.8
Open, Needs Information from UserPublic

Description

This addon allow users to write text in Arabic

How to use:

  • Add/Select a Text object
  • Activate this addon by pressing CTRL+F1 on the keyborad OR by executing the operator labeled "Write Arabic Text"
  • Edit text as you do usually by entering edit mode and writing the text you want

Old File:

Details

Type
Patch

Event Timeline

Rasheed mh (alfanak) updated the task description. (Show Details)

Personally I'd love to have a design doc somewhere where we can explore what might be needed to properly support right-to-left languages like Arabic, Farsi, Hebrew, Urdu, etc.

This code is not the right/standard way to implment text writing support.
I have no documentation for that, and i don't know the right way fonts works, or how other languages are written.

If you have a specific question about the code itself i would be glad to help.

The problem you describe is that Blender does not support RTL language.

Brendon Murphy (meta-androcto) triaged this task as Needs Information from User priority.Tue, Jun 4, 4:10 AM

hi, does this work as expected? or are limitations in Blender preventing it from working to a desired result?

@Brendon Murphy (meta-androcto) - A summary as best as I can:

@Rasheed mh (alfanak) wrote this sweet addon that helps users enter Arabic text for text object. Runs without errors, seems to do what it purports to do. He commented that this is necessarily complex because we don't have any RTL supporting-code. The complexity in this case isn't just adding and editing text RTL but also in dealing with how many Arabic character glyphs join with neighboring glyphs.

I butted in, off topic, to say that I'd (also) love a longer-standing design document for language issues like this. Have native speakers help us triage what things might be needed to better support such languages as Arabic, Farsi, Hebrew, Urdu, etc. Things like right-to-left text entry (number entry remains left-to-right), which is the topic of this ticket. But also issues around right-to-left layout (for example menus would have items right-aligned and submenus open to the left), right-to-left widget placement, etc. We could even quite easily support different number systems like East Arabic, Bengali, Devanagari, Malayalam, etc. Different characters for radix point (baseline decimal, middle dot, comma, Arabic decimal separator), etc.

I think my (off-topic) comment prompted the original author to mention that what he has done is not really the right way for a program to do this, but is just a way to get this one thing done. I think his comment, and our lack of users with Arabic experience is what has prompted this to be set to "Needs Information from User"

hi, does this work as expected? or are limitations in Blender preventing it from working to a desired result?

I think it should work as expected (as described at least) but in a very annoying way for the user, a simple task like entering some text (maybe once in a very long time) does not need to be complicated and take a lot of steps to be done.

One of the potential problems is when a user uses this add-on before changing the text font, he will not see any characters while typing because the default font file does not contain Arabic characters, which make him thinking that the add-on is not working for him.
Using a Unicode font that contains Arabic characters for a Blender text object as a default font would help a lot.

For the code, if you provide a method to set the cursor position at a specific index in the module "bpy.ops.font", will makes things easier.
I don't remember what else can help with the code because I wrote this add-on long time ago and for now I'm working on a completely different thing...

hi, thanks for the reply. thanks for the detailed information. I don't think in it's current form we could add to Blender. I do see the usefulness.

Using a Unicode font that contains Arabic characters for a Blender text object as a default font would help a lot.

I wonder if you could include said font in the addon? I'n not sure if that would even work.. ( If the addon had it's own folder and init file and font file included )
What do you think? do you have time for this?
Pleas let me know how to proceed, I am closing tasks that are not going to make it into Blender 2.8 atm and I'm looking to solve or archive this.

Using a Unicode font that contains Arabic characters for a Blender text object as a default font would help a lot.

Just to clarify this...

By default everything in Blender uses a (small) font that ships with called "bfont.ttf" (I think). That font does not contain Arabic glyphs.

But the moment you click the "Translation" checkbox (Edit/ Preferences / Interface), and do nothing else, it will immediately start using a larger on-disk font (droidsans) that also ships with Blender. That font does contain the needed Arabic glyphs. This detail, that a different and better font comes with Blender but is only used when you click that checkmark, is a bit obscure. There are good arguments to just use that font by default even though it would have a larger memory footprint.

This comment was removed by Harley Acheson (harley).

Have to walk back something here...

@Rasheed mh (alfanak) specifically mentioned "Arabic characters for a Blender text object". What I was talking about above affects all text in the interface of Blender. So as soon as you click that "Translation" checkmark the larger and better font is what is used for the interface. Unfortunately even doing this does not change the default font for text objects, which seems to stay using "Bfont".

I wonder if you could include said font in the addon? I'n not sure if that would even work.. ( If the addon had it's own folder and __init__ file and font file included )

I will try that.

Have to walk back something here...

@Rasheed mh (alfanak) specifically mentioned "Arabic characters for a Blender text object". What I was talking about above affects all text in the interface of Blender. So as soon as you click that "Translation" checkmark the larger and better font is what is used for the interface. Unfortunately even doing this does not change the default font for text objects, which seems to stay using "Bfont".

I think, Bfont itself is a Unicode font that contains Arabic characters, but its partially loaded into memory. I'm not sure but maybe Bfont is loaded from the file "~blender2.8/2.80/datafiles/fonts/bmonofont-i18n.ttf.gz" which actually contains Arabic and Hebrew characters, BUT its just a guess, i have no idea about blender source code.

Thank you.

I wonder if you could include said font in the addon? I'n not sure if that would even work.. ( If the addon had it's own folder and __init__ file and font file included )

I will try that.

I added a font (the one that come with blender) to the add-on folder. The font is directly loaded and assigned to the 3D text Object when the add-on is initialized.
I also fixed the mixture of English and Arabic characters, so English characters does not appear from right to left anymore, still needs a bit of improvements though.