diff options
71 files changed, 309 insertions, 53 deletions
diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd index b08efd7..c538a31 100755 --- a/chrome/app/resources/locale_settings.grd +++ b/chrome/app/resources/locale_settings.grd @@ -232,6 +232,27 @@ 84% </message> + <!-- The UI font used in native UI components (e.g. menu). 'default' + indicates that the font obtained from the system be used. + Otherwise, the system default UI font will be overriden with + the family specified. This should be default for locales + other than Indian locales. + TODO(jungshik): This and IDS_UI_FONT_SIZE_SCALER are only used + on Windows now and are likely to be so in the future because Mac and + Linux fonts do not have the issue Windows fonts for some locales + (Indian) have. In that case, this need to be enclosed + by platform-dependent if-clause. --> + <message name="IDS_UI_FONT_FAMILY" use_name_for_id="true"> + default + </message> + + <!-- To get the actual UI font size for native UI components + (e.g. menu), the system UI font size is scaled with this value/100. + This should be 100 for most locales. --> + <message name="IDS_UI_FONT_SIZE_SCALER" use_name_for_id="true"> + 100 + </message> + <!-- The default value for HTTP Accept-Language header. --> <message name="IDS_ACCEPT_LANGUAGES" use_name_for_id="true"> en-US,en @@ -243,7 +264,7 @@ </message> <!-- The default value to determine whether - |WebPreference::standard_font_family| serif or sans-serif --> + |WebPreference::standard_font_family| is serif or sans-serif. --> <message name="IDS_STANDARD_FONT_IS_SERIF" use_name_for_id="true"> true </message> diff --git a/chrome/app/resources/locale_settings_ar.xtb b/chrome/app/resources/locale_settings_ar.xtb index d27dabc..2cb2803 100644 --- a/chrome/app/resources/locale_settings_ar.xtb +++ b/chrome/app/resources/locale_settings_ar.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ar"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ar,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1256</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_bg.xtb b/chrome/app/resources/locale_settings_bg.xtb index 84bac8f..ca1d437 100644 --- a/chrome/app/resources/locale_settings_bg.xtb +++ b/chrome/app/resources/locale_settings_bg.xtb @@ -3,6 +3,8 @@ <translationbundle lang="bg"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">bg-BG,bg</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_bn.xtb b/chrome/app/resources/locale_settings_bn.xtb index 0a418f1..3cd4f44 100644 --- a/chrome/app/resources/locale_settings_bn.xtb +++ b/chrome/app/resources/locale_settings_bn.xtb @@ -3,6 +3,8 @@ <translationbundle lang="bn"> <translation id="IDS_WEB_FONT_FAMILY">vrinda</translation> <translation id="IDS_WEB_FONT_SIZE">110%</translation> +<translation id="IDS_UI_FONT_FAMILY">vrinda</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">160</translation> <translation id="IDS_ACCEPT_LANGUAGES">bn-IN,bn,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ca.xtb b/chrome/app/resources/locale_settings_ca.xtb index 0df37cb..305ed75 100644 --- a/chrome/app/resources/locale_settings_ca.xtb +++ b/chrome/app/resources/locale_settings_ca.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ca"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ca-ES,ca</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_cs.xtb b/chrome/app/resources/locale_settings_cs.xtb index 3565b6c..df4bec9 100644 --- a/chrome/app/resources/locale_settings_cs.xtb +++ b/chrome/app/resources/locale_settings_cs.xtb @@ -3,6 +3,8 @@ <translationbundle lang="cs"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">cs-CZ,cs</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1250</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_da.xtb b/chrome/app/resources/locale_settings_da.xtb index 5130471..ed598a1 100644 --- a/chrome/app/resources/locale_settings_da.xtb +++ b/chrome/app/resources/locale_settings_da.xtb @@ -3,6 +3,8 @@ <translationbundle lang="da"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">da-DK,da,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_de.xtb b/chrome/app/resources/locale_settings_de.xtb index 7518983..7a88329 100644 --- a/chrome/app/resources/locale_settings_de.xtb +++ b/chrome/app/resources/locale_settings_de.xtb @@ -3,6 +3,8 @@ <translationbundle lang="de"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">de-DE,de,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_el.xtb b/chrome/app/resources/locale_settings_el.xtb index 92aa72d..5f8fff8 100644 --- a/chrome/app/resources/locale_settings_el.xtb +++ b/chrome/app/resources/locale_settings_el.xtb @@ -3,6 +3,8 @@ <translationbundle lang="el"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">el-GR,el</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-7</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_en-GB.xtb b/chrome/app/resources/locale_settings_en-GB.xtb index 0691d58..7b8e015 100644 --- a/chrome/app/resources/locale_settings_en-GB.xtb +++ b/chrome/app/resources/locale_settings_en-GB.xtb @@ -3,6 +3,8 @@ <translationbundle lang="en-GB"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">en-GB,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_es-419.xtb b/chrome/app/resources/locale_settings_es-419.xtb index 0c6281f..59fe654 100644 --- a/chrome/app/resources/locale_settings_es-419.xtb +++ b/chrome/app/resources/locale_settings_es-419.xtb @@ -3,6 +3,8 @@ <translationbundle lang="es-419"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">es-419,es</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_es.xtb b/chrome/app/resources/locale_settings_es.xtb index 5e0a031..9b9447f 100644 --- a/chrome/app/resources/locale_settings_es.xtb +++ b/chrome/app/resources/locale_settings_es.xtb @@ -3,6 +3,8 @@ <translationbundle lang="es"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">es-ES,es</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_et.xtb b/chrome/app/resources/locale_settings_et.xtb index 180d0f5..2467e52 100644 --- a/chrome/app/resources/locale_settings_et.xtb +++ b/chrome/app/resources/locale_settings_et.xtb @@ -3,6 +3,8 @@ <translationbundle lang="et"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">et-EE,et,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1257</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_fi.xtb b/chrome/app/resources/locale_settings_fi.xtb index 5aa14d7..194544f 100644 --- a/chrome/app/resources/locale_settings_fi.xtb +++ b/chrome/app/resources/locale_settings_fi.xtb @@ -3,6 +3,8 @@ <translationbundle lang="fi"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">fi-FI,fi,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_fil.xtb b/chrome/app/resources/locale_settings_fil.xtb index ac2ee3a..4baac0f 100644 --- a/chrome/app/resources/locale_settings_fil.xtb +++ b/chrome/app/resources/locale_settings_fil.xtb @@ -3,6 +3,8 @@ <translationbundle lang="fil"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">fil,fil-PH,tl,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_fr.xtb b/chrome/app/resources/locale_settings_fr.xtb index 68ce46a..ff38e1b 100644 --- a/chrome/app/resources/locale_settings_fr.xtb +++ b/chrome/app/resources/locale_settings_fr.xtb @@ -3,6 +3,8 @@ <translationbundle lang="fr"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">fr-FR,fr,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_gu.xtb b/chrome/app/resources/locale_settings_gu.xtb index f4fbfde..292593a 100644 --- a/chrome/app/resources/locale_settings_gu.xtb +++ b/chrome/app/resources/locale_settings_gu.xtb @@ -3,6 +3,8 @@ <translationbundle lang="gu"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">gu-IN,gu,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_he.xtb b/chrome/app/resources/locale_settings_he.xtb index a26c9c5..6cce8c7 100644 --- a/chrome/app/resources/locale_settings_he.xtb +++ b/chrome/app/resources/locale_settings_he.xtb @@ -3,6 +3,8 @@ <translationbundle lang="he"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">he-IL,he,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1255</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_hi.xtb b/chrome/app/resources/locale_settings_hi.xtb index 356ff66..8edaf91 100644 --- a/chrome/app/resources/locale_settings_hi.xtb +++ b/chrome/app/resources/locale_settings_hi.xtb @@ -3,6 +3,8 @@ <translationbundle lang="hi"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">140</translation> <translation id="IDS_ACCEPT_LANGUAGES">hi-IN,hi,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_hr.xtb b/chrome/app/resources/locale_settings_hr.xtb index 9fb762b..2c973bc 100644 --- a/chrome/app/resources/locale_settings_hr.xtb +++ b/chrome/app/resources/locale_settings_hr.xtb @@ -3,6 +3,8 @@ <translationbundle lang="hr"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">hr-HR,hr,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1250</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_hu.xtb b/chrome/app/resources/locale_settings_hu.xtb index c628fc1..6d39b69 100644 --- a/chrome/app/resources/locale_settings_hu.xtb +++ b/chrome/app/resources/locale_settings_hu.xtb @@ -3,6 +3,8 @@ <translationbundle lang="hu"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">hu-HU,hu,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_id.xtb b/chrome/app/resources/locale_settings_id.xtb index 4ae815c..79f20b4 100644 --- a/chrome/app/resources/locale_settings_id.xtb +++ b/chrome/app/resources/locale_settings_id.xtb @@ -3,6 +3,8 @@ <translationbundle lang="id"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">id-ID,id,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_it.xtb b/chrome/app/resources/locale_settings_it.xtb index 50ff2a2..6e168a3 100644 --- a/chrome/app/resources/locale_settings_it.xtb +++ b/chrome/app/resources/locale_settings_it.xtb @@ -3,6 +3,8 @@ <translationbundle lang="it"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">it-IT,it,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ja.xtb b/chrome/app/resources/locale_settings_ja.xtb index 87251d2..2033f84 100644 --- a/chrome/app/resources/locale_settings_ja.xtb +++ b/chrome/app/resources/locale_settings_ja.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ja"> <translation id="IDS_WEB_FONT_FAMILY">MS PGothic</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ja,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">Shift_JIS</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> diff --git a/chrome/app/resources/locale_settings_kn.xtb b/chrome/app/resources/locale_settings_kn.xtb index 447543d..d90bc73 100644 --- a/chrome/app/resources/locale_settings_kn.xtb +++ b/chrome/app/resources/locale_settings_kn.xtb @@ -3,6 +3,8 @@ <translationbundle lang="kn"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">kn-IN,kn,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ko.xtb b/chrome/app/resources/locale_settings_ko.xtb index 89442d8..1f44c2b 100644 --- a/chrome/app/resources/locale_settings_ko.xtb +++ b/chrome/app/resources/locale_settings_ko.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ko"> <translation id="IDS_WEB_FONT_FAMILY">Gulim</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ko-KR,ko,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-949</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> diff --git a/chrome/app/resources/locale_settings_lt.xtb b/chrome/app/resources/locale_settings_lt.xtb index 33ec66d..90e97ca 100644 --- a/chrome/app/resources/locale_settings_lt.xtb +++ b/chrome/app/resources/locale_settings_lt.xtb @@ -3,6 +3,8 @@ <translationbundle lang="lt"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">lt,en-US,en,ru,pl</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1257</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_lv.xtb b/chrome/app/resources/locale_settings_lv.xtb index 558b201..99c926a 100644 --- a/chrome/app/resources/locale_settings_lv.xtb +++ b/chrome/app/resources/locale_settings_lv.xtb @@ -3,6 +3,8 @@ <translationbundle lang="lv"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">lv-LV,lv,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1257</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ml.xtb b/chrome/app/resources/locale_settings_ml.xtb index 59f4151..c9c8a15 100644 --- a/chrome/app/resources/locale_settings_ml.xtb +++ b/chrome/app/resources/locale_settings_ml.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ml"> <translation id="IDS_WEB_FONT_FAMILY">Arial,AnjaliOldLipi,Rachana,Kartika</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">kartika</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">150</translation> <translation id="IDS_ACCEPT_LANGUAGES">ml-IN,ml,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> @@ -17,7 +19,7 @@ <translation id="IDS_MINIMUM_LOGICAL_FONT_SIZE">6</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> +<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">110</translation> <translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">36</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_BUGREPORT_DIALOG_WIDTH_CHARS">85</translation> diff --git a/chrome/app/resources/locale_settings_mr.xtb b/chrome/app/resources/locale_settings_mr.xtb index 87377fd..286becd 100644 --- a/chrome/app/resources/locale_settings_mr.xtb +++ b/chrome/app/resources/locale_settings_mr.xtb @@ -3,6 +3,8 @@ <translationbundle lang="mr"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">mr-IN,mr,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_nb.xtb b/chrome/app/resources/locale_settings_nb.xtb index aa59229..2111ff5 100644 --- a/chrome/app/resources/locale_settings_nb.xtb +++ b/chrome/app/resources/locale_settings_nb.xtb @@ -3,6 +3,8 @@ <translationbundle lang="no"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">nb-NO,nb,no,nn,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_nl.xtb b/chrome/app/resources/locale_settings_nl.xtb index 2bd6f0e..09f06b8 100644 --- a/chrome/app/resources/locale_settings_nl.xtb +++ b/chrome/app/resources/locale_settings_nl.xtb @@ -3,6 +3,8 @@ <translationbundle lang="nl"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">nl-NL,nl,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_or.xtb b/chrome/app/resources/locale_settings_or.xtb index a63f819..55c0ad4 100644 --- a/chrome/app/resources/locale_settings_or.xtb +++ b/chrome/app/resources/locale_settings_or.xtb @@ -3,6 +3,8 @@ <translationbundle lang="or"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">or-IN,or,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_pl.xtb b/chrome/app/resources/locale_settings_pl.xtb index 0f1e29d..39588ce 100644 --- a/chrome/app/resources/locale_settings_pl.xtb +++ b/chrome/app/resources/locale_settings_pl.xtb @@ -3,6 +3,8 @@ <translationbundle lang="pl"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">pl-PL,pl,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_pt-BR.xtb b/chrome/app/resources/locale_settings_pt-BR.xtb index 2673050..a96cc63 100644 --- a/chrome/app/resources/locale_settings_pt-BR.xtb +++ b/chrome/app/resources/locale_settings_pt-BR.xtb @@ -3,6 +3,8 @@ <translationbundle lang="pt-BR"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">pt-BR,pt,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_pt-PT.xtb b/chrome/app/resources/locale_settings_pt-PT.xtb index 2e91915..f155a87 100644 --- a/chrome/app/resources/locale_settings_pt-PT.xtb +++ b/chrome/app/resources/locale_settings_pt-PT.xtb @@ -3,6 +3,8 @@ <translationbundle lang="pt-PT"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">pt-PT,pt,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ro.xtb b/chrome/app/resources/locale_settings_ro.xtb index 5f05069..dfce74d 100644 --- a/chrome/app/resources/locale_settings_ro.xtb +++ b/chrome/app/resources/locale_settings_ro.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ro"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ro-RO,ro,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ru.xtb b/chrome/app/resources/locale_settings_ru.xtb index 8511d3e6..1c2b348 100644 --- a/chrome/app/resources/locale_settings_ru.xtb +++ b/chrome/app/resources/locale_settings_ru.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ru"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ru-RU,ru,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_sk.xtb b/chrome/app/resources/locale_settings_sk.xtb index e086a85..45d499e8 100644 --- a/chrome/app/resources/locale_settings_sk.xtb +++ b/chrome/app/resources/locale_settings_sk.xtb @@ -3,6 +3,8 @@ <translationbundle lang="sk"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">sk-SK,sk,cs,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1250</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_sl.xtb b/chrome/app/resources/locale_settings_sl.xtb index be71407..04c52bd 100644 --- a/chrome/app/resources/locale_settings_sl.xtb +++ b/chrome/app/resources/locale_settings_sl.xtb @@ -3,6 +3,8 @@ <translationbundle lang="sl"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">sl-SI,sl,en-GB,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_sr.xtb b/chrome/app/resources/locale_settings_sr.xtb index 3029bc0..ff5aa7b 100644 --- a/chrome/app/resources/locale_settings_sr.xtb +++ b/chrome/app/resources/locale_settings_sr.xtb @@ -3,6 +3,8 @@ <translationbundle lang="sr"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">sr-RS,sr,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_sv.xtb b/chrome/app/resources/locale_settings_sv.xtb index 57643cc..df5a539 100644 --- a/chrome/app/resources/locale_settings_sv.xtb +++ b/chrome/app/resources/locale_settings_sv.xtb @@ -3,6 +3,8 @@ <translationbundle lang="sv"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">sv-SE,sv,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_ta.xtb b/chrome/app/resources/locale_settings_ta.xtb index 171fd07..769dcfb 100644 --- a/chrome/app/resources/locale_settings_ta.xtb +++ b/chrome/app/resources/locale_settings_ta.xtb @@ -3,6 +3,8 @@ <translationbundle lang="ta"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">ta-IN,ta,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_te.xtb b/chrome/app/resources/locale_settings_te.xtb index 2ddce15..5eb22eb 100644 --- a/chrome/app/resources/locale_settings_te.xtb +++ b/chrome/app/resources/locale_settings_te.xtb @@ -3,6 +3,8 @@ <translationbundle lang="te"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">130</translation> <translation id="IDS_ACCEPT_LANGUAGES">te-IN,te,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_th.xtb b/chrome/app/resources/locale_settings_th.xtb index 83f33e1..b47c430 100644 --- a/chrome/app/resources/locale_settings_th.xtb +++ b/chrome/app/resources/locale_settings_th.xtb @@ -3,6 +3,8 @@ <translationbundle lang="th"> <translation id="IDS_WEB_FONT_FAMILY">tahoma</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">th-TH,th</translation> <translation id="IDS_DEFAULT_ENCODING">windows-874</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_tr.xtb b/chrome/app/resources/locale_settings_tr.xtb index b303ecb..94ae8f6 100644 --- a/chrome/app/resources/locale_settings_tr.xtb +++ b/chrome/app/resources/locale_settings_tr.xtb @@ -3,6 +3,8 @@ <translationbundle lang="tr"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">tr-TR,tr,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">ISO-8859-9</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_uk.xtb b/chrome/app/resources/locale_settings_uk.xtb index 25926a2..47713c1 100644 --- a/chrome/app/resources/locale_settings_uk.xtb +++ b/chrome/app/resources/locale_settings_uk.xtb @@ -3,6 +3,8 @@ <translationbundle lang="uk"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">uk-UA,uk,ru,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_vi.xtb b/chrome/app/resources/locale_settings_vi.xtb index 05c4935..b9e65d8 100644 --- a/chrome/app/resources/locale_settings_vi.xtb +++ b/chrome/app/resources/locale_settings_vi.xtb @@ -3,6 +3,8 @@ <translationbundle lang="vi"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">vi-VN,vi,fr-FR,fr,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">windows-1258</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">true</translation> diff --git a/chrome/app/resources/locale_settings_zh-CN.xtb b/chrome/app/resources/locale_settings_zh-CN.xtb index 6917d25..1332d0f 100644 --- a/chrome/app/resources/locale_settings_zh-CN.xtb +++ b/chrome/app/resources/locale_settings_zh-CN.xtb @@ -3,6 +3,8 @@ <translationbundle lang="zh-CN"> <translation id="IDS_WEB_FONT_FAMILY">Simsun</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">zh-CN,zh</translation> <translation id="IDS_DEFAULT_ENCODING">GBK</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> diff --git a/chrome/app/resources/locale_settings_zh-TW.xtb b/chrome/app/resources/locale_settings_zh-TW.xtb index e3324d7..3ce54ec 100644 --- a/chrome/app/resources/locale_settings_zh-TW.xtb +++ b/chrome/app/resources/locale_settings_zh-TW.xtb @@ -3,6 +3,8 @@ <translationbundle lang="zh-TW"> <translation id="IDS_WEB_FONT_FAMILY">Arial</translation> <translation id="IDS_WEB_FONT_SIZE">84%</translation> +<translation id="IDS_UI_FONT_FAMILY">default</translation> +<translation id="IDS_UI_FONT_SIZE_SCALER">100</translation> <translation id="IDS_ACCEPT_LANGUAGES">zh-TW,zh,en-US,en</translation> <translation id="IDS_DEFAULT_ENCODING">Big5</translation> <translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index a6cd377..95bfd91 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -267,12 +267,12 @@ class ConstrainedWindowFrameView static void InitClass(); // The font to be used to render the titlebar text. - static ChromeFont title_font_; + static ChromeFont* title_font_; DISALLOW_EVIL_CONSTRUCTORS(ConstrainedWindowFrameView); }; -ChromeFont ConstrainedWindowFrameView::title_font_; +ChromeFont* ConstrainedWindowFrameView::title_font_ = NULL; namespace { // The frame border is only visible in restored mode and is hardcoded to 4 px on @@ -461,7 +461,7 @@ int ConstrainedWindowFrameView::TitleCoordinates( // The bottom spacing should be the same apparent height as the top spacing, // plus have the client edge tacked on. int title_bottom_spacing = *title_top_spacing + kClientEdgeThickness; - *title_thickness = std::max(title_font_.height(), + *title_thickness = std::max(title_font_->height(), min_titlebar_height - *title_top_spacing - title_bottom_spacing); return *title_top_spacing + *title_thickness + title_bottom_spacing; } @@ -511,7 +511,7 @@ void ConstrainedWindowFrameView::PaintFrameBorder(ChromeCanvas* canvas) { } void ConstrainedWindowFrameView::PaintTitleBar(ChromeCanvas* canvas) { - canvas->DrawStringInt(container_->GetWindowTitle(), title_font_, + canvas->DrawStringInt(container_->GetWindowTitle(), *title_font_, GetTitleColor(), MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), title_bounds_.width(), title_bounds_.height()); } @@ -545,9 +545,9 @@ void ConstrainedWindowFrameView::LayoutTitleBar() { int title_top_spacing, title_thickness; TitleCoordinates(&title_top_spacing, &title_thickness); title_bounds_.SetRect(title_x, - title_top_spacing + ((title_thickness - title_font_.height()) / 2), + title_top_spacing + ((title_thickness - title_font_->height()) / 2), std::max(0, close_button_->x() - kTitleCaptionSpacing - title_x), - title_font_.height()); + title_font_->height()); } void ConstrainedWindowFrameView::LayoutClientView() { @@ -580,7 +580,7 @@ void ConstrainedWindowFrameView::InitWindowResources() { void ConstrainedWindowFrameView::InitClass() { static bool initialized = false; if (!initialized) { - title_font_ = win_util::GetWindowTitleFont(); + title_font_ = new ChromeFont(win_util::GetWindowTitleFont()); initialized = true; } diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 2e8658c..9e8692b 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -259,7 +259,7 @@ views::WindowResources* OpaqueBrowserFrameView::inactive_resources_ = NULL; views::WindowResources* OpaqueBrowserFrameView::active_otr_resources_ = NULL; views::WindowResources* OpaqueBrowserFrameView::inactive_otr_resources_ = NULL; SkBitmap* OpaqueBrowserFrameView::distributor_logo_ = NULL; -ChromeFont OpaqueBrowserFrameView::title_font_; +ChromeFont* OpaqueBrowserFrameView::title_font_ = NULL; namespace { // The frame border is only visible in restored mode and is hardcoded to 4 px on @@ -703,7 +703,7 @@ int OpaqueBrowserFrameView::TitleCoordinates(int* title_top_spacing, *title_top_spacing += title_adjust; title_bottom_spacing -= title_adjust; } - *title_thickness = std::max(title_font_.height(), + *title_thickness = std::max(title_font_->height(), min_titlebar_height - *title_top_spacing - title_bottom_spacing); return *title_top_spacing + *title_thickness + title_bottom_spacing + UnavailablePixelsAtBottomOfNonClientHeight(); @@ -788,7 +788,7 @@ void OpaqueBrowserFrameView::PaintTitleBar(ChromeCanvas* canvas) { // The window icon is painted by the TabIconView. views::WindowDelegate* d = frame_->GetDelegate(); if (d->ShouldShowWindowTitle()) { - canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, + canvas->DrawStringInt(d->GetWindowTitle(), *title_font_, SK_ColorWHITE, MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), title_bounds_.width(), title_bounds_.height()); /* TODO(pkasting): If this window is active, we should also draw a drop @@ -970,6 +970,7 @@ void OpaqueBrowserFrameView::LayoutTitleBar() { // The usable height of the titlebar area is the total height minus the top // resize border and any edge area we draw at its bottom. int title_top_spacing, title_thickness; + InitAppWindowResources(); int top_height = TitleCoordinates(&title_top_spacing, &title_thickness); int available_height = top_height - frame_thickness - UnavailablePixelsAtBottomOfNonClientHeight(); @@ -1001,9 +1002,9 @@ void OpaqueBrowserFrameView::LayoutTitleBar() { int title_x = icon_x + icon_size + (d->ShouldShowWindowIcon() ? kIconTitleSpacing : 0); title_bounds_.SetRect(title_x, - title_top_spacing + ((title_thickness - title_font_.height()) / 2), + title_top_spacing + ((title_thickness - title_font_->height()) / 2), std::max(0, logo_bounds_.x() - kTitleLogoSpacing - title_x), - title_font_.height()); + title_font_->height()); } } @@ -1057,7 +1058,7 @@ void OpaqueBrowserFrameView::InitClass() { void OpaqueBrowserFrameView::InitAppWindowResources() { static bool initialized = false; if (!initialized) { - title_font_ = win_util::GetWindowTitleFont(); + title_font_ = new ChromeFont(win_util::GetWindowTitleFont()); initialized = true; } } diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h index 83a84c5..fd80b7c 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/views/frame/opaque_browser_frame_view.h @@ -158,7 +158,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, static views::WindowResources* inactive_resources_; static views::WindowResources* active_otr_resources_; static views::WindowResources* inactive_otr_resources_; - static ChromeFont title_font_; + static ChromeFont* title_font_; DISALLOW_EVIL_CONSTRUCTORS(OpaqueBrowserFrameView); }; diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc index d7e2de4..509f951 100644 --- a/chrome/browser/views/sad_tab_view.cc +++ b/chrome/browser/views/sad_tab_view.cc @@ -25,8 +25,8 @@ static const SkColor kBackgroundEndColor = SkColorSetRGB(35, 48, 64); // static SkBitmap* SadTabView::sad_tab_bitmap_ = NULL; -ChromeFont SadTabView::title_font_; -ChromeFont SadTabView::message_font_; +ChromeFont* SadTabView::title_font_ = NULL; +ChromeFont* SadTabView::message_font_ = NULL; std::wstring SadTabView::title_; std::wstring SadTabView::message_; int SadTabView::title_width_; @@ -47,12 +47,12 @@ void SadTabView::Paint(ChromeCanvas* canvas) { canvas->DrawBitmapInt(*sad_tab_bitmap_, icon_bounds_.x(), icon_bounds_.y()); - canvas->DrawStringInt(title_, title_font_, kTitleColor, title_bounds_.x(), + canvas->DrawStringInt(title_, *title_font_, kTitleColor, title_bounds_.x(), title_bounds_.y(), title_bounds_.width(), title_bounds_.height(), ChromeCanvas::TEXT_ALIGN_CENTER); - canvas->DrawStringInt(message_, message_font_, kMessageColor, + canvas->DrawStringInt(message_, *message_font_, kMessageColor, message_bounds_.x(), message_bounds_.y(), message_bounds_.width(), message_bounds_.height(), ChromeCanvas::MULTI_LINE); @@ -67,13 +67,13 @@ void SadTabView::Layout() { int title_x = (width() - title_width_) / 2; int title_y = icon_bounds_.bottom() + kIconTitleSpacing; - int title_height = title_font_.height(); + int title_height = title_font_->height(); title_bounds_.SetRect(title_x, title_y, title_width_, title_height); ChromeCanvas cc(0, 0, true); int message_width = static_cast<int>(width() * kMessageSize); int message_height = 0; - cc.SizeStringInt(message_, message_font_, &message_width, &message_height, + cc.SizeStringInt(message_, *message_font_, &message_width, &message_height, ChromeCanvas::MULTI_LINE); int message_x = (width() - message_width) / 2; int message_y = title_bounds_.bottom() + kTitleMessageSpacing; @@ -85,13 +85,14 @@ void SadTabView::InitClass() { static bool initialized = false; if (!initialized) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - title_font_ = rb.GetFont(ResourceBundle::BaseFont). - DeriveFont(2, ChromeFont::BOLD); - message_font_ = rb.GetFont(ResourceBundle::BaseFont).DeriveFont(1); + title_font_ = new ChromeFont( + rb.GetFont(ResourceBundle::BaseFont).DeriveFont(2, ChromeFont::BOLD)); + message_font_ = new ChromeFont( + rb.GetFont(ResourceBundle::BaseFont).DeriveFont(1)); sad_tab_bitmap_ = rb.GetBitmapNamed(IDR_SAD_TAB); title_ = l10n_util::GetString(IDS_SAD_TAB_TITLE); - title_width_ = title_font_.GetStringWidth(title_); + title_width_ = title_font_->GetStringWidth(title_); message_ = l10n_util::GetString(IDS_SAD_TAB_MESSAGE); initialized = true; diff --git a/chrome/browser/views/sad_tab_view.h b/chrome/browser/views/sad_tab_view.h index 5b2f7e7..766ad77 100644 --- a/chrome/browser/views/sad_tab_view.h +++ b/chrome/browser/views/sad_tab_view.h @@ -39,8 +39,8 @@ class SadTabView : public views::View { // Assorted resources for display. static SkBitmap* sad_tab_bitmap_; - static ChromeFont title_font_; - static ChromeFont message_font_; + static ChromeFont* title_font_; + static ChromeFont* message_font_; static std::wstring title_; static std::wstring message_; static int title_width_; diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index e2d6381..88033a4 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -46,7 +46,7 @@ static const double kHoverOpacity = 0.33; static const double kHoverOpacityVista = 0.7; // TODO(beng): (Cleanup) This stuff should move onto the class. -static ChromeFont title_font; +static ChromeFont* title_font = NULL; static int title_font_height = 0; static SkBitmap* close_button_n = NULL; static SkBitmap* close_button_h = NULL; @@ -74,8 +74,8 @@ void InitResources() { static bool initialized = false; if (!initialized) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - title_font = rb.GetFont(ResourceBundle::BaseFont); - title_font_height = title_font.height(); + title_font = new ChromeFont(rb.GetFont(ResourceBundle::BaseFont)); + title_font_height = title_font->height(); close_button_n = rb.GetBitmapNamed(IDR_TAB_CLOSE); close_button_h = rb.GetBitmapNamed(IDR_TAB_CLOSE_H); @@ -413,7 +413,7 @@ void TabRenderer::Paint(ChromeCanvas* canvas) { SkColor title_color = IsSelected() ? kSelectedTitleColor : kUnselectedTitleColor; - canvas->DrawStringInt(title, title_font, title_color, title_bounds_.x(), + canvas->DrawStringInt(title, *title_font, title_color, title_bounds_.x(), title_bounds_.y(), title_bounds_.width(), title_bounds_.height()); } diff --git a/chrome/common/gfx/chrome_font_win.cc b/chrome/common/gfx/chrome_font_win.cc index 6fd6753..acfc40e 100644 --- a/chrome/common/gfx/chrome_font_win.cc +++ b/chrome/common/gfx/chrome_font_win.cc @@ -11,7 +11,7 @@ #include "base/logging.h" #include "base/win_util.h" -#include "chrome/common/l10n_util.h" +#include "chrome/common/l10n_util_win.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -78,7 +78,12 @@ ChromeFont::HFontRef* ChromeFont::GetBaseFontRef() { NONCLIENTMETRICS metrics; win_util::GetNonClientMetrics(&metrics); + l10n_util::AdjustUIFont(&metrics.lfMessageFont); + // See comment in ChromeFont::DeriveFont() about font size. + // TODO(jungshik): Add a per-locale resource entry for the minimum + // font size and actually enforce the lower-bound. 5 is way too small + // for CJK, Thai, and Indian locales. DCHECK_GE(abs(metrics.lfMessageFont.lfHeight), 5); HFONT font = CreateFontIndirect(&metrics.lfMessageFont); DLOG_ASSERT(font); diff --git a/chrome/common/l10n_util_win.cc b/chrome/common/l10n_util_win.cc index 4c49bf6..9cc3880 100644 --- a/chrome/common/l10n_util_win.cc +++ b/chrome/common/l10n_util_win.cc @@ -5,8 +5,37 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/l10n_util_win.h" +#include <algorithm> +#include <windowsx.h> + +#include "base/string_util.h" #include "base/win_util.h" +#include "grit/locale_settings.h" + +namespace { + +void AdjustLogFont(const std::wstring& font_family, + double font_size_scaler, + LOGFONT* logfont) { + DCHECK(font_size_scaler > 0); + font_size_scaler = std::max(std::min(font_size_scaler, 2.0), 0.7); + logfont->lfHeight = static_cast<long>(font_size_scaler * + static_cast<double>(abs(logfont->lfHeight)) + 0.5) * + (logfont->lfHeight > 0 ? 1 : -1); + + // TODO(jungshik): We may want to check the existence of the font. + // If it's not installed, we shouldn't adjust the font. + if (font_family != L"default") { + int name_len = std::min(static_cast<int>(font_family.size()), + LF_FACESIZE -1); + memcpy(logfont->lfFaceName, font_family.data(), name_len * sizeof(WORD)); + logfont->lfFaceName[name_len] = 0; + } +} + +} // namespace + namespace l10n_util { int GetExtendedStyles() { @@ -39,4 +68,43 @@ bool IsLocaleSupportedByOS(const std::wstring& locale) { win_util::GetWinVersion() < win_util::WINVERSION_VISTA); } +bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, + double* font_size_scaler) { + // This is rather simple-minded to deal with the UI font size + // issue for some Indian locales (ml, bn, hi) for which the default + // Windows fonts are too small to be legible. For those locales, + // IDS_UI_FONT_FAMILY is set to an actual font family to use while + // for other locales, it's set to 'default'. + std::wstring ui_font_family = GetString(IDS_UI_FONT_FAMILY); + int scaler100 = StringToInt(l10n_util::GetString(IDS_UI_FONT_SIZE_SCALER)); + if (ui_font_family == L"default" && scaler100 == 100) + return false; + if (override_font_family && font_size_scaler) { + override_font_family->swap(ui_font_family); + *font_size_scaler = scaler100 / 100.0; + } + return true; +} + +void AdjustUIFont(LOGFONT* logfont) { + std::wstring ui_font_family; + double ui_font_size_scaler; + if (NeedOverrideDefaultUIFont(&ui_font_family, &ui_font_size_scaler)) + AdjustLogFont(ui_font_family, ui_font_size_scaler, logfont); +} + +void AdjustUIFontForWindow(HWND hwnd) { + std::wstring ui_font_family; + double ui_font_size_scaler; + if (NeedOverrideDefaultUIFont(&ui_font_family, &ui_font_size_scaler)) { + LOGFONT logfont; + if (GetObject(GetWindowFont(hwnd), sizeof(logfont), &logfont)) { + AdjustLogFont(ui_font_family, ui_font_size_scaler, &logfont); + HFONT hfont = CreateFontIndirect(&logfont); + if (hfont) + SetWindowFont(hwnd, hfont, FALSE); + } + } +} + } // namespace l10n_util diff --git a/chrome/common/l10n_util_win.h b/chrome/common/l10n_util_win.h index c99a7f8..acfb209 100644 --- a/chrome/common/l10n_util_win.h +++ b/chrome/common/l10n_util_win.h @@ -26,6 +26,26 @@ int GetExtendedTooltipStyles(); // such as Hebrew. void HWNDSetRTLLayout(HWND hwnd); +// See http://blogs.msdn.com/oldnewthing/archive/2005/09/15/467598.aspx +// and http://blogs.msdn.com/oldnewthing/archive/2006/06/26/647365.aspx +// as to why we need these three functions. + +// Return true if the default font (we get from Windows) is not suitable +// to use in the UI of the current UI (e.g. Malayalam, Bengali). If +// override_font_family and font_size_scaler are not null, they'll be +// filled with the font family name and the size scaler. +bool NeedOverrideDefaultUIFont(std::wstring* override_font_family, + double* font_size_scaler); + +// If the default UI font stored in |logfont| is not suitable, its family +// and size are replaced with those stored in the per-locale resource. +void AdjustUIFont(LOGFONT* logfont); + +// If the font for a given window (pointed to by HWND) is not suitable for the +// UI in the current UI langauge, its family and size are replaced with those +// stored in the per-locale resource. +void AdjustUIFontForWindow(HWND hwnd); + } // namespace l10n_util #endif // CHROME_COMMON_L10N_UTIL_WIN_H_ diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc index 3facfb8..98d0c48 100644 --- a/chrome/common/win_util.cc +++ b/chrome/common/win_util.cc @@ -20,6 +20,7 @@ #include "base/string_util.h" #include "base/win_util.h" #include "chrome/common/l10n_util.h" +#include "chrome/common/l10n_util_win.h" #include "grit/generated_resources.h" #include "net/base/mime_util.h" @@ -810,6 +811,7 @@ int MessageBox(HWND hwnd, ChromeFont GetWindowTitleFont() { NONCLIENTMETRICS ncm; win_util::GetNonClientMetrics(&ncm); + l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); return ChromeFont::CreateFont(caption_font); } diff --git a/chrome/views/controls/menu/chrome_menu.cc b/chrome/views/controls/menu/chrome_menu.cc index 6373cde..64bee99 100644 --- a/chrome/views/controls/menu/chrome_menu.cc +++ b/chrome/views/controls/menu/chrome_menu.cc @@ -19,6 +19,7 @@ #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/color_utils.h" #include "chrome/common/l10n_util.h" +#include "chrome/common/l10n_util_win.h" #include "chrome/common/os_exchange_data.h" #include "chrome/views/border.h" #include "chrome/views/view_constants.h" @@ -129,6 +130,7 @@ ChromeFont GetMenuFont() { NONCLIENTMETRICS metrics; win_util::GetNonClientMetrics(&metrics); + l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); HFONT font = CreateFontIndirect(&metrics.lfMenuFont); DLOG_ASSERT(font); return ChromeFont::CreateFont(font); diff --git a/chrome/views/controls/menu/menu.cc b/chrome/views/controls/menu/menu.cc index 3c290f7..3b1d836 100644 --- a/chrome/views/controls/menu/menu.cc +++ b/chrome/views/controls/menu/menu.cc @@ -112,6 +112,9 @@ class MenuHostWindow : public CWindowImpl<MenuHostWindow, CWindow, GetSystemMetrics(SM_CXMENUCHECK); if (data->submenu) lpmis->itemWidth += kArrowWidth; + // If the label contains an accelerator, make room for tab. + if (data->label.find(L'\t') != std::wstring::npos) + lpmis->itemWidth += font.GetStringWidth(L" "); lpmis->itemHeight = font.height() + kItemBottomMargin + kItemTopMargin; } else { // Measure separator size. @@ -139,7 +142,6 @@ class MenuHostWindow : public CWindowImpl<MenuHostWindow, CWindow, if (lpdis->itemData) { Menu::ItemData* data = reinterpret_cast<Menu::ItemData*>(lpdis->itemData); - wchar_t* str = const_cast<wchar_t*>(data->label.c_str()); // Draw the background. HBRUSH hbr = CreateSolidBrush(GetBkColor(hDC)); @@ -149,15 +151,38 @@ class MenuHostWindow : public CWindowImpl<MenuHostWindow, CWindow, // Draw the label. RECT rect = lpdis->rcItem; rect.top += kItemTopMargin; + // Should we add kIconWidth only when icon.width() != 0 ? rect.left += kItemLeftMargin + kIconWidth; - UINT format = DT_TOP | DT_LEFT | DT_SINGLELINE; + rect.right -= kItemRightMargin; + UINT format = DT_TOP | DT_SINGLELINE; // Check whether the mnemonics should be underlined. BOOL underline_mnemonics; SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &underline_mnemonics, 0); if (!underline_mnemonics) format |= DT_HIDEPREFIX; - DrawTextEx(hDC, str, static_cast<int>(data->label.size()), - &rect, format, NULL); + ChromeFont font; + HGDIOBJ old_font = static_cast<HFONT>(SelectObject(hDC, font.hfont())); + int fontsize = font.FontSize(); + + // If an accelerator is specified (with a tab delimiting the rest + // of the label from the accelerator), we have to justify + // the fist part on the left and the accelerator on the right. + // TODO(jungshik): This will break in RTL UI. Currently, he/ar + // use the window system UI font and will not hit here. + std::wstring label = data->label; + std::wstring accel; + std::wstring::size_type tab_pos = label.find(L'\t'); + if (tab_pos != std::wstring::npos) { + accel = label.substr(tab_pos); + label = label.substr(0, tab_pos); + } + DrawTextEx(hDC, const_cast<wchar_t*>(label.data()), + static_cast<int>(label.size()), &rect, format | DT_LEFT, NULL); + if (!accel.empty()) + DrawTextEx(hDC, const_cast<wchar_t*>(accel.data()), + static_cast<int>(accel.size()), &rect, + format | DT_RIGHT, NULL); + SelectObject(hDC, old_font); // Draw the icon after the label, otherwise it would be covered // by the label. @@ -219,7 +244,7 @@ Menu::Menu(Delegate* delegate, AnchorPoint anchor, HWND owner) anchor_(anchor), owner_(owner), is_menu_visible_(false), - owner_draw_(false) { + owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL)) { DCHECK(delegate_); } @@ -229,7 +254,7 @@ Menu::Menu(Menu* parent) anchor_(parent->anchor_), owner_(parent->owner_), is_menu_visible_(false), - owner_draw_(false) { + owner_draw_(parent->owner_draw_) { } Menu::Menu(HMENU hmenu) diff --git a/chrome/views/controls/table/table_view.cc b/chrome/views/controls/table/table_view.cc index 1a01acc..35a0140 100644 --- a/chrome/views/controls/table/table_view.cc +++ b/chrome/views/controls/table/table_view.cc @@ -12,6 +12,7 @@ #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/favicon_size.h" #include "chrome/common/gfx/icon_util.h" +#include "chrome/common/l10n_util_win.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/win_util.h" #include "chrome/views/controls/hwnd_view.h" @@ -823,6 +824,7 @@ HWND TableView::CreateNativeControl(HWND parent_container) { if (table_type_ == CHECK_BOX_AND_TEXT) list_view_style |= LVS_EX_CHECKBOXES; ListView_SetExtendedListViewStyleEx(list_view_, 0, list_view_style); + l10n_util::AdjustUIFontForWindow(list_view_); // Add the columns. for (std::vector<int>::iterator i = visible_columns_.begin(); @@ -1203,6 +1205,7 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { // with a bool like we do with colors? if (custom_cell_font_) DeleteObject(custom_cell_font_); + l10n_util::AdjustUIFont(&logfont); custom_cell_font_ = CreateFontIndirect(&logfont); SelectObject(draw_info->nmcd.hdc, custom_cell_font_); draw_info->clrText = foreground.color_is_set diff --git a/chrome/views/controls/tree/tree_view.cc b/chrome/views/controls/tree/tree_view.cc index cf4f147..8c130bd 100644 --- a/chrome/views/controls/tree/tree_view.cc +++ b/chrome/views/controls/tree/tree_view.cc @@ -10,6 +10,7 @@ #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/icon_util.h" #include "chrome/common/l10n_util.h" +#include "chrome/common/l10n_util_win.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/stl_util-inl.h" #include "chrome/views/focus/focus_manager.h" @@ -346,6 +347,8 @@ HWND TreeView::CreateNativeControl(HWND parent_container) { reinterpret_cast<LONG_PTR>(&wrapper_)); original_handler_ = win_util::SetWindowProc(tree_view_, &TreeWndProc); + l10n_util::AdjustUIFontForWindow(tree_view_); + if (model_) { CreateRootItems(); model_->SetObserver(this); diff --git a/chrome/views/widget/aero_tooltip_manager.cc b/chrome/views/widget/aero_tooltip_manager.cc index bd6404d..e6ed9da 100644 --- a/chrome/views/widget/aero_tooltip_manager.cc +++ b/chrome/views/widget/aero_tooltip_manager.cc @@ -72,6 +72,9 @@ void AeroTooltipManager::Init() { WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles(), TOOLTIPS_CLASS, NULL, TTS_NOPREFIX, 0, 0, 0, 0, parent_, NULL, NULL, NULL); + + l10n_util::AdjustUIFontForWindow(tooltip_hwnd_); + // Add one tool that is used for all tooltips. toolinfo_.cbSize = sizeof(toolinfo_); diff --git a/chrome/views/widget/tooltip_manager.cc b/chrome/views/widget/tooltip_manager.cc index 200b8da..dd63196 100644 --- a/chrome/views/widget/tooltip_manager.cc +++ b/chrome/views/widget/tooltip_manager.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/views/widget/tooltip_manager.h" + #include <limits> -#include "chrome/common/gfx/chrome_font.h" #include "base/logging.h" #include "base/message_loop.h" #include "chrome/common/l10n_util.h" @@ -13,7 +14,6 @@ #include "chrome/common/win_util.h" #include "chrome/views/view.h" #include "chrome/views/widget/root_view.h" -#include "chrome/views/widget/tooltip_manager.h" #include "chrome/views/widget/widget.h" namespace views { @@ -107,6 +107,8 @@ void TooltipManager::Init() { TOOLTIPS_CLASS, NULL, TTS_NOPREFIX, 0, 0, 0, 0, parent_, NULL, NULL, NULL); + l10n_util::AdjustUIFontForWindow(tooltip_hwnd_); + // This effectively turns off clipping of tooltips. We need this otherwise // multi-line text (\r\n) won't work right. The size doesn't really matter // (just as long as its bigger than the monitor's width) as we clip to the diff --git a/chrome/views/widget/tooltip_manager.h b/chrome/views/widget/tooltip_manager.h index 312e30e..03e56a1 100644 --- a/chrome/views/widget/tooltip_manager.h +++ b/chrome/views/widget/tooltip_manager.h @@ -6,8 +6,11 @@ #define CHROME_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ #include <windows.h> +#include <commctrl.h> + #include <string> #include "base/basictypes.h" +#include "base/task.h" class ChromeFont; diff --git a/chrome/views/window/custom_frame_view.cc b/chrome/views/window/custom_frame_view.cc index 9c02f72..b1ef417 100644 --- a/chrome/views/window/custom_frame_view.cc +++ b/chrome/views/window/custom_frame_view.cc @@ -106,7 +106,6 @@ class ActiveWindowResources : public WindowResources { } static SkBitmap* standard_frame_bitmaps_[FRAME_PART_BITMAP_COUNT]; - static ChromeFont title_font_; DISALLOW_EVIL_CONSTRUCTORS(ActiveWindowResources); }; @@ -168,7 +167,7 @@ SkBitmap* InactiveWindowResources::standard_frame_bitmaps_[]; // static WindowResources* CustomFrameView::active_resources_ = NULL; WindowResources* CustomFrameView::inactive_resources_ = NULL; -ChromeFont CustomFrameView::title_font_; +ChromeFont* CustomFrameView::title_font_ = NULL; namespace { // The frame border is only visible in restored mode and is hardcoded to 4 px on @@ -433,7 +432,7 @@ int CustomFrameView::TitleCoordinates(int* title_top_spacing, *title_top_spacing += title_adjust; title_bottom_spacing -= title_adjust; } - *title_thickness = std::max(title_font_.height(), + *title_thickness = std::max(title_font_->height(), min_titlebar_height - *title_top_spacing - title_bottom_spacing); return *title_top_spacing + *title_thickness + title_bottom_spacing + BottomEdgeThicknessWithinNonClientHeight(); @@ -506,7 +505,7 @@ void CustomFrameView::PaintTitleBar(ChromeCanvas* canvas) { if (!d) return; - canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, + canvas->DrawStringInt(d->GetWindowTitle(), *title_font_, SK_ColorWHITE, MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), title_bounds_.width(), title_bounds_.height()); } @@ -667,8 +666,8 @@ void CustomFrameView::LayoutTitleBar() { int title_right = (should_show_minmax_buttons_ ? minimize_button_->x() : close_button_->x()) - kTitleCaptionSpacing; title_bounds_.SetRect(title_x, - title_top_spacing + ((title_thickness - title_font_.height()) / 2), - std::max(0, title_right - title_x), title_font_.height()); + title_top_spacing + ((title_thickness - title_font_->height()) / 2), + std::max(0, title_right - title_x), title_font_->height()); } void CustomFrameView::LayoutClientView() { @@ -688,7 +687,7 @@ void CustomFrameView::InitClass() { active_resources_ = new ActiveWindowResources; inactive_resources_ = new InactiveWindowResources; - title_font_ = win_util::GetWindowTitleFont(); + title_font_ = new ChromeFont(win_util::GetWindowTitleFont()); initialized = true; } diff --git a/chrome/views/window/custom_frame_view.h b/chrome/views/window/custom_frame_view.h index 6e39d3d..1170355 100644 --- a/chrome/views/window/custom_frame_view.h +++ b/chrome/views/window/custom_frame_view.h @@ -112,7 +112,7 @@ class CustomFrameView : public NonClientFrameView, static void InitClass(); static WindowResources* active_resources_; static WindowResources* inactive_resources_; - static ChromeFont title_font_; + static ChromeFont* title_font_; DISALLOW_EVIL_CONSTRUCTORS(CustomFrameView); }; diff --git a/chrome/views/window/dialog_client_view.cc b/chrome/views/window/dialog_client_view.cc index 4779c25..542439d 100644 --- a/chrome/views/window/dialog_client_view.cc +++ b/chrome/views/window/dialog_client_view.cc @@ -78,7 +78,7 @@ class DialogButton : public NativeButton { } // namespace // static -ChromeFont DialogClientView::dialog_button_font_; +ChromeFont* DialogClientView::dialog_button_font_ = NULL; static const int kDialogMinButtonWidth = 75; static const int kDialogButtonLabelSpacing = 16; static const int kDialogButtonContentSpacing = 5; @@ -353,7 +353,7 @@ int DialogClientView::GetButtonWidth(int button) const { DialogDelegate* dd = GetDialogDelegate(); std::wstring button_label = dd->GetDialogButtonLabel( static_cast<DialogDelegate::DialogButton>(button)); - int string_width = dialog_button_font_.GetStringWidth(button_label); + int string_width = dialog_button_font_->GetStringWidth(button_label); return std::max(string_width + kDialogButtonLabelSpacing, kDialogMinButtonWidth); } @@ -431,7 +431,7 @@ void DialogClientView::InitClass() { static bool initialized = false; if (!initialized) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - dialog_button_font_ = rb.GetFont(ResourceBundle::BaseFont); + dialog_button_font_ = new ChromeFont(rb.GetFont(ResourceBundle::BaseFont)); initialized = true; } } diff --git a/chrome/views/window/dialog_client_view.h b/chrome/views/window/dialog_client_view.h index bfea8e0..fadabb6 100644 --- a/chrome/views/window/dialog_client_view.h +++ b/chrome/views/window/dialog_client_view.h @@ -113,7 +113,7 @@ class DialogClientView : public ClientView, // Static resource initialization static void InitClass(); - static ChromeFont dialog_button_font_; + static ChromeFont* dialog_button_font_; DISALLOW_COPY_AND_ASSIGN(DialogClientView); }; |