win: Setup font.

This commit is contained in:
Cheng Zhao 2014-07-12 19:46:26 +08:00
parent 0f5b427648
commit 8d3f615e61

View file

@ -24,8 +24,29 @@
#include "browser/views/views_delegate.h"
#endif
#if defined(OS_WIN)
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/gfx/platform_font_win.h"
#endif
namespace brightray {
#if defined(OS_WIN)
namespace {
// gfx::Font callbacks
void AdjustUIFont(LOGFONT* logfont) {
l10n_util::AdjustUIFont(logfont);
}
int GetMinimumFontSize() {
return 10;
}
} // namespace
#endif
BrowserMainParts::BrowserMainParts() {
}
@ -51,6 +72,11 @@ void BrowserMainParts::ToolkitInitialized() {
#if defined(TOOLKIT_VIEWS)
views_delegate_.reset(new ViewsDelegate);
#endif
#if defined(OS_WIN)
gfx::PlatformFontWin::adjust_font_callback = &AdjustUIFont;
gfx::PlatformFontWin::get_minimum_font_size_callback = &GetMinimumFontSize;
#endif
}
void BrowserMainParts::PreMainMessageLoopStart() {