Add eastern languages input to Blender #51283

Open
opened 6 years ago by quantumanomaly · 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.
Poster

Changed status to: 'Open'

Changed status to: 'Open'
Poster

Added subscriber: @quantumanomaly

Added subscriber: @quantumanomaly
Collaborator

#100460 was marked as duplicate of this issue

#100460 was marked as duplicate of this issue
Collaborator

#96039 was marked as duplicate of this issue

#96039 was marked as duplicate of this issue
Collaborator

#85990 was marked as duplicate of this issue

#85990 was marked as duplicate of this issue
Collaborator

#73812 was marked as duplicate of this issue

#73812 was marked as duplicate of this issue
mont29 commented 6 years ago
Owner

Added subscriber: @mont29

Added subscriber: @mont29
mont29 commented 6 years ago
Owner

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…
mont29 changed title from Blender for Mac fails to accept Japanese text input to Add eastern languages input to Blender under OSX 6 years ago
Owner

Added subscribers: @hamsteriscoming, @ankitm

Added subscribers: @hamsteriscoming, @ankitm
ideasman42 changed title from Add eastern languages input to Blender under OSX to Add eastern languages input to Blender 3 years ago
ankitm commented 2 years ago
Collaborator

Added subscribers: @Mahir_Shaharia, @Harley, @CharlieJolly

Added subscribers: @Mahir_Shaharia, @Harley, @CharlieJolly

Added subscriber: @2046411367

Added subscriber: @2046411367
hzuika commented 2 years ago

Added subscriber: @hzuika

Added subscriber: @hzuika
hzuika commented 2 years ago

@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.
Collaborator

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.
hzuika commented 2 years ago

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.
hzuika commented 2 years ago

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.).
Harley commented 2 years ago
Collaborator

@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.
brecht commented 2 years ago
Owner

Added subscriber: @brecht

Added subscriber: @brecht
brecht commented 2 years ago
Owner

@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.
Harley commented 2 years ago
Collaborator

@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.
Harley commented 2 years ago
Collaborator

@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
Collaborator

Added subscribers: @olafchou, @PratikPB2123

Added subscribers: @olafchou, @PratikPB2123
Collaborator

@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}
Collaborator

Added subscribers: @hoanguk, @OmarEmaraDev

Added subscribers: @hoanguk, @OmarEmaraDev
lichtwerk removed the
legacy module/User Interface
label 7 hours ago
lichtwerk removed the
Interest/User Interface
label 7 hours ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#51283
Loading…
There is no content yet.