From fab243a18317d234cd92f04dbf49c4508e2ba124 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" <takaoka@google.com> Date: Mon, 22 Nov 2010 22:51:59 -0800 Subject: [PATCH] Use normal font for functional key label instead of italic font This change also uses slightly larger font size for functional key label according to the v4 keyboard design. Bug: 3216592 Change-Id: I027f109b7748ade8564dc808487d9a6ce1da9761 --- java/res/values-xlarge/dimens.xml | 2 +- java/res/values/attrs.xml | 2 +- java/res/xml-xlarge/kbd_phone.xml | 8 ++++---- java/res/xml-xlarge/kbd_phone_symbols.xml | 8 ++++---- java/res/xml-xlarge/kbd_qwerty_row1.xml | 2 +- java/res/xml-xlarge/kbd_qwerty_row2.xml | 4 ++-- java/res/xml-xlarge/kbd_qwerty_row3.xml | 4 ++-- java/res/xml-xlarge/kbd_symbols.xml | 10 +++++----- java/res/xml-xlarge/kbd_symbols_shift.xml | 10 +++++----- .../android/inputmethod/latin/BaseKeyboardView.java | 9 +++------ 10 files changed, 28 insertions(+), 31 deletions(-) diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml index a53e45a321..1162a31722 100644 --- a/java/res/values-xlarge/dimens.xml +++ b/java/res/values-xlarge/dimens.xml @@ -35,7 +35,7 @@ <dimen name="mini_keyboard_vertical_correction">-13.0mm</dimen> <dimen name="key_text_size">0.175in</dimen> - <dimen name="key_label_text_size">0.100in</dimen> + <dimen name="key_label_text_size">0.110in</dimen> <dimen name="key_preview_text_size_large">0.245in</dimen> <dimen name="candidate_strip_height">46dip</dimen> diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 3f99cdae64..5f29af203f 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -112,7 +112,7 @@ <flag name="alignLeft" value="1" /> <flag name="alignRight" value="2" /> <flag name="alignBottom" value="8" /> - <flag name="fontItalic" value="16" /> + <flag name="fontNormal" value="16" /> </attr> <!-- The unicode that this key generates in manual temporary upper case mode. --> <attr name="manualTemporaryUpperCaseCode" format="integer" /> diff --git a/java/res/xml-xlarge/kbd_phone.xml b/java/res/xml-xlarge/kbd_phone.xml index 4bbd69d467..57575b6023 100644 --- a/java/res/xml-xlarge/kbd_phone.xml +++ b/java/res/xml-xlarge/kbd_phone.xml @@ -30,7 +30,7 @@ <Key latin:codes="@integer/key_tab" latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:isModifier="true" latin:keyEdgeFlags="left" /> <!-- To match one character label size with "Tab", I placed spaces around the char '-' @@ -61,7 +61,7 @@ <Key latin:codes="@integer/key_delete" latin:keyLabel="@string/label_backspace_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="14.706%p" latin:isModifier="true" latin:isRepeatable="true" @@ -71,7 +71,7 @@ <Key latin:codes="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:isModifier="true" latin:isSticky="true" latin:keyEdgeFlags="left" /> @@ -103,7 +103,7 @@ <Key latin:codes="@integer/key_return" latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="14.706%p" latin:isModifier="true" latin:keyEdgeFlags="right" /> diff --git a/java/res/xml-xlarge/kbd_phone_symbols.xml b/java/res/xml-xlarge/kbd_phone_symbols.xml index 8f496c0cb3..fea550414d 100644 --- a/java/res/xml-xlarge/kbd_phone_symbols.xml +++ b/java/res/xml-xlarge/kbd_phone_symbols.xml @@ -30,7 +30,7 @@ <Key latin:codes="@integer/key_tab" latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:isModifier="true" latin:keyEdgeFlags="left" /> <Spacer @@ -65,7 +65,7 @@ <Key latin:codes="@integer/key_delete" latin:keyLabel="@string/label_backspace_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="14.706%p" latin:isModifier="true" latin:isRepeatable="true" @@ -75,7 +75,7 @@ <Key latin:codes="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:isModifier="true" latin:isSticky="true" latin:keyEdgeFlags="left" /> @@ -111,7 +111,7 @@ <Key latin:codes="@integer/key_return" latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="14.706%p" latin:isModifier="true" latin:keyEdgeFlags="right" /> diff --git a/java/res/xml-xlarge/kbd_qwerty_row1.xml b/java/res/xml-xlarge/kbd_qwerty_row1.xml index 48e7b322f8..eca24b6e15 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row1.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row1.xml @@ -28,7 +28,7 @@ <Key latin:codes="@integer/key_tab" latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="7.949%p" latin:isModifier="true" latin:keyEdgeFlags="left" /> diff --git a/java/res/xml-xlarge/kbd_qwerty_row2.xml b/java/res/xml-xlarge/kbd_qwerty_row2.xml index f1df3f2d29..8dfb488858 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row2.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row2.xml @@ -27,7 +27,7 @@ <Key latin:codes="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="11.167%p" latin:isModifier="true" latin:keyEdgeFlags="left" /> @@ -62,7 +62,7 @@ <Key latin:codes="@integer/key_return" latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="15.750%p" latin:isModifier="true" latin:keyEdgeFlags="right" /> diff --git a/java/res/xml-xlarge/kbd_qwerty_row3.xml b/java/res/xml-xlarge/kbd_qwerty_row3.xml index d58f2c0d50..c26dcc4104 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row3.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row3.xml @@ -27,7 +27,7 @@ <Key latin:codes="@integer/key_shift" latin:keyLabel="@string/label_shift_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="15.192%p" latin:isModifier="true" latin:isSticky="true" @@ -83,7 +83,7 @@ <Key latin:codes="@integer/key_shift" latin:keyLabel="@string/label_shift_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="12.430%p" latin:isModifier="true" latin:isSticky="true" diff --git a/java/res/xml-xlarge/kbd_symbols.xml b/java/res/xml-xlarge/kbd_symbols.xml index 99f4d81005..00a61c51bd 100644 --- a/java/res/xml-xlarge/kbd_symbols.xml +++ b/java/res/xml-xlarge/kbd_symbols.xml @@ -31,7 +31,7 @@ <Key latin:codes="@integer/key_tab" latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="7.949%p" latin:isModifier="true" latin:keyEdgeFlags="left" /> @@ -84,7 +84,7 @@ <Key latin:codes="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="11.167%p" latin:isModifier="true" latin:keyEdgeFlags="left" /> @@ -123,7 +123,7 @@ <Key latin:codes="@integer/key_return" latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="15.750%p" latin:isModifier="true" latin:keyEdgeFlags="right" /> @@ -134,7 +134,7 @@ <Key latin:codes="@integer/key_shift" latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="15.192%p" latin:isModifier="true" latin:isSticky="true" @@ -169,7 +169,7 @@ latin:codes="@integer/key_shift" latin:keyLabel="@string/label_more_key" latin:iconPreview="@drawable/sym_keyboard_feedback_shift" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="12.430%p" latin:isModifier="true" latin:isSticky="true" diff --git a/java/res/xml-xlarge/kbd_symbols_shift.xml b/java/res/xml-xlarge/kbd_symbols_shift.xml index 016b0016eb..603b36b4ee 100644 --- a/java/res/xml-xlarge/kbd_symbols_shift.xml +++ b/java/res/xml-xlarge/kbd_symbols_shift.xml @@ -31,7 +31,7 @@ <Key latin:codes="@integer/key_tab" latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="7.949%p" latin:isModifier="true" latin:keyEdgeFlags="left" /> @@ -74,7 +74,7 @@ <Key latin:codes="@integer/key_switch_alpha_symbol" latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="11.167%p" latin:isModifier="true" latin:keyEdgeFlags="left" /> @@ -103,7 +103,7 @@ <Key latin:codes="@integer/key_return" latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="15.750%p" latin:isModifier="true" latin:keyEdgeFlags="right" /> @@ -114,7 +114,7 @@ <Key latin:codes="@integer/key_shift" latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontItalic|alignLeft|alignBottom" + latin:keyLabelOption="fontNormal|alignLeft|alignBottom" latin:keyWidth="15.192%p" latin:isModifier="true" latin:isSticky="true" @@ -144,7 +144,7 @@ <Key latin:codes="@integer/key_shift" latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontItalic|alignRight|alignBottom" + latin:keyLabelOption="fontNormal|alignRight|alignBottom" latin:keyWidth="12.430%p" latin:isModifier="true" latin:isSticky="true" diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java index 8efd0ae9a2..d98cd04b20 100644 --- a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java @@ -259,10 +259,7 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { private final int KEY_LABEL_OPTION_ALIGN_LEFT = 1; private final int KEY_LABEL_OPTION_ALIGN_RIGHT = 2; private final int KEY_LABEL_OPTION_ALIGN_BOTTOM = 8; - private final int KEY_LABEL_OPTION_FONT_ITALIC = 16; - // TODO: Currently we don't have san-serif italic type face. This is actually san-serif - // non-italic type face. - private final Typeface TYPEFACE_ITALIC = Typeface.create(Typeface.SANS_SERIF, Typeface.ITALIC); + private final int KEY_LABEL_OPTION_FONT_NORMAL = 16; private final UIHandler mHandler = new UIHandler(); @@ -825,8 +822,8 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { final int labelSize; if (label.length() > 1 && key.codes.length < 2) { labelSize = mLabelTextSize; - if ((key.labelOption & KEY_LABEL_OPTION_FONT_ITALIC) != 0) { - paint.setTypeface(TYPEFACE_ITALIC); + if ((key.labelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { + paint.setTypeface(Typeface.DEFAULT); } else { paint.setTypeface(Typeface.DEFAULT_BOLD); } -- GitLab