[mcclim-devel] Freetype for SBCL
Hello, Since I'm under the impression that code in the Experimental directory is, well, experimental, I've committed a version of the experimental freetype bindings which works on SBCL. I've optimized away the %SAP-ALIEN problems, and the end product is reasonably usable. It's a bit laggy until the glyph cache warms up, but after that it's just fine. Here's a gratuitous screenshot: http://www.unmutual.info/images/slidemacs-big.png I'm pretty sure that this doesn't work on CMUCL anymore, as CMUCL has slightly different names (DEF-ALIEN-TYPE and -ROUTINE), but a little macrology should restore CMUCL workingness if anybody's interested in giving it a try. In order to use this under SBCL, you must use the .asd file, as there's a little ASDF muckery in there to work around the fact that compiling the freetype-ffi file currently stuffs up in SBCL. After the rest of the code finishes compiling, you should see a message about setting mcclim-freetype:*freetype-font-path* - set this to a directory containing the Bitstream Vera fonts, and don't forget the final / on the pathname or else merge-pathnames is not going to be happy. Comments and patches welcome, especially from CMUCL users. -- Brian Mastenbrook "God made the natural numbers; http://www.iscblog.info/ all else is the work of man." chandler@unmutual.info -- Leopold Kroneker
Brian Mastenbrook <chandler@unmutual.info> writes:
Since I'm under the impression that code in the Experimental directory is, well, experimental, I've committed a version of the experimental
Well, Experimental/pointer-doc-hack.lisp is rock solid. I haven't had any problems with it for the last couple of years and countless McCLIM updates :)
freetype bindings which works on SBCL. I've optimized away the [...] Here's a gratuitous screenshot: http://www.unmutual.info/images/slidemacs-big.png
Cool. Paolo -- Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log
Brian Mastenbrook <chandler@unmutual.info> writes:
In order to use this under SBCL, you must use the .asd file, as there's a little ASDF muckery in there to work around the fact that compiling the freetype-ffi file currently stuffs up in SBCL. After the rest of the code finishes compiling, you should see a message about setting mcclim-freetype:*freetype-font-path* - set this to a directory containing the Bitstream Vera fonts, and don't forget the final / on the pathname or else merge-pathnames is not going to be happy.
Comments and patches welcome, especially from CMUCL users.
Find attached a patch which makes it work on my amd64 (and stops it from working on 32-bit platforms, of course). There seems to be something slightly wrong with text-style-width, as demonstrated in the following screenshot: <http://www-jcsu.jesus.cam.ac.uk/~csr21/text-style-width.png>. What's going on in this example is that the top line implements the spaces by calling stream-increment-cursor-position with an x-displacement of text-style-width; the second line simply draws the text in one fell swoop. Thus, a slightly smaller than true text-style-width causes this displacement (and also for the cursor to be drawn in the wrong position, if it's not at the start of the line). Cheers, Christophe
participants (3)
-
Brian Mastenbrook
-
Christophe Rhodes
-
Paolo Amoroso