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

Unified Diff: chrome/utility/printing_handler.cc

Issue 2114583002: Windows: Make it possible to print text with GDI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/utility/printing_handler.cc
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc
index e396492511f1ed04faa0dbe05cac33213899ce84..3c1241aa29c78d5f92713797b4b27ca66128b119 100644
--- a/chrome/utility/printing_handler.cc
+++ b/chrome/utility/printing_handler.cc
@@ -40,9 +40,22 @@ void ReleaseProcessIfNeeded() {
content::UtilityThread::Get()->ReleaseProcessIfNeeded();
}
+#if defined(OS_WIN)
+void PreCacheFontCharacters(const LOGFONT& logfont,
+ const wchar_t* text,
+ size_t text_length) {
+ Send(new ChromeUtilityHostMsg_PreCacheFontCharacters(
+ logfont, base::string16(text, text_length)));
+}
+#endif
+
} // namespace
-PrintingHandler::PrintingHandler() {}
+PrintingHandler::PrintingHandler() {
+#if defined(OS_WIN)
+ chrome_pdf::SetPDFEnsureTypefaceCharactersAccessible(PreCacheFontCharacters);
+#endif
+}
PrintingHandler::~PrintingHandler() {}
@@ -73,8 +86,10 @@ bool PrintingHandler::OnMessageReceived(const IPC::Message& message) {
#if defined(OS_WIN)
void PrintingHandler::OnRenderPDFPagesToMetafile(
IPC::PlatformFileForTransit pdf_transit,
- const PdfRenderSettings& settings) {
+ const PdfRenderSettings& settings,
+ bool print_text_with_gdi) {
pdf_rendering_settings_ = settings;
+ chrome_pdf::SetPDFUseGDIPrinting(print_text_with_gdi);
base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit);
int page_count = LoadPDF(std::move(pdf_file));
Send(

Powered by Google App Engine
This is Rietveld 408576698