Write Arabic Text on Blender 2.8 #62011
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
15 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#62011
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This addon allow users to write text in Arabic
Write Arabic Text-1.0.1.zip
Write Arabic Text.zip
How to use:
Added subscriber: @alfanak
Added subscriber: @Harley
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.
Added subscriber: @AyelGoth
The problem you describe is that Blender does not support RTL language.
Added subscriber: @BrendonMurphy
hi, does this work as expected? or are limitations in Blender preventing it from working to a desired result?
@BrendonMurphy - A summary as best as I can:
@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"
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.
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.
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
Have to walk back something here...
@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 will try that.
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 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.
thanks, testing continues
Added subscriber: @jaggz
Just an FYI:
harfbuzz is the most common library for handling font shaping, used in "Android, Chrome, ChromeOS, Firefox, GNOME, GTK+, KDE, LibreOffice, OpenJDK, PlayStation, Qt, XeTeX, and other places."
Their manual "what-is-harfbuzz.html" states, "HarfBuzz can properly shape all of the world's major writing systems."
https://harfbuzz.github.io/getting-started.html
Another FYI:
bfont is lacking, but bmonofont and droidsans, included with 2.8, do have Arabic glyphs. It seems their joining rules are not that complete, however (see fail example below), A script could handle some of these issues, but in the future, if we're going to handle international languages (right-left, up-down, etc.) we might want to go with harfbuzz, which not only chooses the appropriate glyphs, but returns information on their positioning. It would need to be handled in C. For now, with a script like the above, someone would need to pick a different font, and then could set about their typing, and that might be sufficient for the time being.
For what it's worth, the most complete and capable Arabic font I've found is readily available on the web, me_quran.ttf, and possibly its [few] variants. (It is specified as free for "personal and non-commercial use" however).
Here's an example of a place where it succeeds in my web browser:
And here's bfontmono i18n's version, being unhappy in the web browser, even with harfbuzz trying to make it work out:
(droidsans seems about the same quality as bfont, with regard to my cursory examination of its Arabic rule-handling.)
Please bear in mind, most Arabic writing is not as demanding as the above examples. The basic joining of letters and perhaps basic vowel handling would suffice, so such a script would work. This is true with other languages too, like Persian (and its variants) and Urdu, which use modified Arabic alphabets (but are otherwise different languages), as well as Hebrew (ie. not putting the various diacritics), etc. (Harfbuzz would handle all that though).
A core developer does have a current plan to incorporate Harfbuzz, but not aware of the how quickly he is hoping to do so.
This was attempted in the past, notably here:
https://developer.blender.org/D1809
But I think we need more native speakers, who are also developers, who can offer assistance with such things over a long term.
Pardon me, I have to correct something. bfont does NOT have the Arabic glyphs.
Once a font is loaded, can Python access its glyph data, so if they're outright missing (without placeholder glyphs) an addon script can warn?
bfont range of common Arabic letters:
bfontmono and droidsans:
I might make the change in my original post so as not to waste someone's time when they read it.
Added subscriber: @Mazoon
You might want to check this: Raqm library
Added subscriber: @larsonreever
are limitations in Blender preventing it from working to a desired result, 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 .
That part is confusing and we are working toward that.
A first step will be consolidating the differences between some of our fonts: https://developer.blender.org/D6055
And then hopefully using the international font always: https://developer.blender.org/D3705
hi, just to revisit this quickly.
Looking again at this script, it's probably useful in it's concept.
What I would like to see is a checkbox in this panel:
Or a better place if someone suggests one. A simple checkbox "Write Reversed Text" would be fine.
No hotkey, currently the addon has no way to disable which is unacceptable.
I may want to write Arabic then write English underneath it. A toggle would solve this and the aforementioned disable issue.
If someone want's to do this, we can accept the addon into Contrib for a test run.
@alfanak other issue is minor, could we please have the bl_info in English.
Thanks.
Actually you can write English even if this addon is activated
We can disable it by unckecking it from the addons settings window.
Also we can use the same hotkey that enables the addon as a hotkey to disable it.
Addon info is for the user himself not for developers, i don't know why it should be in English!
hi @alfanak
In the activation, the Description should be in English, it's something we do everywhere.
In the Author field I would accept if you added your English name before ﻦﻳﺪﻟﺍ ﻲﺤﻣ ﺪﻴﺷﺭ
When a user looks at your addons info, this is what they see by default.
This image shows the addon with International fonts turned on.
That is why I make the suggestions for the bl_info standards.
Moving on to the hotkey.
To be honest I don't see the need for this addon using a hotkey. When testing I found the hotkey to turn on the reversed text did not turn it off when pressed so I was stuck in that mode. If you can make it so the key toggles on/off it would be much better.
Moving on to an interface location.
I think we also need a interface button. Looking at the properties text section it's difficult to find a proper place. I think in this case we could use a panel. I would call the panel "Text Direction". Within it you could have the "Write Arabic Text" checkbox and would also be able to add in any options that may be applicable.
I would like to add this into the Blender addons contrib section and it would be available in nightly builds. To me this is a good feature, I look at it a right to left or reversed text, good for all sorts of things.
Thanks.
Added subscriber: @Blendify
Changed status from 'Needs User Info' to: 'Resolved'
Hi thank you for submitting a patch, unfortunately, we no longer use the task subtype "Patch" please submit new patches through the differential tool: https://developer.blender.org/differential/
Added subscriber: @a7madgamal
I can't use arabic in the latest version on windows, not sure about
resolved
tbhAdded subscriber: @glasscat
Added subscriber: @Elhosary89
Changed status from 'Resolved' to: 'Archived'
plz help, how to solve this?
@Elhosary89
What are your trying to write?
مبارك
حروف
راقي
رايق
Can i have the font
https://fonts.google.com/specimen/Tajawal?subset=arabic
I mean the same font file you are using, from your computer
sorry I cant, it is for client.
you can try what I sent it is same result not working perfectly
Never mind, i think i found what i was looking for.
The font missing the isolated shape of every glyph, which is weird.
It's easy to fix this but i don't know if i can do this here since this task is closed.
Please help, you cant Create New Task
Write Arabic Text-1.0.1.zip
Not working bro, still same
Added subscriber: @ankitm
@alfanak reading the comments of Brendon Murphy, it seems after incorporating his suggestions, you may submit it, following the guidelines at https://wiki.blender.org/wiki/Process/Addons.
If somehow that is not suitable, https://devtalk.blender.org/c/other-topics/python/6 can be used to collect feedback, and respond to the users.
Try to uninstall the old addon, restart blender and install the new one
Thank you
Added subscriber: @SalemF
It's works properly at last after multiple times trying it and fail , I'm using Linux Mint 19 XFCE , and the addon uses one of the system shortcut ( Ctrl + F1 ) , I was have to disable that shortcut from my OS system setting
I wish this addon-on developers keep this on their mind , or even make it works immediately after enable it without need for any shortcut .
For now that is not possible.
And, unfortunately, this task is closed.
Added subscriber: @tariqerwa
Never worked but no thrown exceptions..
Any tweek to make it acually run ?