| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gfx/platform_font_pango.h" | 5 #include "ui/gfx/platform_font_pango.h" |
| 6 | 6 |
| 7 #include <fontconfig/fontconfig.h> | 7 #include <fontconfig/fontconfig.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 switch (GetStyle()) { | 233 switch (GetStyle()) { |
| 234 case gfx::Font::NORMAL: | 234 case gfx::Font::NORMAL: |
| 235 // Nothing to do, should already be PANGO_STYLE_NORMAL. | 235 // Nothing to do, should already be PANGO_STYLE_NORMAL. |
| 236 break; | 236 break; |
| 237 case gfx::Font::BOLD: | 237 case gfx::Font::BOLD: |
| 238 pango_font_description_set_weight(pfd, PANGO_WEIGHT_BOLD); | 238 pango_font_description_set_weight(pfd, PANGO_WEIGHT_BOLD); |
| 239 break; | 239 break; |
| 240 case gfx::Font::ITALIC: | 240 case gfx::Font::ITALIC: |
| 241 pango_font_description_set_style(pfd, PANGO_STYLE_ITALIC); | 241 pango_font_description_set_style(pfd, PANGO_STYLE_ITALIC); |
| 242 break; | 242 break; |
| 243 case gfx::Font::UNDERLINED: | 243 case gfx::Font::UNDERLINE: |
| 244 // TODO(deanm): How to do underlined? Where do we use it? Probably have | 244 // TODO(deanm): How to do underline? Where do we use it? Probably have |
| 245 // to paint it ourselves, see pango_font_metrics_get_underline_position. | 245 // to paint it ourselves, see pango_font_metrics_get_underline_position. |
| 246 break; | 246 break; |
| 247 } | 247 } |
| 248 | 248 |
| 249 return pfd; | 249 return pfd; |
| 250 } | 250 } |
| 251 | 251 |
| 252 //////////////////////////////////////////////////////////////////////////////// | 252 //////////////////////////////////////////////////////////////////////////////// |
| 253 // PlatformFontPango, private: | 253 // PlatformFontPango, private: |
| 254 | 254 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 return new PlatformFontPango(native_font); | 384 return new PlatformFontPango(native_font); |
| 385 } | 385 } |
| 386 | 386 |
| 387 // static | 387 // static |
| 388 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, | 388 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, |
| 389 int font_size) { | 389 int font_size) { |
| 390 return new PlatformFontPango(font_name, font_size); | 390 return new PlatformFontPango(font_name, font_size); |
| 391 } | 391 } |
| 392 | 392 |
| 393 } // namespace gfx | 393 } // namespace gfx |
| OLD | NEW |