From 4d2c1b3bd708ba8f4d1f267c01d84561c2fa2452 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 1 Dec 2012 10:24:52 +0000 Subject: [PATCH] .uppdev git-svn-id: svn://ultimatepp.org/upp/trunk@5606 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppdev/PDF/PDF.upp | 3 ++- uppdev/PDF/init | 1 + uppdev/PDF/main.cpp | 23 +++++++++++++---------- uppdev/RichEditTest/main.cpp | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/uppdev/PDF/PDF.upp b/uppdev/PDF/PDF.upp index 14c249513..488812053 100644 --- a/uppdev/PDF/PDF.upp +++ b/uppdev/PDF/PDF.upp @@ -1,5 +1,6 @@ uses - PdfDraw; + PdfDraw, + Painter; file main.cpp, diff --git a/uppdev/PDF/init b/uppdev/PDF/init index 131a0280b..73cab023d 100644 --- a/uppdev/PDF/init +++ b/uppdev/PDF/init @@ -1,4 +1,5 @@ #ifndef _PDF_icpp_init_stub #define _PDF_icpp_init_stub #include "PdfDraw/init" +#include "Painter/init" #endif diff --git a/uppdev/PDF/main.cpp b/uppdev/PDF/main.cpp index 9910dd792..b8566996d 100644 --- a/uppdev/PDF/main.cpp +++ b/uppdev/PDF/main.cpp @@ -13,8 +13,8 @@ CONSOLE_APP_MAIN pdf.DrawText(100, 100, "Ahoj", Courier(100).Bold(), Black); #else int cy = 0; - int height = 50; - for(int face = Font::SERIF; face < min(10, Font::GetFaceCount()); face++) +// for(int face = Font::SERIF; face < min(99999, Font::GetFaceCount()); face++) + int face = 6; for(int underline = 0; underline < 2; underline++) for(int italic = 0; italic < 2; italic++) for(int bold = 0; bold < 2; bold++) { @@ -25,16 +25,19 @@ CONSOLE_APP_MAIN h << " italic"; if(underline) h << " underline"; - Font fnt(face, height); + Font fnt(face, 50); fnt.Bold(bold).Italic(italic).Underline(underline); Cout() << fnt << "\n"; - pdf.DrawText(100, cy, fnt.GetFaceName() + h, fnt, Black); - // pdf.DrawText(2000, cy, 200, fnt.GetFaceName() + h, fnt, Black); - cy += height; - if(cy > 6000) { - pdf.EndPage(); - pdf.StartPage(); - cy = 0; + LOG(face << ' ' << fnt << ", TTF: " << fnt.IsTrueType()); + if(1 || fnt.IsTrueType()) { + pdf.DrawText(100, cy, fnt.GetFaceName() + h, fnt, Black); + // pdf.DrawText(2000, cy, 200, fnt.GetFaceName() + h, fnt, Black); + cy += fnt.GetLineHeight(); + if(cy > 6000) { + pdf.EndPage(); + pdf.StartPage(); + cy = 0; + } } } #endif diff --git a/uppdev/RichEditTest/main.cpp b/uppdev/RichEditTest/main.cpp index 3e35ae810..8185508e1 100644 --- a/uppdev/RichEditTest/main.cpp +++ b/uppdev/RichEditTest/main.cpp @@ -22,7 +22,7 @@ GUI_APP_MAIN // PromptOK("[H20L1 &&&"); RichEditWithToolBar e; - e.SetPage(Size(6074, 3968)); +// e.SetPage(Size(6074, 3968)); Vector h; for(int i = 1; i < Font::GetFaceCount(); i++) if((Font::GetFaceInfo(i) & Font::SCALEABLE) && !(Font::GetFaceInfo(i) & Font::SPECIAL))