Merge lp://staging/~mabkenar/ubuntu-keyboard/add-persian-layout into lp://staging/ubuntu-keyboard

Proposed by Masoud Abkenar
Status: Merged
Approved by: Michael Sheldon
Approved revision: 526
Merged at revision: 545
Proposed branch: lp://staging/~mabkenar/ubuntu-keyboard/add-persian-layout
Merge into: lp://staging/ubuntu-keyboard
Diff against target: 690 lines (+589/-0)
14 files modified
debian/control (+10/-0)
debian/ubuntu-keyboard-persian.install (+1/-0)
plugins/fa/fa.pro (+9/-0)
plugins/fa/qml/Keyboard_fa.qml (+93/-0)
plugins/fa/qml/Keyboard_fa_email.qml (+93/-0)
plugins/fa/qml/Keyboard_fa_url.qml (+92/-0)
plugins/fa/qml/Keyboard_fa_url_search.qml (+94/-0)
plugins/fa/qml/Keyboard_symbols_fa.qml (+96/-0)
plugins/fa/qml/qml.pro (+21/-0)
plugins/fa/src/persianplugin.h (+25/-0)
plugins/fa/src/persianplugin.json (+7/-0)
plugins/fa/src/src.pro (+46/-0)
plugins/plugins.pro (+1/-0)
qml/keys/languages.js (+1/-0)
To merge this branch: bzr merge lp://staging/~mabkenar/ubuntu-keyboard/add-persian-layout
Reviewer Review Type Date Requested Status
Ken VanDine packaging Approve
Michael Sheldon (community) Approve
Review via email: mp+314532@code.staging.launchpad.net

Commit message

Persian layout

Description of the change

This is a Persian layout (fa_IR) for ubuntu-keyboard. This layout is a bit more complicated than most existing layouts because it has a dedicated symbols keyboard that contains Persian-specific symbols, and is defined in 'plugins/fa/qml/Keyboard_symbols_fa.qml' next to other Persian layouts.

A dedicated symbols keyboard is essential for Persian since many of the punctuation and numeric characters are different from other Latin scripts. For example, Persian has different question mark, comma, decimal separator, and thousands separator (just to name a few) and all of these characters should be included in the symbols keyboard. Android (version 5 and later) also follows the same approach and have a special symbols keyboard for Persian. However, the proposed Persian layout here fixes some of the shortcomings of the Persian layout in Android [1].

Another specialty of this layout is the inclusion of invisible characters necessary for typesetting Persian text, ZWNJ (U+200C) and ZWJ (U+200D). These keys have a different label than what they actually insert into the text, thanks to the property 'valueToSubmit' of CharKey{} object.

For more information about the design process, please refer to my blog [2].

[1] http://forum.ubuntu.ir/index.php/topic,143281.msg1128226.html#msg1128226
[2] https://masoud.abkenar.net/blog/en/?p=63

To post a comment you must log in.
Revision history for this message
Masoud Abkenar (mabkenar) wrote :

I should probably also mention that this is a perfectly working patch. I can successfully compile this branch and use it on my own Nexus 4.

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Just a quick message to say thanks for the branch and that it is still on my list to review, but is currently blocked by some issues with the keyboard and recent Mir versions, as soon as we have the fixes for those merged I'll get right on this :)

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Hi Masoud,

 Overall this plugin looks great, just a couple of small things:

 * On my desktop system there's a key that doesn't render correctly on the bottom row (see http://i.imgur.com/NiHFGZB.png), so I think there's a font package we'll need to add as an additional dependency to the ubuntu-keyboard-persian package. Do you know which font is likely to provide this character?

 * I noticed that key isn't present on the email layout (but is there on the URL layout), is that intentional?

Thanks!

review: Needs Fixing
Revision history for this message
Masoud Abkenar (mabkenar) wrote :

Hi Michael,

Thanks for taking the time to review this plugin and thanks for the nice words :)

The key that is not rendered correctly on your (desktop?) machine is supposed to have "🢐⸽🢒" string on the label and insert U+200C (Zero-Width Non-Joiner) into the text.

A correct rendering on the device is shown here https://goo.gl/vVPwXT and similar key in AOSP is here https://goo.gl/hYBdm6

The rest of the letters on the keyboard are rendered using DejaVu font (it is NOT the Ubuntu font family). DejaVu is the default font for Persian scripts everywhere in the phone (and also in the desktop as of 16.10). Unless fontconfig/etc are at work here, I assume this "🢐⸽🢒" thingy is also rendered with DejaVu. Your screenshot is using FreeSerif for the Persian letters.

For your second point: This is intentional. AFAIK the ZWNJ character is forbidden in email addresses, but it is possible to have ZWNJ in URLs (not in the domain part, but in the page address). Since this character is invisible, I removed it to avoid almost-impossible-to-catch errors when typing email addresses.

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

I've just retested this on a clean Zesty VM and that key is rendered without issues, so I think it's one of the extra fonts installed on my personal system incorrectly claiming it can render this key when it can't (and so not allowing it to fallback to something that can). As such I think this branch is good to go :)

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Packaging changes are fine

review: Approve (packaging)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches