Synopsis ======== I would like to take up the "Tk printing support" project. It consists of 5 major parts: 1. Analysis and information collecting. 2. Adding better font support for Tktopdf. 3. Improving the text widget Tktopdf PDF export function. 4. Adding Tile widget support to Tktopdf PDF export functions. 5. Building a cross-platform simple preview dialog. Further details of the project ======================= 1) Analysis and information collecting. This is one of the most important parts. I will establish a wiki page on wiki.tcl.tk, where people can write their requirements for text widget printing support (and about the whole project). I will announce it on tcl-core mailing list. After about a month I will choose (with mentor's help) the most important issues. This will be a good point to start designing my project. At the same time I will be collecting and analyzing data about: * Text widget, it's internals, introspection capabilities. * Tile and it's internals, introspection capabilities, further plans for it (I'll contact with Mr Joe English) because they may be significant from the project's point of view. * Printing support available in other products (i.e. wxWidgets) on various operating systems. * Printing API offered by particular operating systems. 2) Adding better font support for Tktopdf. I would like to improve font support in PDF generation module by adding an ability of embedding TTF, OTF and TTC fonts into PDF file. This is implemented in many PDF creating libraries, so I think there will not be great problems with porting this functionality to Tktopdf. For example: Solution in Java (iText): iText, IText_doc Solution in PHP (Zend framework): Zend 3) Improving support for text widget in Tktopdf PDF an export function. This is a very complex task. The text widget needs much more work than other widgets. The entire form depends on requirements grabbed from TCL's Community. There are many questions: What options should the export function have? What do we need the most? How to implement it? And many others. At this time I know that text widget is widely used to create reports or text editors, so options which I find useful are: * pagination mechanism * ability to add headers, footers to pages * generated page breaks at user-definable locations * ability to do preview before starting printing (see point 5) And probably many others, depending on user requirements. Maybe a good start point will be to get closer look at Perl's format command (http://www.webreference.com/programming/perl/format/) 4) Adding support for Tile widgets to Tktopdf PDF export function. Tile will possibly replace Tk in the future. It will be good to have package to generate PDF output form their widgets. To accomplish this we need to follow these steps: * In Tile each widget is built from small pieces called elements. These elements create a layout which builds the whole widget. In this particular widget we must collect elements' description (coordinates, sizes, etc.). * After we have collected elements and their whole descriptions, we need to draw them. Recently I've been studying Tile, it's internals and introspection capabilities. What I have learned are following issues: Tile has good introspection capabilities. Each widget has "identify x y" option which allows to compute exactly the coordinates of all widget's elements. But this could be very slow when there are many widgets to print. The other way to solve this is to port into TCL Tile's layout manager (tile/generic/layout.c), which does not look very complicated, and use it to compute needed information. The last way I see is to add functions to Tile's core, which will return all data that is needed to create PDF image of particular widget. The another problem to solve is that some Tile's themes use external API for drawing. For example WindowsXP theme uses the XP Theme API to draw elements (such as radiobutton and checkbutton indicators, scrollbar arrows, etc.) so I would have to guess the algorithms that draw particular elements, which could be very difficult because of it's complexity (there are shadows, gradients, etc.). Tktopdf may be able to print these elements using the Windows/Mac OS printing API, I will investigate that. 5) Build cross-platform simple preview dialog. It will be a nice thing If we could preview what we are going to print. Nowadays, when we talk about printing, it is obvious that we could get preview of pages we are going to print. This may be achieved by using canvas widget and some external libraries (or operating system's API). We could use external library (or OS's API) to render PDF document and return as a bitmap image. Next the image will be displayed on canvas. This is simple solution, but may be useful. Another solution may be the way I have been testing Tktopdf: after collecting data process, using canvas drawing functions to draw a preview on canvas widget instead of calling PDF drawing functions. Benefits to the Community ===================== * Ability to print documents like reports using text widget, independent (because of using PDF) from the operating system. * PDF creation package with good font support (as a part of Tktopdf). * I think that I could extend Tile's tcl wiki pages by adding some examples for each widget. * Of course improved version of Tktopdf, which will be more reliable and useful. What I have already done ==================== * Developed Tktopdf to a level that other developers have used it. * Investigated font problem, found some solutions. * Collected some information about requirements. * Investigated text widget and it's introspection capabilities. * Investigated Tile's introspection capabilities. * Got to know a bit about Tile's internals. Schedule of my work ================== April: * Analysis and information collecting. * Writing a prototype of text widget export function to better understand text widget and to localize the harder issues connected with it. * Start adding True/Open Type font support for Tktopdf. May: * Finishing adding True/Open Type font support. * Writing text widget support. June: * Adding printing support for Tile's widgets. July: * Adding printing support for Tile's widgets. * Creating a preview dialog (this can be done earlier). August: * Testing, writing tests, fixing bugs. * Writing documentation, user guide, final report. The amount of time that I want to spend on the project ========================================== As I learned last year, I won't be able to work all of June because of exams at my University, but I will start earlier than Google's plan assumes (it assumes that students begin working on their projects in May). I will start doing my job as soon as I know if my GSoC application is accepted (that is in April). * In April, May I will work on the project about 20 hours per week. * In June I will work about 0-15 hours per week (depending on exams). * In July, August I will work about 40 hours per week on the project. Why me? ========= I hope to be an appropriate candidate and produce an effective piece of code because: * My last summer project has given to me much of the experience needed to accomplish this year project. Now I'm familiar with PDF specification and problems with creating PDF documents. I'm also familiar with problems connected with grabbing data about Tk widgets and ways it could be resolved. * I'm going to develop a business project for one company in TCL/TK in my current and next semester at my University. I will test my printing support in it (there will be a need to print many different reports). So my project will be tested in commercial use as soon as it is finished. * I already have experience in TCL/TK * I have participated in other Open Source projects (described above in "My open source projects" section). And last but not least: * I am very eager and enthusiastic to participate in Google Summer of Code project! I look forward to hearing from you, Krzysztof Blicharski Contact with me: ============== * via mail: blicharski@gmail.com * I also will be reachable via IRC (my nick will be blicharski) ---- !!!!!! %| enter categories here |% !!!!!!