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

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: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 7 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
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.h ('k') | chrome/browser/ui/views/accessibility/invert_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6dd25ffa99761ba91a47f4edbe6934fa853a13af..384f4b7c7ff81313e10e4ae2c1fb488c3068f10e 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());
@@ -823,11 +824,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) != 0;
+ *weight_out = default_font_weight_;
*params_out = default_font_render_params_;
}
@@ -1354,9 +1357,8 @@ void Gtk2UI::UpdateDefaultFont() {
}
query.style = gfx::Font::NORMAL;
- // TODO(davemoore): Support weights other than bold?
- if (pango_font_description_get_weight(desc) == PANGO_WEIGHT_BOLD)
- query.style |= gfx::Font::BOLD;
+ query.weight =
+ static_cast<gfx::Font::Weight>(pango_font_description_get_weight(desc));
// TODO(davemoore): What about PANGO_STYLE_OBLIQUE?
if (pango_font_description_get_style(desc) == PANGO_STYLE_ITALIC)
query.style |= gfx::Font::ITALIC;
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.h ('k') | chrome/browser/ui/views/accessibility/invert_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698