diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-03-13 01:17:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-14 06:07:43 +0800 |
commit | 33590c18529973683d41ba0bc942f8e162ab3a21 (patch) | |
tree | 285d2023be33a51fc255494b1c3ea032c845c5cb /drivers/staging/speakup | |
parent | c188966067b48acb94fea37aed06a142e3001122 (diff) |
speakup: Support spelling unicode characters
This supports spelling unicode characters by just passing them to
the speech synthesis in direct mode.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup')
-rw-r--r-- | drivers/staging/speakup/main.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index bd5fb32f812d..dc07b2328bc0 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -432,7 +432,7 @@ static void speak_char(u16 ch) char *cp; struct var_t *direct = spk_get_var(DIRECT); - if (direct && direct->u.n.value) { + if (ch >= 0x100 || (direct && direct->u.n.value)) { if (IS_CHAR(ch, B_CAP)) { spk_pitch_shift++; synth_printf("%s", spk_str_caps_start); @@ -443,8 +443,6 @@ static void speak_char(u16 ch) return; } - if (ch >= 0x100) - return; cp = spk_characters[ch]; if (cp == NULL) { pr_info("speak_char: cp == NULL!\n"); @@ -712,17 +710,16 @@ static void spell_word(struct vc_data *vc) char *cp1; char *str_cap = spk_str_caps_stop; char *last_cap = spk_str_caps_stop; + struct var_t *direct = spk_get_var(DIRECT); u16 ch; if (!get_word(vc)) return; while ((ch = *cp)) { - if (ch >= 0x100) - /* FIXME */ - continue; if (cp != buf) synth_printf(" %s ", delay_str[spk_spell_delay]); - if (IS_CHAR(ch, B_CAP)) { + /* FIXME: Non-latin1 considered as lower case */ + if (ch < 0x100 && IS_CHAR(ch, B_CAP)) { str_cap = spk_str_caps_start; if (*spk_str_caps_stop) spk_pitch_shift++; @@ -734,18 +731,21 @@ static void spell_word(struct vc_data *vc) synth_printf("%s", str_cap); last_cap = str_cap; } - if (this_speakup_key == SPELL_PHONETIC && + if (ch >= 0x100 || (direct && direct->u.n.value)) { + synth_putwc_s(ch); + } else if (this_speakup_key == SPELL_PHONETIC && ch <= 0x7f && isalpha(ch)) { ch &= 0x1f; cp1 = phonetic[--ch]; + synth_printf("%s", cp1); } else { cp1 = spk_characters[ch]; if (*cp1 == '^') { synth_printf("%s", spk_msg_get(MSG_CTRL)); cp1++; } + synth_printf("%s", cp1); } - synth_printf("%s", cp1); cp++; } if (str_cap != spk_str_caps_stop) |