Bug 138075 - evolution calendar & addressbook uses old gnome-print api - cannot print indic
Summary: evolution calendar & addressbook uses old gnome-print api - cannot print indic
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Dave Malcolm
QA Contact:
Keywords: i18n
Depends On: 140309 140817
Blocks: Indic 137160
TreeView+ depends on / blocked
Reported: 2004-11-04 14:16 UTC by Jatin Nansi
Modified: 2007-11-30 22:10 UTC (History)
5 users (show)

Fixed In Version: evolution-2.0.2-10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-04 07:12:23 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
test vcf as requested (749 bytes, text/plain)
2005-02-14 10:55 UTC, Jatin Nansi
no flags Details
Initial version of patch for calendar printing (53.41 KB, patch)
2005-02-15 03:50 UTC, Dave Malcolm
no flags Details | Diff
ps file illustrating the english alpabet replaced by empty square (91.92 KB, text/plain)
2005-03-02 05:44 UTC, Lawrence Lim
no flags Details

Description Jatin Nansi 2004-11-04 14:16:48 UTC
Description of problem:
The Evolution calendar and addressbook uses the older libgnomeprint22
api (without pango support). hence it does not print indic correctly.

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
1. Input calendar details in indic language
2. print calendar
Actual results:
Indic printing is incorrect (composite glyphs broken)

Expected results:
Correct printing of indic

Additional info:
need to update evolution calendar and addressbook components to use
newer pango enabled libgnomeprint22 api.

Comment 2 Dave Malcolm 2004-11-16 20:57:00 UTC
Looking at addressbook: evolution/addressbook/printing/e-contact-print.c
- e_contact_output calls e_contact_divide_text which tries to do
word-breaking; I suspect Pango will do a better job.  It then calls
gnome_print_show on each line of text; looks like it should be using a
PangoLayout for all of this.
- EContactPrintContext has gchar fields for first_char_on_page and
last_char_on_page, and the code tries to present the letters A to Z
running down the contact list, so that each page of the printout
highlights what range of the alphabet is covered.  I'm afraid I've no
idea how this should be presented to the user for non-Roman scripts
(what if the list of names for your contact list contains a mixture of
roman and non roman-scripts?) 

Looking at the calendar: evolution/calendar/gui/print.c
- print_text() is intended to print a single line of text; it calls
gnome_print_show() and is called in various places; should be trivial
to replace with a call to gnome_print_pango_layout
- bound_text() tries to do line wrapping, using naive comparisons
against the ' ' character, calling gnome_print_show on the lines it
generates.  Should be replaceable by creating a PangoLayout on the fly
and printing it.
- various calls to gnome_font_get_size accompanying such calls, for
laying out lines and boxes relative to the textual components.

I'm sorry that this bug has only recently been discovered; it looks
like fixing all of the above problems is going to be quite invasive,
so I'd prefer to move this to RHEL4 U1.

Comment 3 Leon Ho 2004-11-18 17:33:44 UTC
Dave, thanks for the info and ATM I do agree the risk maybe high
regardless languages.

Jatin, what do you think? Do you have some counter measures or
suggestion for Indic? Otherwise I will take this off from RHEL4RCi18n
and aim for RHEL4-U1 if you are okay with that.

Comment 4 Jatin Nansi 2004-11-22 14:29:48 UTC
This bug needs to be fixed in multiple places. In addition to the
fixes suggested by dmalcolm above, I can think of atleast 1 more
issue, ie. the graphics (lines and rectangles) drawn on the page.
Those are drawn to make the page prettier, and their coordinates are
calculated based on the text. 
Since all these fixes will be extensive, I think it would be good to
move this bug to RHEL4 U1.

Comment 5 Leon Ho 2004-11-22 14:48:33 UTC
Thanks Dave and Jatin. It is bad for Indic users, however risks are
high, so have to fix it asap after final. Moving it to RHEL U1
blocker. (it also helps CJK layouting problem with calendar after this
bug is fixed)

Dave, is it something we should talk to upstream? Possible to
initialize a discussion with upstream about this?

Comment 6 Dave Malcolm 2005-01-20 21:11:30 UTC
Leon: please can you create a .ics calendar file and a .vcf contacts
file containing plenty of examples of appointments/contacts in
non-Roman scripts for testing.

Hopefully we can put this in upstream CVS for testing

Comment 8 Akira TAGOH 2005-01-21 07:07:23 UTC
Here is the non-Roman iCalendar example.

Comment 9 Dave Malcolm 2005-02-11 21:59:02 UTC
Re comment 8: Thank you!  I can reproduce the bug in the latest
Evolution (2.1.5); I plan to do the fix upstream then backport (as it
appears that this code has barely changed, if at all)

Please can someone supply me with a .vcf addressbook file (the other
part of my request in comment #6) if you have one you can email me -
this will make it much easier for me to test and implement this.  You
can email it to me directly and I promise I will keep it private. 
(It's much easier and better to work with real data)

Comment 10 Jatin Nansi 2005-02-14 10:55:10 UTC
Created attachment 111046 [details]
test vcf as requested

Comment 11 Dave Malcolm 2005-02-14 21:42:52 UTC
Thanks for the attachment.

I'm working on the calendar part of things, and have it partially working.

Printing the "List View" of the calendar uses printing code in
libgal2, which will need patching as well.  I currently believe that
these patches can be independent of each other.

Comment 12 Dave Malcolm 2005-02-15 03:50:01 UTC
Created attachment 111075 [details]
Initial version of patch for calendar printing

Comment 13 Dave Malcolm 2005-02-16 23:03:45 UTC
Addressbook printing has been reported upstream here:

Comment 14 Dave Malcolm 2005-02-16 23:12:35 UTC
I reported calendar printing upstream here:

Comment 15 Dave Malcolm 2005-02-17 00:08:08 UTC
I've attached an initial version of a fix for addressbook printing to
this upstream bug; please test:
(with some issues as discussed in that bug)

Even better, can I add eng-i18n-list@redhat.com to the relevant
upstream bugs in Ximian's bugzilla?

Comment 17 Dave Malcolm 2005-02-21 19:43:37 UTC
I added the List View problems in libgal2 upstream here:

eng-i18n-list doesn't have an account at bugzilla.ximian.com, so I
added tagoh@redhat.com to these upstream bugs:
http://bugzilla.ximian.com/show_bug.cgi?id=69430 (addressbook printing)
http://bugzilla.ximian.com/show_bug.cgi?id=72668 (calendar printing)
http://bugzilla.ximian.com/show_bug.cgi?id=72815 (list view printing)

Comment 18 Dave Malcolm 2005-02-22 02:39:18 UTC
I've uploaded cleaned-up versions of the patches to the upstream bugs;
please can you test them.

Comment 19 Akira TAGOH 2005-02-28 10:20:08 UTC
I've tested that patch and works fine to me.

Comment 20 Dave Malcolm 2005-02-28 21:03:52 UTC
Akira-san, please can you clarify which patch (or patches) you were
referring to in comment #19?   Thank you.

Comment 21 Akira TAGOH 2005-03-01 11:35:57 UTC
Sorry, well, I've tried two patches for the adressbook and calendar printing.

Comment 22 Lawrence Lim 2005-03-02 05:43:01 UTC
I have tried printing the address book, calendar. They are all printing properly
now. However, for task, english alphabet seems unable to print properly. They
are all replaced by an empty square. An attachment of the ps file will follow.


Comment 23 Lawrence Lim 2005-03-02 05:44:45 UTC
Created attachment 111562 [details]
ps file illustrating the english alpabet replaced by empty square

Comment 24 Dave Malcolm 2005-03-02 06:25:10 UTC
I had to massage the calendar patch to apply cleanly against RHEL4
rather than CVS HEAD.

The package for RHEL4 U1 is building now, but beehive seems to be
broken (or heavily congested).

I've opened errata RHBA-2005:267 for this.

Comment 25 Dave Malcolm 2005-03-02 06:27:13 UTC
I believe the "tasks" view is handled by libgal2 (like the List View
for addressbook and calendars), which I haven't had time to fix yet
(and won't get fixed for RHEL4 U1 at this stage)

Comment 26 Dave Malcolm 2005-03-02 08:47:13 UTC
evolution-2.0.2-10 packages built for RHEL4 U1 - please test!

Comment 27 Lawrence Lim 2005-03-02 09:14:29 UTC
Tested Cal with all 5 indic locales and they are all good. :-)

Comment 28 Havoc Pennington 2005-03-03 20:12:48 UTC
Please close the bug if it's cooked...

Comment 29 Lawrence Lim 2005-03-04 07:12:23 UTC
Confirmed fixed. Tested with evolution-2.0.2-10 in dist-U1.


Comment 30 Dave Malcolm 2005-03-04 16:14:36 UTC
However, printing the "List View" of the calendar/addressbook probably
won't work, as this uses code in libgal2 which hasn't been ported to
the new API yet.  Please open a fresh bug for this if you want me to
fix it, and add it to appropriate tracker bugs (RHELL4 U2?)
This is in the upstream bug tracker here:

Comment 31 Lawrence Lim 2005-03-07 07:25:12 UTC
bug 150485 has been created to track the porting of libgal2 to the new API.

Comment 32 Leon Ho 2005-04-11 06:34:01 UTC
bug #150458 is the correct bug number

Note You need to log in before you can comment on or make changes to this bug.