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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Further Mac and Linux fixes. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index e22761f027484abee8545cb625104892288b1e41..d4d4d60fda1699a144b29864c1c78e97fe040753 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -473,6 +473,7 @@ views::LinuxUI::NonClientMiddleClickAction GetDefaultMiddleClickAction() {
Gtk2UI::Gtk2UI()
: default_font_size_pixels_(0),
default_font_style_(gfx::Font::NORMAL),
+ default_font_weight_(gfx::Font::Weight::NORMAL),
middle_click_action_(GetDefaultMiddleClickAction()),
device_scale_factor_(1.0) {
GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess());
@@ -820,11 +821,13 @@ gfx::FontRenderParams Gtk2UI::GetDefaultFontRenderParams() const {
void Gtk2UI::GetDefaultFontDescription(
std::string* family_out,
int* size_pixels_out,
- int* style_out,
+ bool* italic_out,
+ gfx::Font::Weight* weight_out,
gfx::FontRenderParams* params_out) const {
*family_out = default_font_family_;
*size_pixels_out = default_font_size_pixels_;
- *style_out = default_font_style_;
+ *italic_out = default_font_style_ == gfx::Font::ITALIC;
msw 2016/03/25 01:33:09 nit: check (default_font_style_ & gfx::Font::ITALI
Mikus 2016/03/25 11:49:00 Done.
+ *weight_out = default_font_weight_;
*params_out = default_font_render_params_;
}
@@ -1346,9 +1349,10 @@ void Gtk2UI::UpdateDefaultFont() {
}
query.style = gfx::Font::NORMAL;
+ query.weight = gfx::Font::Weight::NORMAL;
// TODO(davemoore): Support weights other than bold?
msw 2016/03/25 01:33:09 It'll be much easier to address this TODO now! (in
Mikus 2016/03/25 11:49:00 Acknowledged. Todo changed.
if (pango_font_description_get_weight(desc) == PANGO_WEIGHT_BOLD)
- query.style |= gfx::Font::BOLD;
+ query.weight = gfx::Font::Weight::BOLD;
// TODO(davemoore): What about PANGO_STYLE_OBLIQUE?
if (pango_font_description_get_style(desc) == PANGO_STYLE_ITALIC)
query.style |= gfx::Font::ITALIC;

Powered by Google App Engine
This is Rietveld 408576698