Add eastern languages input to Blender #51283

Open
opened 2017-04-21 19:23:53 +02:00 by Seth L. · 27 comments

System Information
OS X 10.6 through macOS 10.12
all hardware configurations

Blender Version
Broken: all versions (as far as I know), including 2.78
Worked: never

Short description of error
Blender is unable to accept Japanese text input. In almost any other Mac application, when the input source is switched to Japanese the application can accept Japanese text. Note that Japanese text input appears to work fine on Windows builds. This may pertain to other Asian languages as well, but I have not verified it.
This lack of support is a pity, considering that Blender is otherwise fully supporting Japanese translation of menu items and such. If you go to Blender User Preferences > System and enable International Fonts for Japanese in all three available categories you will find that Blender will add new objects with Japanese names - instead of "Cube" you will get "立方体" ...but you will not be able to directly rename it to another Japanese name. You can however paste Japanese text from the clipboard and it works.

Exact steps for others to reproduce the error

  1. Enable Japanese text input on the Mac. System Preferences > Language & Text > Input Sources (may vary depending on OS version)
  2. Enable Japanese text input (sometimes referred to as "Kotoeri").
  3. Confirm Japanese text input is working. This can be done in Text Edit. Use the icon in the Menu Bar to switch to Hiragana input (represented by an あ character). Now when you type "aka" (meaning red) it should concert to "あか". Converting further to kanji will produce results such as "赤".
  4. Try this in Blender. Try to rename the default cube object to "あか" or "赤" and you will find it is impossible. Blender simply refuses the input.
  5. Next, try to create a Text object and type Japanese text in it. This fails as well, not surprisingly. There is no way to type Japanese into a text object, even when a Japanese font (such as KozGoPr6n-Regular) is selected. Again, it can be pasted from the clipboard, but not typed.
**System Information** OS X 10.6 through macOS 10.12 all hardware configurations **Blender Version** Broken: all versions (as far as I know), including 2.78 Worked: never **Short description of error** Blender is unable to accept Japanese text input. In almost any other Mac application, when the input source is switched to Japanese the application can accept Japanese text. Note that Japanese text input appears to work fine on Windows builds. This may pertain to other Asian languages as well, but I have not verified it. This lack of support is a pity, considering that Blender is otherwise fully supporting Japanese translation of menu items and such. If you go to Blender User Preferences > System and enable International Fonts for Japanese in all three available categories you will find that Blender will add new objects with Japanese names - instead of "Cube" you will get "立方体" ...but you will not be able to directly rename it to another Japanese name. You can however paste Japanese text from the clipboard and it works. **Exact steps for others to reproduce the error** 1. Enable Japanese text input on the Mac. System Preferences > Language & Text > Input Sources (may vary depending on OS version) 2. Enable Japanese text input (sometimes referred to as "Kotoeri"). 3. Confirm Japanese text input is working. This can be done in Text Edit. Use the icon in the Menu Bar to switch to Hiragana input (represented by an あ character). Now when you type "aka" (meaning red) it should concert to "あか". Converting further to kanji will produce results such as "赤". 4. Try this in Blender. Try to rename the default cube object to "あか" or "赤" and you will find it is impossible. Blender simply refuses the input. 5. Next, try to create a Text object and type Japanese text in it. This fails as well, not surprisingly. There is no way to type Japanese into a text object, even when a Japanese font (such as KozGoPr6n-Regular) is selected. Again, it can be pasted from the clipboard, but not typed.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @quantumanomaly

Added subscriber: @quantumanomaly

#100460 was marked as duplicate of this issue

#100460 was marked as duplicate of this issue

#96039 was marked as duplicate of this issue

#96039 was marked as duplicate of this issue

#85990 was marked as duplicate of this issue

#85990 was marked as duplicate of this issue

#73812 was marked as duplicate of this issue

#73812 was marked as duplicate of this issue

Added subscriber: @mont29

Added subscriber: @mont29

This is more of a TODO really… Issue being, non-latin (and especially, eastern languages) requires advanced engine to type them - each OS having its own system. We implemented those for windows and linux a while back, would be great to get it for OSX as well, we just need an OSX dev from Japan, China or other concerned country to do the work…

This is more of a TODO really… Issue being, non-latin (and especially, eastern languages) requires advanced engine to type them - each OS having its own system. We implemented those for windows and linux a while back, would be great to get it for OSX as well, we just need an OSX dev from Japan, China or other concerned country to do the work…
Bastien Montagne changed title from Blender for Mac fails to accept Japanese text input to Add eastern languages input to Blender under OSX 2017-05-22 23:03:15 +02:00

Added subscribers: @hamsteriscoming, @ankitm

Added subscribers: @hamsteriscoming, @ankitm
Campbell Barton changed title from Add eastern languages input to Blender under OSX to Add eastern languages input to Blender 2020-02-15 04:56:50 +01:00
Member

Added subscribers: @Mahir_Shaharia, @Harley, @CharlieJolly

Added subscribers: @Mahir_Shaharia, @Harley, @CharlieJolly

Added subscriber: @2046411367

Added subscriber: @2046411367

Added subscriber: @hzuika

Added subscriber: @hzuika

@quantumanomaly
Hi Seth. L!
I submitted patches about Input Method support.
D11695 is the main patch.

If you have a build environment, it would be great if you could test it and give me feedback.

Thank you.

@quantumanomaly Hi Seth. L! I submitted patches about Input Method support. [D11695](https://archive.blender.org/developer/D11695) is the main patch. If you have a build environment, it would be great if you could test it and give me feedback. Thank you.

This issue was referenced by 83e2f8c993

This issue was referenced by 83e2f8c993dc8068eb1145e9b8f4756a54f96144

It seems the patch is only about few eastern language. Japanese, Chinese (Mandarin) and Korean as far as I'm concerned it won't fix the problem with other eastern languages.

It seems the patch is only about few eastern language. Japanese, Chinese (Mandarin) and Korean as far as I'm concerned it won't fix the problem with other eastern languages.

Yes, the patch I submitted is only for Japanese, Chinese and Korean support.
I'm Japanese, so unfortunately I don't know how to input other eastern languages.
I would like to leave it to the developers who are proficient in those languages.

Yes, the patch I submitted is only for Japanese, Chinese and Korean support. I'm Japanese, so unfortunately I don't know how to input other eastern languages. I would like to leave it to the developers who are proficient in those languages.

How'd you added Japanese support? I mean what source files you were you experimenting on or how you added glyph support for Japanese language? With these and few more questions answer I might be able to add Bangla language support I think.

How'd you added Japanese support? I mean what source files you were you experimenting on or how you added glyph support for Japanese language? With these and few more questions answer I might be able to add Bangla language support I think.

Bangla language support is great!

I did a lot of work on intern/ghost/intern/GHOST_WindowViewCocoa.h.
I followed the NSTextInputClient protocol and implemented the appropriate methods.

For more technical details, Apple's official documentation may be of help

https://developer.apple.com/documentation/appkit/nstextinputclient?language=objc

https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html

I'll try to explain it a bit.

Mac OS keyboard events are first handled by the keyDown method of this file. HandleKeyEvent is the one that processes the input characters as they are, just like in English. And interpretKeyEvents are for external programs (such as Input method for Japanese) to perform various operations on the input characters. When the external program performs the operation, the various methods defined in this file are called.

For the Japanese language support, I implemented setMarkedText and insertText, which put the Japanese characters sent by the Input method into the GHOST event and pushed it.

This was the only work I had to do, because when Japanese input was supported in Windows, the GHOST event, Window Manager event, and insertion and drawing processes in source/blender/editors/interface were implemented.
I didn't have to do anything else after letting the GHOST event take care of it.

I don't know how Bangla language is input and how well it is supported in Blender, but if Bangla language has a special input method like Japanese and it is not implemented in Blender yet, it might be more work (Character drawing process, etc.).

Bangla language support is great! I did a lot of work on intern/ghost/intern/GHOST_WindowViewCocoa.h. I followed the `NSTextInputClient` protocol and implemented the appropriate methods. For more technical details, Apple's official documentation may be of help https://developer.apple.com/documentation/appkit/nstextinputclient?language=objc https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html I'll try to explain it a bit. Mac OS keyboard events are first handled by the `keyDown` method of this file. `HandleKeyEvent` is the one that processes the input characters as they are, just like in English. And `interpretKeyEvents` are for external programs (such as Input method for Japanese) to perform various operations on the input characters. When the external program performs the operation, the various methods defined in this file are called. For the Japanese language support, I implemented `setMarkedText` and `insertText`, which put the Japanese characters sent by the Input method into the GHOST event and pushed it. This was the only work I had to do, because when Japanese input was supported in Windows, the GHOST event, Window Manager event, and insertion and drawing processes in source/blender/editors/interface were implemented. I didn't have to do anything else after letting the GHOST event take care of it. I don't know how Bangla language is input and how well it is supported in Blender, but if Bangla language has a special input method like Japanese and it is not implemented in Blender yet, it might be more work (Character drawing process, etc.).
Member

@Mahir_Shaharia - I might be able to add Bangla language support I think.

I think the only thing required for Bangla is to get the Bengali-Assamese alphabet into our international fonts. That's just the Unicode glyphs in the range U+0980 - U+09FF. I'll add this to our "to do" list.

> @Mahir_Shaharia - I might be able to add Bangla language support I think. I think the only thing required for Bangla is to get the Bengali-Assamese alphabet into our international fonts. That's just the Unicode glyphs in the range U+0980 - U+09FF. I'll add this to our "to do" list.

Added subscriber: @brecht

Added subscriber: @brecht

@Mahir_Shaharia reported #85990 about Windows, while @hzuika worked on macOS. They're quite different implementations, and if there is an issue with Bangla support on Windows that would need to be solved in the Windows IME implementation in Blender.

From #85990, it also seems this issue might go beyond missing glyphs in the font.

@Mahir_Shaharia reported #85990 about Windows, while @hzuika worked on macOS. They're quite different implementations, and if there is an issue with Bangla support on Windows that would need to be solved in the Windows IME implementation in Blender. From #85990, it also seems this issue might go beyond missing glyphs in the font.
Member

@brecht

Yes, I remember testing that in #85990 now. And yes, this is an IME issue. I just installed the Bengali input language (Windows) and text input is entered inline like Korean. So while hitting regular latin keys you get Bengali characters and what is already shown might change depending on what is typed next.

We'd still need the glyphs though, so added a task (to myself) - #89713.

@brecht Yes, I remember testing that in #85990 now. And yes, this is an IME issue. I just installed the Bengali input language (Windows) and text input is entered inline like Korean. So while hitting regular latin keys you get Bengali characters and what is already shown might change depending on what is typed next. We'd still need the glyphs though, so added a task (to myself) - #89713.

In #51283#1188235, @brecht wrote:
@Mahir_Shaharia reported #85990 about Windows, while @hzuika worked on macOS. They're quite different implementations, and if there is an issue with Bangla support on Windows that would need to be solved in the Windows IME implementation in Blender.

From #85990, it also seems this issue might go beyond missing glyphs in the font.

Most eastern languages are written in a manner where they join with each other like fast English handwriting does. Arabic language is among them. So I first thought that adding glyphs might not work out but few days ago I saw this issue blender/blender-addons#62011 where an addon was used for fixing that issue. Not only the writing was perfect but the alphabets were connecting with each other. So that was the reason I said adding glyphs might fix the issue.

> In #51283#1188235, @brecht wrote: > @Mahir_Shaharia reported #85990 about Windows, while @hzuika worked on macOS. They're quite different implementations, and if there is an issue with Bangla support on Windows that would need to be solved in the Windows IME implementation in Blender. > > From #85990, it also seems this issue might go beyond missing glyphs in the font. Most eastern languages are written in a manner where they join with each other like fast English handwriting does. Arabic language is among them. So I first thought that adding glyphs might not work out but few days ago I saw this issue [blender/blender-addons#62011 ](https://developer.blender.org/T62011) where an addon was used for fixing that issue. Not only the writing was perfect but the alphabets were connecting with each other. So that was the reason I said adding glyphs might fix the issue.
Member

@Mahir_Shaharia

Yes, there are a few different issues involving different languages.


As you mention some languages, like Arabic, have their characters altered to join them up together, which we generally call “text shaping”. This is not available in Blender now but we have a long-term task to add that. https://developer.blender.org/T67452

Some other languages enter text differently. They might use a supplemental window to select alternates, or previous characters already entered might be altered by the additions of new ones, etc. These use an “IME”, vary greatly between languages, and are quick tricky to do well. We currently support IME text entry for Chinese, Japanese, and Korean but with differing bugs between them and we have various patches to improve them.

With all of these though our font still needs the glyphs. Our font currently contains 54,000 characters and supports most major languages, with some notable holes. https://developer.blender.org/T89713

@Mahir_Shaharia Yes, there are a few different issues involving different languages. ``` ``` As you mention some languages, like Arabic, have their characters altered to join them up together, which we generally call “text shaping”. This is not available in Blender now but we have a long-term task to add that. https://developer.blender.org/T67452 Some other languages enter text differently. They might use a supplemental window to select alternates, or previous characters already entered might be altered by the additions of new ones, etc. These use an “IME”, vary greatly between languages, and are quick tricky to do well. We currently support IME text entry for Chinese, Japanese, and Korean but with differing bugs between them and we have various patches to improve them. With all of these though our font still needs the glyphs. Our font currently contains 54,000 characters and supports most major languages, with some notable holes. https://developer.blender.org/T89713
Member

Added subscribers: @olafchou, @PratikPB2123

Added subscribers: @olafchou, @PratikPB2123
Member

@Mahir_Shaharia - I might be able to add Bangla language support I think.

We now include a complete Bengali font as of {e9bd6abde37c}

> @Mahir_Shaharia - I might be able to add Bangla language support I think. We now include a **complete** Bengali font as of {e9bd6abde37c}
Member

Added subscribers: @hoanguk, @OmarEmaraDev

Added subscribers: @hoanguk, @OmarEmaraDev
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:26:25 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
12 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#51283
No description provided.