abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorKazoku2023-02-10 00:40:48 +0700
committerGitHub2023-02-09 18:40:48 +0100
commitb54f9c5797690bf7ca77228f5a3647e72c20388f (patch)
treebbffb833ec9de1af014f0a81243f26868b6724f6 /srcs
parent72249b8a42a7586212b06b2236777e296cfec159 (diff)
downloadunexpected-keyboard-b54f9c5797690bf7ca77228f5a3647e72c20388f.tar.gz
unexpected-keyboard-b54f9c5797690bf7ca77228f5a3647e72c20388f.zip
Vietnamese keyboard (#291)
Added missing accent (horn, hook, dot below) Added layout Added accent font svg (by modified existing accent)
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/Config.java1
-rw-r--r--srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java3
-rw-r--r--srcs/juloo.keyboard2/KeyModifier.java61
-rw-r--r--srcs/juloo.keyboard2/KeyValue.java7
-rw-r--r--srcs/special_font/60.svg1
-rw-r--r--srcs/special_font/61.svg1
-rw-r--r--srcs/special_font/62.svg1
-rw-r--r--srcs/special_font/result.ttfbin7916 -> 8660 bytes
8 files changed, 74 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 3eacae3..eda2740 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -357,6 +357,7 @@ final class Config
case "qwerty_sv_se": id = R.xml.qwerty_sv_se; break;
case "qwerty_tr": id = R.xml.qwerty_tr; break;
case "qwerty_pl": id = R.xml.qwerty_pl; break;
+ case "qwerty_vi": id = R.xml.qwerty_vi; break;
case "qwertz": id = R.xml.qwertz; break;
case "qwertz_cs": id = R.xml.qwertz_cs; break;
case "qwertz_de": id = R.xml.qwertz_de; break;
diff --git a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java
index f013e51..8938d2d 100644
--- a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java
+++ b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java
@@ -31,6 +31,9 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference
"accent_breve",
"accent_slash",
"accent_bar",
+ "accent_dot_below",
+ "accent_hook_above",
+ "accent_horn",
"€",
"ß",
"£",
diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java
index c00ff07..ad41edc 100644
--- a/srcs/juloo.keyboard2/KeyModifier.java
+++ b/srcs/juloo.keyboard2/KeyModifier.java
@@ -60,6 +60,9 @@ class KeyModifier
case SLASH: return apply_map_char(k, map_char_slash);
case BAR: return apply_map_char(k, map_char_bar);
case ARROW_RIGHT: return apply_combining(k, "\u20D7");
+ case DOT_BELOW: return apply_map_char(k, map_char_dot_below);
+ case HORN: return apply_map_char(k, map_char_horn);
+ case HOOK_ABOVE: return apply_map_char(k, map_char_hook_above);
default: return k;
}
}
@@ -570,4 +573,62 @@ class KeyModifier
}
}
};
+
+ private static final Map_char map_char_dot_below =
+ new Map_char() {
+ public char apply(char c)
+ {
+ switch (c)
+ {
+ case 'a': return 'ạ';
+ case 'ă': return 'ặ';
+ case 'â': return 'ậ';
+ case 'e': return 'ẹ';
+ case 'ê': return 'ệ';
+ case 'i': return 'ị';
+ case 'o': return 'ọ';
+ case 'ô': return 'ộ';
+ case 'ơ': return 'ợ';
+ case 'u': return 'ụ';
+ case 'ư': return 'ự';
+ case 'y': return 'ỵ';
+ default: return c;
+ }
+ }
+ };
+ private static final Map_char map_char_horn =
+ new Map_char() {
+ public char apply(char c)
+ {
+ switch (c)
+ {
+ case 'o': return 'ơ';
+ case 'u': return 'ư';
+ default: return c;
+ }
+ }
+ };
+
+ private static final Map_char map_char_hook_above =
+ new Map_char() {
+ public char apply(char c)
+ {
+ switch (c)
+ {
+ case 'a': return 'ả';
+ case 'ă': return 'ẳ';
+ case 'â': return 'ẩ';
+ case 'e': return 'ẻ';
+ case 'ê': return 'ể';
+ case 'i': return 'ỉ';
+ case 'o': return 'ỏ';
+ case 'ô': return 'ổ';
+ case 'ơ': return 'ở';
+ case 'u': return 'ủ';
+ case 'ư': return 'ử';
+ case 'y': return 'ỷ';
+ default: return c;
+ }
+ }
+ };
}
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java
index e93e61f..f45bc7c 100644
--- a/srcs/juloo.keyboard2/KeyValue.java
+++ b/srcs/juloo.keyboard2/KeyValue.java
@@ -1,6 +1,5 @@
package juloo.keyboard2;
-import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import java.util.HashMap;
@@ -30,12 +29,15 @@ final class KeyValue
META,
DOUBLE_AIGU,
DOT_ABOVE,
+ DOT_BELOW,
GRAVE,
AIGU,
CIRCONFLEXE,
TILDE,
CEDILLE,
TREMA,
+ HORN,
+ HOOK_ABOVE,
SUPERSCRIPT,
SUBSCRIPT,
RING,
@@ -310,6 +312,9 @@ final class KeyValue
case "accent_arrow_right": return diacritic(0x5D, Modifier.ARROW_RIGHT);
case "accent_breve": return diacritic(0x5E, Modifier.BREVE);
case "accent_bar": return diacritic(0x5F, Modifier.BAR);
+ case "accent_dot_below": return diacritic(0x60, Modifier.DOT_BELOW);
+ case "accent_horn": return diacritic(0x61, Modifier.HORN);
+ case "accent_hook_above": return diacritic(0x62, Modifier.HOOK_ABOVE);
case "superscript": return modifierKey("Sup", Modifier.SUPERSCRIPT, 0);
case "subscript": return modifierKey("Sub", Modifier.SUBSCRIPT, 0);
case "ordinal": return modifierKey("Ord", Modifier.ORDINAL, 0);
diff --git a/srcs/special_font/60.svg b/srcs/special_font/60.svg
new file mode 100644
index 0000000..ef403c8
--- /dev/null
+++ b/srcs/special_font/60.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-20 0 1168 2048"><path fill="currentColor" d="m931.256 1557.78-69.314-69.314Q749.47 1574.78 612.15 1586.55v99.395q176.555-11.772 319.106-128.166zm-414.577 28.77q-133.396-10.462-249.792-100.701 0 1.309-71.93 74.545l2.616-2.615q142.554 116.396 319.106 128.166zm-319.107-171.321q-90.24-103.316-107.24-245.867H-9.062q17.002 181.786 137.32 319.104l-6.539 5.23 3.923-2.614 41.85-43.158q30.08-31.387 30.08-32.695zm940.318-245.868h-99.394q-17 141.242-107.239 248.483l69.314 70.62q120.318-137.318 137.319-319.103zm0-96.778q-14.386-189.633-129.474-326.953l-69.314 70.622q86.316 111.164 99.394 256.33zM189.726 818.867h.001q-86.315 107.239-99.394 253.716H-9.06Q4.017 882.95 119.104 745.63l-3.923-3.924q-1.308 0 74.545 77.16zm749.377-142.552Q792.627 552.073 612.151 540.3v99.394q139.935 11.77 257.639 105.935zM516.679 540.303q-180.478 11.77-326.953 136.013l69.314 69.314q117.703-90.238 257.64-105.933v-99.394zM648 1838H430v201h218z"/></svg> \ No newline at end of file
diff --git a/srcs/special_font/61.svg b/srcs/special_font/61.svg
new file mode 100644
index 0000000..e9b930c
--- /dev/null
+++ b/srcs/special_font/61.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1168 2048"><path d="m931.256 1839.834-69.314-69.314q-112.472 86.315-249.792 98.086V1968q176.555-11.771 319.106-128.166zm-414.577 28.77q-133.396-10.462-249.792-100.7 0 1.308-71.93 74.544l2.616-2.615q142.554 116.396 319.106 128.166v-99.395zm-319.107-171.32q-90.24-103.317-107.24-245.868H-9.062q17.001 181.786 137.32 319.104l-6.539 5.232 3.923-2.616 41.85-43.158q30.08-31.387 30.08-32.695zm940.318-245.869h-99.394q-17 141.242-107.239 248.483l69.314 70.621q120.318-137.319 137.319-319.104zm0-96.778q-14.386-189.633-129.474-326.953l-69.314 70.622q86.316 111.164 99.394 256.331h99.394zm-948.164-253.716h.001q-86.315 107.24-99.394 253.716H-9.06q13.078-189.633 128.165-326.953l-3.923-3.924q-1.308 0 74.545 77.161zM939.103 958.37Q792.627 834.127 612.151 822.355v99.395q139.935 11.77 257.639 105.934ZM516.679 822.357Q336.201 834.128 189.726 958.37l69.314 69.314q117.703-90.238 257.64-105.933v-99.394zM792 831.054q70-52 109.5-99.5t39.5-101.5q0-42-22.5-66t-73.5-24q-27 0-50 7.5t-49 18.5l-33-123q36-19 79.5-31.5t103.5-12.5q95 0 155.5 55t60.5 154q0 80-60.5 152t-187.5 128Z"/></svg> \ No newline at end of file
diff --git a/srcs/special_font/62.svg b/srcs/special_font/62.svg
new file mode 100644
index 0000000..2df211f
--- /dev/null
+++ b/srcs/special_font/62.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-20 0 1168 2048"><path fill="currentColor" d="m931.256 1851.834-69.314-69.314q-112.472 86.315-249.792 98.086V1980q176.555-11.771 319.106-128.166zm-414.577 28.77q-133.396-10.462-249.792-100.7 0 1.308-71.93 74.544l2.616-2.615q142.554 116.396 319.106 128.166v-99.395zm-319.107-171.32q-90.24-103.317-107.24-245.868H-9.062q17.001 181.786 137.32 319.104l-6.539 5.232 3.923-2.616 41.85-43.158q30.08-31.387 30.08-32.695zm940.318-245.869h-99.394q-17 141.242-107.239 248.483l69.314 70.621q120.318-137.319 137.319-319.104zm0-96.778q-14.386-189.633-129.474-326.953l-69.314 70.622q86.316 111.164 99.394 256.331h99.394zm-948.164-253.716h.001q-86.315 107.24-99.394 253.716H-9.06q13.078-189.633 128.165-326.953l-3.923-3.924q-1.308 0 74.545 77.161zM939.103 970.37Q792.627 846.127 612.151 834.355v99.395q139.935 11.77 257.639 105.934ZM516.679 834.357Q336.201 846.128 189.726 970.37l69.314 69.314q117.703-90.238 257.64-105.933v-99.394zM623 840.054l-12-52q65-11 108-52t43-121q0-96-79-153t-226-57l-7 109q72 0 116 24.5t44 73.5q0 48-36 67t-123 26l32 135z"/></svg> \ No newline at end of file
diff --git a/srcs/special_font/result.ttf b/srcs/special_font/result.ttf
index 45aa459..c7a8ca0 100644
--- a/srcs/special_font/result.ttf
+++ b/srcs/special_font/result.ttf
Binary files differ