|
From: | Gubinelli Massimiliano |
Subject: | Re: [Texmacs-dev] General efficiency of TeXmacs |
Date: | Mon, 15 Jun 2009 11:52:04 +0200 |
Hi, On 15 juin 09, at 00:24, Alex D wrote: Actually, I spent a few hours hacking the cairo renderer to work with the Qt gui on Linux. When I finally got it to work, the TeXmacs windows would be all gray and the white page with text would blink into existence momentarily when a key was pressed but then the screen would turn gray again. I could'nt keep Qt from overwriting the drawn image with gray after every repaint and gave up. I've tested the renderer mainly on Mac, indeed there are still problems on X11. For the moment you should configure with --with-cairo=linked. The rendering problems are probably due to some double-buffering misbehaviour (X11 does not have double-buffering so Qt is emulating it but we write direcly on the X11 surface bypassing the Qt double-buffering and everything goes wrong). The cairo renderer has at least two advantages over the plain Qt renderer: * can render image masks (so that colored bimap glyphs text do not need to be cached once for each different color) * font drawing API is low level so we have direct access to the glyphs You should be aware that in the current Qt port the mechanisms that blocks redrawing is user input happens is disabled. The X11 port is more sophisticate in this matter and I suggest you to look at that code to see how far we are in the Qt port. I'm not sure: I think the typesetting engine send a series of redrawing messages: starting from a local one and going towards a global redrawing, but I'm not really sure. It should be checked on the X11 backend. I'm very interested in that. How did you implemented native rendering of fonts in Qt? I've spent a lot of time trying to do this in Qt/Mac and while I've managed to do this it is not really straigforward (Mac cannot read Type1 fonts directly). Can you sent me your patches? For the mac I wrote a routine (together with Jonatahn Kew of XeTeX) which convert the pfb font into the otf format supported by the Mac. To access direcly the glyphs you also need to find out the font encoding vector. Reencoding fonts iself is easy. With FontForge I was able to reencode and merge the GPL'd Base 35 fonts (Times, Helvetica, Palatino, etc), Liberation, and DejaVu into TeXmacs' format. apriori reencoding of the fonts could be a solution. However it would be nice to be able to use generic fonts (for example all the fonts already installed on the platform). Moreover encoding could be found out using freetype. Another probles is that there are few (none?) OpenType fonts with proper support of mathematics. How do you handle mathematical glyphs in your home-brewed fonts? TeXmacs uses FreeFont internally now to rasterize glyphs to bitmaps, so OpenType fonts will not pose a problem for the X11 port. But we will also need to have the fonts in pfa or type42 format so they can be embeded in postscript. I do not like very much the Qt API for fonts. In my opinion it is too much high level for the needs of TeXmacs. this is why I wrote a cairo renderer. I can certainly work on a patch for this, if you believe this is the way to go. I'm sending you a patch which reorganize the way fonts talks to renderer. Its aim is to have an higher lever API so that native rendering of fonts can be properly implemented. Virtual fonts still handle rendering via bitmaps (even if we should think to a cleaner solution via higher level commands sent to the renderer, other possibility: OpenType "glyplets"). I'm really interested in the problem of native font rendering. We should try to go on in this direction. Best, Massimiliano PS: patch attached below |
expfonts.patch
Description: Binary data
|
[Prev in Thread] | Current Thread | [Next in Thread] |