<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"><channel><title>mgr's weblog</title>
<link>http://blog.matroid.org/</link>
<description>mgr's weblog archives for category Lisp</description>
<language>en</language>
<item><title>photofont.lisp</title>
<link>http://blog.matroid.org/display/63</link>
<pubDate>Sat, 06 Dec 2008 19:43:16 GMT</pubDate>
<description>&lt;p&gt;Yesterday I've stumbled upon &lt;a href="http://photofont.com/"&gt;&lt;span class="title"&gt;Photofonts&lt;/span&gt;&lt;/a&gt;, a font format where every letter is a fully colored
bitmap image. It also supports &lt;a href="http://en.wikipedia.org/wiki/Kerning"&gt;kerning&lt;/a&gt; and Unicode
encoding. The &lt;a href="http://photofont.com/photofont/devel/"&gt;file format
specification&lt;/a&gt; is publicly documented: it's an xml file, the
characters are &lt;span class="title"&gt;Base64&lt;/span&gt;-encoded &lt;span class="title"&gt;PNG&lt;/span&gt;
images in a &lt;span class="title"&gt;MIME&lt;/span&gt;-container. How nice! And certainly the most efficient way to store binary data.&lt;/p&gt;

&lt;p&gt;Sadly there is no Gimp plug-in yet, but you can download &lt;a href="http://photofont.com/photofont/start/"&gt;a plug-in for Adobe Photoshop,
Adobe Illustrator, and Corel Painter&lt;/a&gt; for free, and &lt;a href="http://www.fontlab.com/"&gt;the company&lt;/a&gt; has
announced plug-ins for &lt;a href="http://photofont.com/photofont/id/"&gt;&lt;span class="title"&gt;Adobe InDesign&lt;/span&gt;&lt;/a&gt; as well as &lt;a href="http://photofont.com/photofont/qx/"&gt;&lt;span class="title"&gt;QuarkXPress&lt;/span&gt;&lt;/a&gt;. Well, the
graphic designers will be happy with those&amp;hellip; They have also developed
&lt;a href="http://photofont.com/photofont/use/web/"&gt;&lt;span class="title"&gt;Flash&lt;/span&gt;-based embedded
web font stuff&lt;/a&gt;, but for the program to convert photofonts into that
format, called Photofont WebReady, they want to see some money.
&lt;/p&gt;

&lt;p&gt;Enough of that! A quick look into the
&lt;a href="http://www.cliki.net/index"&gt;CLiki &amp;mdash;
the Common Lisp Wiki&lt;/a&gt; informed me about 
&lt;a href="http://www.cliki.net/XMLS"&gt;&lt;span class="title"&gt;XMLS&lt;/span&gt;&lt;/a&gt;,
&lt;a href="http://www.cliki.net/CL-MIME"&gt;&lt;span class="title"&gt;CL-MIME&lt;/span&gt;&lt;/a&gt;,
&lt;a href="http://www.cliki.net/s-base64"&gt;&lt;span class="title"&gt;s-base64&lt;/span&gt;&lt;/a&gt;, and
&lt;a href="http://www.cliki.net/CL-PNG"&gt;&lt;span class="title"&gt;CL-PNG&lt;/span&gt;&lt;/a&gt;.
Everything I need. Thanks go to the authors and maintainers Drew
Crampsie, Robert Marlow, Sven Van Caekenberghe, Harald Musum, and
Vebjorn Ljosa! The interfaces are all quite usable and after looking into some &lt;a href="http://photofont.com/photofont/get/free/"&gt;free photofonts&lt;/a&gt; from the
aforementioned homepage (mostly from my Lisp image using
XMLS:PARSE) and some hacking I now have a photofont:&lt;/p&gt;

&lt;p&gt;&lt;div class="center"&gt;
&lt;a href="http://blog.matroid.org/files/20081206-Photofont.lisp/HappyStNicksDay.jpg"&gt;&lt;img src="http://blog.matroid.org/files/20081206-Photofont.lisp/HappyStNicksDay_thumb.jpg" title="example of my Tea Light Candle Photofont; please click for the huge
version (277&amp;nbsp;kB)." alt="example of my Tea Light Candle Photofont; please click for the huge
version (277&amp;nbsp;kB)."&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Please click on the image to have a look at &lt;a href="http://blog.matroid.org/files/20081206-Photofont.lisp/HappyStNicksDay.jpg"&gt;the HUGE
version&lt;/a&gt;! I hope you like it! Every single character of this font is
a photograph of some arranged tea light candles. But this
article is about the photofont format and my program to generate
photofonts, and not about my particular &lt;span class="title"&gt;Tea Light Canle Font&lt;/span&gt;. Perhaps there will be a separate article some time in the future&amp;hellip;&lt;/p&gt;

&lt;p&gt;Well, here comes &lt;a href="http://blog.matroid.org/files/20081206-Photofont.lisp/photofont.lisp"&gt;the quick and dirty
implementation in &lt;span class="title"&gt;Common Lisp&lt;/span&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;P&gt;&lt;I&gt;Read the &lt;A HREF="http://blog.matroid.org/display/63"&gt;whole article.&lt;/A&gt;
&lt;/I&gt;
&lt;/P&gt;
</description>
</item>
<item><title>Using an Image Viewer as a Presentation Program,<br/> Image Correction in Batch Mode (Using The GIMP)</title>
<link>http://blog.matroid.org/display/62</link>
<pubDate>Thu, 27 Nov 2008 20:03:02 GMT</pubDate>
<description>&lt;p&gt;As already mentioned in the German article &lt;a href="http://blog.matroid.org/display/61"&gt;&lt;span class="title"&gt;Public
Speech: History of Typesetting and Letterpress Printing&lt;/span&gt;&lt;/a&gt; I have given
that speech without any slides. Instead I've made use of a simple
image viewer and a LCD&amp;nbsp;projector to present the eighty
pictures. In this article I describe the preparations.
&lt;/p&gt;

&lt;p&gt;&lt;h3&gt;Color Correction of Scanned Images&lt;/h3&gt;&lt;/p&gt;

&lt;p&gt;Eighty pictures, and most of them I had to scan by myself from &lt;a href="http://blog.matroid.org/files/20081123-Vortrag-Schriftsatz/Literatur.pdf"&gt;the various
books&lt;/a&gt; that I have used. That means that the colors had to be
altered a tad, at least we need to correct the input level of the
colors (e.g. using &lt;a href="http://www.gimp.org/"&gt;&lt;span class="title"&gt;The&amp;nbsp;GIMP's&lt;/span&gt;&lt;/a&gt;
&lt;a href="http://docs.gimp.org/en/gimp-tool-levels.html"&gt;&lt;span class="title"&gt;Adjust Color Levels&lt;/span&gt;&lt;/a&gt; tool). We want well balanced images, the levels
should be distributed all over the whole color range, and it'd be best
if the text of the reverse side could not be seen through (remember that
often book pages are quite thin).&lt;/p&gt;

&lt;p&gt;If your picture is just composed of
pen strokes (for example pencil drawings or woodcuts) it's a nice
trick to propagate the lower value pixels before using the Levels tool
(&lt;a href="http://docs.gimp.org/en/plug-in-vpropagate.html"&gt;&lt;span class="title"&gt;Filters &amp;rarr; Distorts &amp;rarr; Value&amp;nbsp;Propagate, More Black&lt;/span&gt;&lt;/a&gt;),
so that afterwards you can apply the Levels tool more harshly.
This method is described quite nicely in Liam Quin's &lt;a href="http://www.holoweb.net/~liam/pictures/howto/clean-up-a-scan/"&gt;&lt;span class="title"&gt;How to Clean Up Scanned Engravings and Old Photographs&lt;/span&gt;&lt;/a&gt;, 
(second) step &lt;span class="title"&gt;8. Strengthen Those Lines&lt;/span&gt;. He aptly writes:
"The point of this is that when you make the image brighter the edges
of the dark lines get eaten away, so you need to strengthen them
first."
&lt;/p&gt;

&lt;p&gt;&lt;h3&gt;Automate the Color Correction&lt;/h3&gt;&lt;/p&gt;

&lt;p&gt;We certainly do not want to do this for some dozen images! Luckily
&lt;span class="title"&gt;The&amp;nbsp;GIMP&lt;/span&gt; has a nice batch mode to automate this process. At the
same time it is (in my opinion) a bit easier to write a batch script
instead of a filter script that is embedded into &lt;span class="title"&gt;The&amp;nbsp;GIMP&lt;/span&gt; with a 
special dialog box (though that is not that hard, either).&lt;/p&gt;

&lt;p&gt;How this is done is described in the compact tutorial &lt;a href="http://www.gimp.org/tutorials/Basic_Batch/"&gt;&lt;span class="title"&gt;GIMP Batch
Mode&lt;/span&gt;&lt;/a&gt;. Thank you, anonymous writer, for having written that nice page! Remember
to consult &lt;span class="title"&gt;The&amp;nbsp;GIMP's&lt;/span&gt; helpful &lt;a href="http://docs.gimp.org/en/plug-in-dbbrowser.html"&gt;&lt;span class="title"&gt;Procedure Browser&lt;/span&gt;&lt;/a&gt;,
(&lt;span class="title"&gt;GIMP&amp;nbsp;toolbox &amp;rarr; Xtns &amp;rarr; Procedure&amp;nbsp;Browser&lt;/span&gt;) when
writing your own scripts. It gives you a list of all commands and
describes all their parameters in detail (although, sadly, it describes
not &lt;em&gt;everything&lt;/em&gt; you need to know&amp;hellip;). Here is my script:&lt;/p&gt;
&lt;P&gt;&lt;I&gt;Read the &lt;A HREF="http://blog.matroid.org/display/62"&gt;whole article.&lt;/A&gt;
&lt;/I&gt;
&lt;/P&gt;
</description>
</item>
<item><title>A European, please!</title>
<link>http://blog.matroid.org/display/51</link>
<pubDate>Fri, 16 Mar 2007 10:32:28 GMT</pubDate>
<description>&lt;p&gt;Just found googling:&lt;/p&gt;

&lt;p&gt;&lt;div class="code"&gt;
&lt;div style="white-space:pre;"&gt;--- Day changed Wed May 17 2006
[...]
14:57 &amp;lt; Xach&amp;gt; Any germans around?
14:58 &amp;lt; Xach&amp;gt; Europeans work too.
14:58 &amp;lt; Beef&amp;gt; dze germans, I spit on them
14:58 &amp;lt; Beef&amp;gt; euro here
14:58 &amp;lt; pjb&amp;gt; I'm French, living in Spain. Do I qualify?
14:58 &amp;lt; mvilleneuve&amp;gt; french here
14:58 &amp;lt; Xach&amp;gt; Could you go to Max-Gerd's house and ask him
                    to fix his blog?
14:58 &amp;lt; Beef&amp;gt; :P
14:58 &amp;lt; Xach&amp;gt; Max-Gerd Retzlaff lives somewhere in Germany.
14:59 &amp;lt; mvilleneuve&amp;gt; that's at least 1000 kilometers from
                    where I live, phone or email might be more efficient...
15:02 &amp;lt; ThomasIl&amp;gt; german here, why?
15:04 &amp;lt; Xach&amp;gt; ThomasIl: I am trying to reach Max-Gerd Retzlaff,
                    who is also German.
15:04 &amp;lt; Xach&amp;gt; If you all get together soon, please mention
                    to him that his blog is broken.
15:04 &amp;lt; ThomasIl&amp;gt; well
15:04 &amp;lt; ThomasIl&amp;gt; if its somewhere near my house I could do heh
15:04 &amp;lt; ThomasIl&amp;gt; but doubtful
15:04 &amp;lt; ThomasIl&amp;gt; :P
15:04 &amp;lt; lichtblau&amp;gt; Xach: you should get one of these fancy new
                    electronic mail things, then you can communicate
                    with him directly
15:05 &amp;lt; Xach&amp;gt; That's just crazy enough to work!
15:05 &amp;lt; lichtblau&amp;gt; Karlsruhe, if I'm not mistaken.  Someone summon
                    manuel_!
15:08 &amp;lt; gingras_y&amp;gt; Xach, why don't you leave a comment on his blog?
15:08  &lt;em&gt; gingras_y ducks &lt;/em&gt;
15:09 &amp;lt; Adrinael&amp;gt; Priceless.
[...]
15:14  &lt;em&gt; Xach kicks gingras_y into YGingrasland &lt;/em&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Curious &lt;a href="http://www.gigamonkeys.com/book/"&gt;Dead-Sexy-Xach&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;(Full text in the &lt;a href="http://ircbrowse.com/channel/lisp/20060517#hour14"&gt;publicly archived logs&lt;/a&gt; of the &lt;a href="http://freenode.net/"&gt;freenode&lt;/a&gt;-channel #lisp.)&lt;/p&gt;
&lt;P&gt;&lt;I&gt;Read the &lt;A HREF="http://blog.matroid.org/display/51"&gt;whole article.&lt;/A&gt;
&lt;/I&gt;
&lt;/P&gt;
</description>
</item>
</channel>
</rss>
