I've been bumping into the issue of the fonts being undersized,
viewing CHM files in gnochm for some time (ie >3 years).

After some investigation, the libgtkhtml2 libraries are working as
expected and a workaround is needed for the small fonts specified in
CHM files; presumably authors of CHM files test them against the CHM
viewer in windows, which has a similar font-scaling trick for legacy
compatibility.

I've added a patch to this email (also in LP#86889) to add as clean
workaround as possible, built and validated it on a battery of CHM
files, and it looks good.

How can we this reviewed and possible updated in time for Intrepid?
I'd say it's certainly a troublesome usability bug, affecting Ubuntu's
main use-profile (ie desktop).

Thanks,
  Daniel
-- 
Daniel J Blueman
--- gnochm-0.9.11/gnochm.py.in	2007-09-15 13:20:23.000000000 +0100
+++ gnochm-0.9.11-new/gnochm.py.in	2008-08-30 14:14:39.959040980 +0100
@@ -758,6 +758,8 @@
 class MainApp:
     def __init__(self):
         self.FirstTime = 1
+        # zoom adjustment needed to workaround CHM files displaying too small
+        self.zoom_compensate = 5
         self.chmfiles = []
         self.xml = gtk.glade.XML(path_mainwin, None, app)
         self.setup_gnome_app()
@@ -1528,6 +1530,11 @@
                 else:
                     self.mainwin.set_title(_('CHM Viewer - %s') %
                                            os.path.basename(filename))
+                                           
+                # workaround CHM files displaying too small
+                for i in range(0, self.zoom_compensate):
+                    self.htmlview.zoom_in()                
+                
                 if self.FirstTime:
                     self.xml.get_widget('zoom_in').set_sensitive(True)
                     self.xml.get_widget('zoom_out').set_sensitive(True)
@@ -1647,6 +1654,10 @@
     def on_zoomreset_activate(self, *args):
         self.htmlview.zoom_reset()
 
+        # workaround CHM files displaying too small
+        for n in range(0, self.zoom_compensate):
+            self.htmlview.zoom_in()
+
     def on_zoomout_activate(self, *args):
         self.htmlview.zoom_out()
 
-- 
Ubuntu-motu mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu

Reply via email to