diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-13 16:43:03 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-13 16:43:03 +0000 |
commit | c6ac841f51c0b884b38e917ac30b1dfde0dc43a7 (patch) | |
tree | 2b490ffa6795f72e7232d658b766785f0de64e38 /printing | |
parent | 6b32b95cff99ee72fd7824237ae5070263e5c496 (diff) | |
download | chromium_src-c6ac841f51c0b884b38e917ac30b1dfde0dc43a7.zip chromium_src-c6ac841f51c0b884b38e917ac30b1dfde0dc43a7.tar.gz chromium_src-c6ac841f51c0b884b38e917ac30b1dfde0dc43a7.tar.bz2 |
Rework gfx::Font by moving platform-specific code into inner classes.
gfx::Font is a platform-neutral API shim that exists as a wrapper object to allow for the creation and lifetime of gfx::Font objects to remain consistent with past usage.
gfx::PlatformFont is an interface implemented by the platform-specific inner classes (gfx::PlatformFontWin,Mac,Gtk).
BUG=none
TEST=existing unittests
Review URL: http://codereview.chromium.org/3083022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/printed_document.cc | 2 | ||||
-rw-r--r-- | printing/printed_document_win.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/printing/printed_document.cc b/printing/printed_document.cc index ec040d4..f75a716 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -198,7 +198,7 @@ void PrintedDocument::PrintHeaderFooter(gfx::NativeDrawingContext context, // May happen if document name or url is empty. return; } - const gfx::Size string_size(font.GetStringWidth(output), font.height()); + const gfx::Size string_size(font.GetStringWidth(output), font.GetHeight()); gfx::Rect bounding; bounding.set_height(string_size.height()); const gfx::Rect& overlay_area( diff --git a/printing/printed_document_win.cc b/printing/printed_document_win.cc index 5d7ab5f..3a57b94 100644 --- a/printing/printed_document_win.cc +++ b/printing/printed_document_win.cc @@ -114,13 +114,13 @@ void PrintedDocument::RenderPrintedPage( -page_setup.printable_area().x(), -page_setup.printable_area().y(), 1); - int base_font_size = gfx::Font().height(); + int base_font_size = gfx::Font().GetHeight(); int new_font_size = ConvertUnit(10, immutable_.settings_.desired_dpi, immutable_.settings_.device_units_per_inch()); DCHECK_GT(new_font_size, base_font_size); gfx::Font font(gfx::Font().DeriveFont(new_font_size - base_font_size)); - HGDIOBJ old_font = SelectObject(context, font.hfont()); + HGDIOBJ old_font = SelectObject(context, font.GetNativeFont()); DCHECK(old_font != NULL); // We don't want a white square around the text ever if overflowing. SetBkMode(context, TRANSPARENT); |