Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Issue 62064: UI font localization part 2 (Closed)

Created:
11 years, 8 months ago by jungshik at Google
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, Mark Larson
Visibility:
Public.

Description

For some Indian locales, the automatic font fallback by Windows UI components leads to too tiny glyphs for UI strings. Therefore, this patch makes it possible to override the UI font family and UI font size localizable by adding two entries to locale_settings (IDS_UI_FONT_FAMILY and IDS_UI_FONT_SIZE_SCALER - percentile scale). It's is also to fix a P1 bug for Chrome 2.0 final (so this patch needs to be merged back to the branch). For most locales, the UI font family is set to 'default' and the UI font size scaler is set to 100, which indicates that the UI font (menu, message, etc) obtained from Windows will be used. For ml and bn, it's set to the 'kartica' and 'vrinda' (the default Windows fonts for those scripts) and the scaler is set to 150 and 160 respectively. For Hindi and Telugu, only the font size scaler is set to 150. When IDS_UI_FONT_FAMILY is 'default' and the scaler is 100, the behavior will remain the same. When it's not, their values are used to create ChromeFont (base and derived) and WindowsTitle font. In addition, menu will be drawn by 'owner' (to override the windows font) and the font for table view, tree and tooltip is also set to IDS_UI_FONT_FAMILY. While working on this, I replaced all the instances of 'static ChromeFont' with 'static ChromeFont*' and initialized them in a lazy manner. The whole approach is still a hack necessary due to the size issue with the default fonts for some Indic scripts on Windows. We'd not need this on Linux and Mac. TEST=1. Run chrome with '--lang=bn' or '--lang=ml' and see UI strings are legible in menu, context menu, bookmark, bookmark manager, tooltips, and tab titles. With '--lang=hi' and '--lang=te', the difference is not dramatic but should be more readable. In other locales, it should remain the same. 2.UI test in en-US locale should pass. 3. Running UI tests under Purify should not have any new leak. BUG=7319 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=13773

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 13

Patch Set 11 : '' #

Patch Set 12 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+309 lines, -53 lines) Patch
M chrome/app/resources/locale_settings.grd View 4 5 6 7 8 9 10 2 chunks +22 lines, -1 line 0 comments Download
M chrome/app/resources/locale_settings_ar.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_bg.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_bn.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ca.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_cs.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_da.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_de.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_el.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_en-GB.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_es.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_es-419.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_et.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_fi.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_fil.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_fr.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_gu.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_he.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_hi.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_hr.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_hu.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_id.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_it.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ja.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_kn.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ko.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_lt.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_lv.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ml.xtb View 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download
M chrome/app/resources/locale_settings_mr.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_nb.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_nl.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_or.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_pl.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_pt-BR.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_pt-PT.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ro.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ru.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_sk.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_sl.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_sr.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_sv.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_ta.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_te.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_th.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_tr.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_uk.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_vi.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_zh-CN.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/app/resources/locale_settings_zh-TW.xtb View 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/views/constrained_window_impl.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/views/frame/opaque_browser_frame_view.h View 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/views/frame/opaque_browser_frame_view.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/views/sad_tab_view.h View 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/views/sad_tab_view.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/views/tabs/tab_renderer.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/common/gfx/chrome_font_win.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -1 line 0 comments Download
M chrome/common/l10n_util_win.h View 4 5 6 7 8 9 10 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/common/l10n_util_win.cc View 4 5 6 7 8 9 10 2 chunks +68 lines, -0 lines 0 comments Download
M chrome/common/win_util.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/views/controls/menu/chrome_menu.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/views/controls/menu/menu.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +31 lines, -6 lines 0 comments Download
M chrome/views/controls/table/table_view.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/views/controls/tree/tree_view.cc View 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/views/widget/aero_tooltip_manager.cc View 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/views/widget/tooltip_manager.h View 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/views/widget/tooltip_manager.cc View 3 4 5 6 7 8 9 10 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/views/window/custom_frame_view.h View 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/views/window/custom_frame_view.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +6 lines, -7 lines 0 comments Download
M chrome/views/window/dialog_client_view.h View 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/views/window/dialog_client_view.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
jungshik at Google
11 years, 8 months ago (2009-04-08 22:45:19 UTC) #1
sky
> Currently, ChromeFont (base) is initialized before main() > because there are several static ChromeFont ...
11 years, 8 months ago (2009-04-09 15:50:39 UTC) #2
jungshik at Google
On 2009/04/09 15:50:39, sky wrote: > > Currently, ChromeFont (base) is initialized before main() > ...
11 years, 8 months ago (2009-04-09 17:24:21 UTC) #3
jungshik at Google
Uploaded a new CL with all the instances of 'static ChromeFont' replaced with 'static ChromeFont*'. ...
11 years, 8 months ago (2009-04-10 00:47:35 UTC) #4
sky
You should run the ui tests through Purify to make sure it doesn't show a ...
11 years, 8 months ago (2009-04-10 18:02:58 UTC) #5
jungshik at Google
Thank you for the review. I addressed all your comments. Somehow Purify, after applying the ...
11 years, 8 months ago (2009-04-10 23:08:42 UTC) #6
sky
Assuming there is no purify problems, LGTM. http://codereview.chromium.org/62064/diff/5078/5089 File chrome/common/gfx/chrome_font.h (right): http://codereview.chromium.org/62064/diff/5078/5089#newcode104 Line 104: // ...
11 years, 8 months ago (2009-04-10 23:15:54 UTC) #7
jungshik at Google
11 years, 8 months ago (2009-04-14 00:14:18 UTC) #8
Thank you for the review. 

On 2009/04/10 23:15:54, sky wrote:
> Assuming there is no purify problems, LGTM.
> 
> http://codereview.chromium.org/62064/diff/5078/5089
> File chrome/common/gfx/chrome_font.h (right):
> 
> http://codereview.chromium.org/62064/diff/5078/5089#newcode104
> Line 104: // Creates a font with the default name and style.
> On 2009/04/10 23:08:42, Jungshik Shin wrote:
> > On 2009/04/10 18:02:58, sky wrote:
> > > Is this necessary?
> > 
> > You meant the comment is not necessary? It doesn't add much and I can delete
> it.
> 
> No, I meant it looks like you haven't changed anything in this file. Could it
be
> reverted?

Aha. I did and updated the CL. 

I ran ui_tests under purify (it took ~ 14 hrs on my machine), but was told that
it's not easy to compare it with what buildbot has (Erik restarted ui_test +
purify bot this morning and it'll take ~ 14 hours there, too) because ui test
purify results haven't been baselined properly, yet (according to Paul). I'm
about to start ui tests under purify once more *without* my CL. That way,
perhaps it's a bit easier to spot any new error. We'll see tomorrow :-)

Powered by Google App Engine
This is Rietveld 408576698