From 1e067c9863cb412af582158b54f1467a6e379416 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 5 Nov 2022 19:26:49 +0100 Subject: [PATCH] Add the bar diacritic dead key Allows to type many of the "with stroke" or "with bar" latin letters. --- res/xml/settings.xml | 1 + .../ExtraKeyCheckBoxPreference.java | 1 + srcs/juloo.keyboard2/KeyModifier.java | 28 ++++++++++++++++++ srcs/juloo.keyboard2/KeyValue.java | 2 ++ srcs/special_font/5F.svg | 13 ++++++++ srcs/special_font/result.ttf | Bin 7240 -> 7460 bytes 6 files changed, 45 insertions(+) create mode 100644 srcs/special_font/5F.svg diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 93badef..01a79d9 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -26,6 +26,7 @@ + diff --git a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java index 8787b6b..c4757de 100644 --- a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java +++ b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java @@ -29,6 +29,7 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference "accent_macron", "accent_ogonek", "accent_breve", + "accent_bar", "€", "ß", "£", diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index 2bb4e08..c733c33 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -58,6 +58,7 @@ class KeyModifier case ARROWS: return apply_map_char(k, map_char_arrows); case BOX: return apply_map_char(k, map_char_box); 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"); default: return k; } @@ -519,4 +520,31 @@ class KeyModifier } } }; + + private static final Map_char map_char_bar = + new Map_char() { + public char apply(char c) + { + switch (c) + { + case 'b': return 'ƀ'; + case 'c': return 'ꞓ'; + case 'd': return 'đ'; + case 'g': return 'ǥ'; + case 'i': return 'ɨ'; + case 'j': return 'ɉ'; + case 'k': return 'ꝁ'; + case 'l': return 'ƚ'; + case 'o': return 'ɵ'; + case 'p': return 'ᵽ'; + case 'q': return 'ꝗ'; + case 'r': return 'ɍ'; + case 't': return 'ŧ'; + case 'u': return 'ʉ'; + case 'y': return 'ɏ'; + case 'z': return 'ƶ'; + default: return c; + } + } + }; } diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 86d53bb..989e7fe 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -47,6 +47,7 @@ final class KeyValue SLASH, ARROW_RIGHT, BREVE, + BAR, FN, // Must be placed last to be applied first } @@ -287,6 +288,7 @@ final class KeyValue addDiacritic("accent_slash", 0x5C, Modifier.SLASH); addDiacritic("accent_arrow_right", 0x5D, Modifier.ARROW_RIGHT); addDiacritic("accent_breve", 0x5E, Modifier.BREVE); + addDiacritic("accent_bar", 0x5F, Modifier.BAR); addModifierKey("superscript", "Sup", Modifier.SUPERSCRIPT, 0); addModifierKey("subscript", "Sub", Modifier.SUBSCRIPT, 0); addModifierKey("ordinal", "Ord", Modifier.ORDINAL, 0); diff --git a/srcs/special_font/5F.svg b/srcs/special_font/5F.svg new file mode 100644 index 0000000..c91c94f --- /dev/null +++ b/srcs/special_font/5F.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/srcs/special_font/result.ttf b/srcs/special_font/result.ttf index 1227f27850c14435fb2ef1f891ad5951733754f0..f81838f461415be7d0b605dd313e469d996a378f 100644 GIT binary patch delta 377 zcmW-d&nts*9LL|^?=xm`pf#FJJ&!$QD8I5bY$xX8B28Zh zIql%Ea!ZsxfQN{!r}pwHG+qRhbMkFlB4^d>w23Y+>87onVrKPzv4Q+Ipj|c6VzZR^ zh>`b56Eq0e@04fCvXRyeGaoNly^b(}DuMD&HYK8uOG6ZJL3+Uy1q=JQA>U70-4$j! zS=5$+P72^|E1Sy)N?+fAS0(@VzYG;h`ro(Do>uJoKhWg>>tfS#iG|sQJYiKEf5ogE z<-;U1{FwRVC$Gp;W!cu;3f#UZQCGJEv*_a$o}hXTw7~-nJs3m)6Ld{LbM?ruGuYU{ r3^rDlqD7ZAr?Y|iB9R|?<{IIY)9;?-Oqbi9IgS}w^GG{w(!cm0|CLrI delta 297 zcmZ2tb;6>afsuiMfrp`iftkU?qZdN!01Ct3*EGoII zM1et(sgi+#c>++LB|WjY;QxQ1P6inVAfF>Wr!uYh(eo6b{2c}c(SVH9#FWP955YjW zGeB&X0Tf_A%6toG77LKCl95{yS&{3;@f#?x0w~avlb@XEw#UZ+XuuR8-y=7%qJW`{ zVLeb@1ISm%OUzA8s8sZ0V35=SI!dx2zqsT}rRiY?25FFke}Fv$^w1GQOM!_u{MnVk z0?L#17-bn