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

Unified Diff: chrome/common/font_descriptor_mac.mm

Issue 2804001: Mac: More pluming for OOP font loading (Closed)
Patch Set: Fix review comments Created 10 years, 6 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/common/font_descriptor_mac.mm
diff --git a/chrome/common/font_descriptor_mac.mm b/chrome/common/font_descriptor_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..485c21528a4bb0a19f274e2ed6f0c6b527f4c4a6
--- /dev/null
+++ b/chrome/common/font_descriptor_mac.mm
@@ -0,0 +1,20 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/font_descriptor_mac.h"
+
+#include <Cocoa/Cocoa.h>
+
+#include "base/sys_string_conversions.h"
+
+FontDescriptor::FontDescriptor(NSFont* font) {
+ font_name = base::SysNSStringToUTF16([font fontName]);
+ font_point_size = [font pointSize];
+}
+
+NSFont* FontDescriptor::nsFont() const {
+ NSString* font_name_ns = base::SysUTF16ToNSString(font_name);
+ NSFont* font = [NSFont fontWithName:font_name_ns size:font_point_size];
+ return font;
+}

Powered by Google App Engine
This is Rietveld 408576698