| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "app/gfx/chrome_font.h" | 5 #include "app/gfx/font.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <math.h> | 8 #include <math.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 | 11 |
| 12 #include "app/l10n_util_win.h" | 12 #include "app/l10n_util_win.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/win_util.h" | 14 #include "base/win_util.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "grit/locale_settings.h" | |
| 17 | 16 |
| 18 namespace gfx { | 17 namespace gfx { |
| 19 | 18 |
| 20 /*static*/ | 19 /*static*/ |
| 21 Font::HFontRef* Font::base_font_ref_; | 20 Font::HFontRef* Font::base_font_ref_; |
| 22 | 21 |
| 23 // If the tmWeight field of a TEXTMETRIC structure has a value >= this, the | 22 // If the tmWeight field of a TEXTMETRIC structure has a value >= this, the |
| 24 // font is bold. | 23 // font is bold. |
| 25 static const int kTextMetricWeightBold = 700; | 24 static const int kTextMetricWeightBold = 700; |
| 26 | 25 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 204 } |
| 206 if (font_metrics.tmWeight >= kTextMetricWeightBold) { | 205 if (font_metrics.tmWeight >= kTextMetricWeightBold) { |
| 207 style |= Font::BOLD; | 206 style |= Font::BOLD; |
| 208 } | 207 } |
| 209 | 208 |
| 210 return new HFontRef(font, height, baseline, ave_char_width, style, | 209 return new HFontRef(font, height, baseline, ave_char_width, style, |
| 211 dlu_base_x); | 210 dlu_base_x); |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace gfx | 213 } // namespace gfx |
| OLD | NEW |