<?xml version="1.0" encoding="utf-8" ?>

<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns="http://my.netscape.com/rdf/simple/0.9/">
<channel>
    <title>Sketches</title>
    <link>http://www.janthor.com/sketches/</link>
    <description></description>
    <dc:language>en</dc:language>

    <image rdf:resource="img/halfishtar.png" />

    <items>
      <rdf:Seq>
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/19-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/18-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/17-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/16-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/15-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/14-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/13-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/12-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/11-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/8-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/7-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/6-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/5-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/10-guid.html" />
        <rdf:li resource="http://www.janthor.com/sketches/index.php?/archives/3-guid.html" />
      </rdf:Seq>
    </items>
</channel>

<image rdf:about="img/halfishtar.png">
        <url>img/halfishtar.png</url>
        <title>RSS: Sketches - </title>
        <link>http://www.janthor.com/sketches/</link>
        <width>144</width>
        <height>400</height>
    </image>


<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/19-guid.html">
    <title>How to change the font of the Windows console with Python</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/19-How-to-change-the-font-of-the-Windows-console-with-Python.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;The de­fault font for the con­sole on Win­dows is some basic raster font with­out much sup­port for more ex­ot­ic Uni­code code points. Which kind of sucks for com­mand line pro­grams, if they are deal­ing with Uni­code data and for­eign lan­guages. It is pos­si­ble to change the con­sole font to “Lu­ci­da Con­sole”, which sup­ports a lot more code points, or, if it is in­stalled, to “Con­so­las”, which sup­ports even more code points, by click­ing on the icon in the upper left cor­ner of the con­sole and choos­ing to change the prop­er­ties. But we can’t se­ri­ous­ly ex­pect the user of a script to go through the trou­ble of chang­ing the font of the con­sole man­u­al­ly.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Is it pos­si­ble to change the font of the con­sole in­side a Python script run­ning on said con­sole? Usu­al­ly, the most nat­u­ral thing to do would be to look at the mod­ule &lt;tt&gt;win32console&lt;/tt&gt;, but un­for­tu­nate­ly, it doesn’t im­ple­ment the need­ed call to &lt;tt&gt;SetCurrentConsoleFontEx&lt;/tt&gt;. Too bad, but ba­si­cal­ly just a mere in­con­ve­nience, since we can al­ways do stuff like this using the &lt;tt&gt;ctypes&lt;/tt&gt; mod­ule (with the ad­di­tion­al bonus that since Python 2.5, &lt;tt&gt;ctypes&lt;/tt&gt; is part of the Stan­dard Li­brary, so we don’t have to rely on the avail­abil­i­ty of an ex­ter­nal li­brary). The fol­low­ing code shows how it is done:&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/19-How-to-change-the-font-of-the-Windows-console-with-Python.html#extended&quot;&gt;Continue reading &quot;How to change the font of the Windows console with Python&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2012-12-18T19:52:04Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=19</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/18-guid.html">
    <title>Using Adobe Open Type Fonts Ornaments In XeTeX</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/18-Using-Adobe-Open-Type-Fonts-Ornaments-In-XeTeX.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;Once upon a time, or­na­ments, ding­bats, flour­ish­es, sym­bols and other em­bel­lish­ments were put in spe­cial pi fonts, with the sym­bols mapped to or­di­nary let­ters. For ex­am­ple, in Zapfi­no Extra Or­na­ments, you could type a cap­i­tal let­ter X and get a nice flour­ish, which had noth­ing at all to do with the let­ter X.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;With the ad­vent of Open Type and Uni­code, some sym­bols where put in the Pri­vate Use Area of Uni­code. For ex­am­ple, Adobe Gara­mond Pro has three flour­ish­es at the code points &lt;span style=&quot;font-family:&#039;Courier New&#039;;font-size: 83%; background-color:#eef;&quot;&gt;U+E09D&lt;/span&gt;, &lt;span style=&quot;font-family:&#039;Courier New&#039;;font-size: 83%; background-color:#eef;&quot;&gt;U+E09E&lt;/span&gt; and &lt;span style=&quot;font-family:&#039;Courier New&#039;;font-size: 83%; background-color:#eef;&quot;&gt;U+E09F&lt;/span&gt;. That’s a lot bet­ters, since it avoids se­man­tic clash­es (don’t con­fuse search en­gines and other bots by typ­ing an “X” if you don’t mean “X”), and it also de­grades more grace­ful­ly if the in­tend­ed font isn’t avail­able (in which a “can’t print this” sym­bol is a bet­ter choice than the rather mis­lead­ing let­ter “X”).&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Still, it is far from per­fect, since it turns the Pri­vate Use Area into some kind of font-ven­dor-spe­cif­ic swamp de­void of any in­ter­op­er­abil­i­ty and mean­ing. After all, any in­for­ma­tion about what &lt;span style=&quot;font-family:&#039;Courier New&#039;;font-size: 83%; background-color:#eef;&quot;&gt;U+E09D&lt;/span&gt; &lt;i&gt;means&lt;/i&gt; is lost, since it could be an or­na­ment, a sym­bol (with a rather spe­cif­ic mean­ing), some rare lig­a­ture or some other ty­po­graph­i­cal fea­ture like a sub­script or a small cap­i­tal. So an even bet­ter ap­proach would be to in­ter­pret or­na­ments as some kind of &lt;i&gt;stylis­tic&lt;/i&gt; vari­a­tion of a de­fault or­na­ment, like the bul­let point &lt;span style=&quot;font-family:&#039;Courier New&#039;;font-size: 83%; background-color:#eef;&quot;&gt;U+2022&lt;/span&gt;. A search en­gine or any other kind of bot would see the let­ter &lt;span style=&quot;font-family:&#039;Courier New&#039;;font-size: 83%; background-color:#eef;&quot;&gt;U+2022&lt;/span&gt; and would know (more or less) what it is sup­posed to mean, and the dif­fer­ent or­na­ments could be ac­cessed as an Open Type fea­ture.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/18-Using-Adobe-Open-Type-Fonts-Ornaments-In-XeTeX.html#extended&quot;&gt;Continue reading &quot;Using Adobe Open Type Fonts Ornaments In XeTeX&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2012-08-12T13:01:47Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=18</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=18</wfw:commentRss>
    
    <dc:subject>TeX</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/17-guid.html">
    <title>Three.js and Stella-like polyhedrons</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/17-Three.js-and-Stella-like-polyhedrons.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;With a frame­work like Three.js, it is pret­ty easy to dis­play the faces of sim­ple poly­he­drons using WebGL. But a poly­he­dron, con­sid­ered less as a phys­i­cal and more as a topo­log­i­cal ob­ject, con­sists not only of its faces. In­stead often its ver­tices and edges are equaly in­ter­est­ing, and it would be nice to have an easy way to dis­play them, per­haps as­sign­ing them dif­fer­ent col­ors, to dis­tin­guish dif­fer­ent kinds of ver­tices or dif­fer­ent kinds of edges. With­in the pro­gram Stel­la, ver­tices can be dis­played as small balls and edges as thin tubes, and I wrote a func­tion to be used in con­junc­tion with Three.js which makes it a bit eas­i­er to con­struct sim­i­lar graph­i­cal ob­jects, fol­low­ing a sim­i­lar vi­su­al style, with­in WebGL.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;In the fol­low­ing ex­am­ples, I’ll as­sume that we have set up all the usual Three.js stuff with ren­der­ers and vir­tu­al cam­eras and mouse con­trols and lights and that we have de­fined a &lt;span class=&quot;ijs&quot;&gt;Scene&lt;/span&gt;-ob­ject. Fur­ther­more, I’ll as­sume that we im­port­ed my helper file &lt;a href=&quot;http://www.janthor.com/lib/JAN3D.js&quot;&gt;JAN3D.js&lt;/a&gt; which con­tains the func­tion &lt;span class=&quot;ijs&quot;&gt;JAN3D.stel­la()&lt;/span&gt; (among other stuff; I also in­clud­ed &lt;span class=&quot;ijs&quot;&gt;JAN3D.Tiny­Track­ball­Con­trols&lt;/span&gt;). I’ll show, using four ex­am­ples, how to use this func­tion.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/17-Three.js-and-Stella-like-polyhedrons.html#extended&quot;&gt;Continue reading &quot;Three.js and Stella-like polyhedrons&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2012-05-15T19:15:45Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=17</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    
    <dc:subject>Javascript</dc:subject>
<dc:subject>WebGL</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/16-guid.html">
    <title>Making the AnaglyphWebGLRenderer a bit more protruding</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/16-Making-the-AnaglyphWebGLRenderer-a-bit-more-protruding.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;The WebGL-frame­work Three.js I men­tioned in the pre­vi­ous entry has a nice vari­a­tion of its ren­der­er which ren­ders scenes as red-cyan anaglyphs. So using Three.js, you ba­si­cal­ly get anaglyphs for free with­out any ad­di­tion­al work on your part (an anaglyph is an image where you need glass­es with red and cyan glass­es to get a stereo­scop­ic, three-di­men­sion­al view).&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;I tried to con­struct a lit­tle scene using this abil­i­ty, but what I dis­liked was that the scene, as an anaglyph, was too dis­tant and ap­peared to be po­si­tioned be­hind the screen. I had a scene with sev­er­al con­cen­tric cir­cles of spheres, and I want­ed them to ap­pear to in­ter­sect the plane of the screen, with the cen­ter of the cir­cles co­in­cid­ing with the screen. And since I found no way of doing it, I plugged two new pa­ram­e­ters into Anaglyph­We­bGLRen­der­er, called the new ver­sion Pro­truding­Anaglyph­Web­GLRen­der­er and put it in a file &lt;a href=&quot;http://www.janthor.com/lib/ProtrudingAnaglyphWebGLRenderer.js&quot;&gt;Pro­truding­Anaglyph­Web­GLRen­der­er.js&lt;/a&gt;.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/16-Making-the-AnaglyphWebGLRenderer-a-bit-more-protruding.html#extended&quot;&gt;Continue reading &quot;Making the AnaglyphWebGLRenderer a bit more protruding&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2012-04-15T21:57:22Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=16</wfw:comment>
        <slash:comments>4</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=16</wfw:commentRss>
    
    <dc:subject>Javascript</dc:subject>
<dc:subject>WebGL</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/15-guid.html">
    <title>Modified TrackballControls for Three.js</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/15-Modified-TrackballControls-for-Three.js.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;WebGL is a tech­nol­o­gy that al­lows web browsers to dis­play graph­ics using the fast rou­tines of the graph­ics card, and Three.js is a frame­work which makes work­ing with WebGL a lot eas­i­er. Among many other things, Three.js pro­vides “con­trols”, Javascript ob­jects which han­dle the in­ter­ac­tion be­tween mouse events and the WebGL can­vas. One such con­trol is Track­ball­Con­trols. It maps mouse drag­ging ges­tures on an imag­i­nary track­ball and ro­tates the scene ac­cord­ing­ly. I have used it to make mod­els of poly­he­dra ro­tat­able for my view­ers: &lt;a href=&quot;http://www.janthor.com/skizzen/index.php?/archives/268-Stubsmuetter-und-Tribonacci.html&quot;&gt;Stub­smüt­ter und Trib­anoc­ci&lt;/a&gt; (a link to the Ger­man sec­tion of this blog).&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Per de­fault, the imag­i­nary Track­ball fills the en­tire avail­able brows­er win­dow. This is less than ideal if the ac­tu­al WebGL can­vas is just a tiny il­lus­tra­tion with­in a larg­er text:&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/15-Modified-TrackballControls-for-Three.js.html#extended&quot;&gt;Continue reading &quot;Modified TrackballControls for Three.js&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2012-04-14T22:30:05Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=15</wfw:comment>
        <slash:comments>8</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    
    <dc:subject>Javascript</dc:subject>
<dc:subject>WebGL</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/14-guid.html">
    <title>Mixing HTML and TeX in a StyledTextCtrl in wxPython</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/14-Mixing-HTML-and-TeX-in-a-StyledTextCtrl-in-wxPython.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;I have writ­ten my very own ed­i­tor with syn­tax high­light­ing to write these sketch­es. This is far less im­pres­sive than it might ap­pear on a first glance: wxWid­gets, and there­fore also wx­Python, pro­vide ac­cess to the Scin­til­la li­brary via the Styled­TextC­trl el­e­ment, and this el­e­ment can dis­play HTML source code and style the dif­fer­ent el­e­ments in dif­fer­ent col­ors. Scin­til­la pro­vides “lex­ers” for dif­fer­ent lan­guages, parsers which are able to de­ter­mine which frag­ments of a doc­u­ment are key­words, iden­ti­fiers, string lit­er­als, nu­mer­i­cal lit­er­als, op­er­a­tors, com­ments and so on, and to­kens from dif­fer­ent cat­e­gories can be styled dif­fer­ent­ly. So “writ­ing my own ed­i­tor” in fact just means “glu­ing to­geth­er some stan­dard pieces”. It looks like this:&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/14-Mixing-HTML-and-TeX-in-a-StyledTextCtrl-in-wxPython.html#extended&quot;&gt;Continue reading &quot;Mixing HTML and TeX in a StyledTextCtrl in wxPython&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-11-03T18:13:19Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=14</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=14</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>
<dc:subject>TeX</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/13-guid.html">
    <title>The girl version of the “On the population dynamics of “Puella Magi Madoka Magica”” essay</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/13-The-girl-version-of-the-On-the-population-dynamics-of-Puella-Magi-Madoka-Magica-essay.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;I’m not com­ple­tely con­tent with the ap­pearan­ce of the pre­ce­ding sketch, and so I de­ci­ded to try to pret­ti­fy it a bit. I re­pla­ced all the equa­ti­ons ge­ne­ra­ted by &lt;a href=&quot;http://www.forkosh.com/mimetexmanual.html&quot;&gt;mi­me­tex&lt;/a&gt; as GIF images with texts I pipe through &lt;a href=&quot;http://www.mathjax.org/&quot;&gt;Ma­th­Jax&lt;/a&gt;, so if you have Ja­va­script disa­bled, you’ll see all equa­ti­ons as \(\LaTeX\) plain­text. Fur­ther­mo­re, I re­pla­ced all the screen­caps I took from Open­Of­fice or Excel and re­pla­ced them with with pret­ty &lt;a href=&quot;http://matplotlib.sourceforge.net/&quot;&gt;mat­plot­lib&lt;/a&gt; plots; and I also re-did all the pre­vious mat­plot­lib plots. And I tried to en­han­ce the lay­out of the page a bit, and added more stills from the se­ries. So this is my se­cond take, the con­tent re­mains un­ch­an­ged, but I at­temp­ted to make the ap­pearan­ce more fit­ting for a se­ries about cute girls.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/13-The-girl-version-of-the-On-the-population-dynamics-of-Puella-Magi-Madoka-Magica-essay.html#extended&quot;&gt;Continue reading &quot;The girl version of the “On the population dynamics of “Puella Magi Madoka Magica”” essay&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-10-23T21:32:30Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=13</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=13</wfw:commentRss>
    
    <dc:subject>Anime</dc:subject>
<dc:subject>Math</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/12-guid.html">
    <title>On the population dynamics of “Puella Magi Madoka Magica”</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/12-On-the-population-dynamics-of-Puella-Magi-Madoka-Magica.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;This sketch is de­vot­ed to the pop­u­la­tion dy­nam­ics of the fic­tion­al world de­pict­ed by the Japanese an­i­mat­ed TV se­ries “Puel­la Magi Mado­ka Mag­i­ca”. As such, it is in­evitable going to re­veal at least one major plot point. So if you are plan­ning to watch this show, I sug­gest that you post­pone read­ing this sketch until you are done watch­ing it. You have been warned: there will be spoil­ers.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/12-On-the-population-dynamics-of-Puella-Magi-Madoka-Magica.html#extended&quot;&gt;Continue reading &quot;On the population dynamics of “Puella Magi Madoka Magica”&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-10-16T18:32:41Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=12</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    
    <dc:subject>Anime</dc:subject>
<dc:subject>Math</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/11-guid.html">
    <title>Why I won’t update Orbit Classic for Firefox 4</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/11-Why-I-wont-update-Orbit-Classic-for-Firefox-4.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;I hes­i­tat­ed up­dat­ing Fire­fox to ver­sion 4.0, since I feared it might break a lot of ex­ten­sions I use. Well, it cer­tain­ly broke my theme Orbit Clas­sic. But now that I made the tran­si­tion, I de­cid­ed that I won’t main­tain Orbit Clas­sic any longer. With Fire­fox&amp;#160;4.0, I’m happy with the de­fault theme – all the more since it’s pos­si­ble to cram all the chrome tight­ly to­geth­er, so there isn’t much left to style any­way. It’s the com­pact­ness of Google Chrome com­bined with the awe­some ex­ten­si­bil­i­ty and flex­i­bil­i­ty of Fire­fox.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/11-Why-I-wont-update-Orbit-Classic-for-Firefox-4.html#extended&quot;&gt;Continue reading &quot;Why I won’t update Orbit Classic for Firefox 4&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-05-10T20:32:43Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=11</wfw:comment>
        <slash:comments>7</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    
    <dc:subject>Deprecation Warning</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/8-guid.html">
    <title>Cascading Drop-Shadows</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/8-Cascading-Drop-Shadows.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;In &lt;a href=&quot;http://www.janthor.com/interferences/index.php?p=68&quot;&gt;chap­ter 4&lt;/a&gt; of “In­ter­fer­ences”, I’m using sev­er­al lay­ers stacked on top of each other with cu­mu­la­tive drop shad­ows. Of course I have writ­ten a Python ex­ten­sion for Inkscape to gen­er­ate such cas­cad­ing shad­ows au­to­mat­i­cal­ly.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Let’s start with a sim­ple ex­am­ple: five round­ed rect­an­gles stacked upon each other.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/8-Cascading-Drop-Shadows.html#extended&quot;&gt;Continue reading &quot;Cascading Drop-Shadows&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-05-04T20:36:00Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=8</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>
<dc:subject>SVG</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/7-guid.html">
    <title>Two-step text to path transformation</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/7-Two-step-text-to-path-transformation.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;In the pre­vi­ous sketch, I pre­sent­ed an Inkscape ex­ten­sion which con­vert­ed texts to paths, re­plac­ing du­pli­cate paths with use el­e­ments. This ex­ten­sion did call Inkscape it­self, re­quir­ing a some­what du­bi­ous hack.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;It is pos­si­ble to avoid this hack, al­though the al­ter­na­tive ver­sion (which I am going to present in this sketch) is slight­ly more round­about: the al­t­ner­na­tive ex­ten­sion needs to be called two times.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/7-Two-step-text-to-path-transformation.html#extended&quot;&gt;Continue reading &quot;Two-step text to path transformation&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-04-22T19:10:00Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=7</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>
<dc:subject>SVG</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/6-guid.html">
    <title>Fonts, Texts, Paths and Uses</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/6-Fonts,-Texts,-Paths-and-Uses.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;Using fancy fonts with SVG faces some pit­falls. One prob­lem is that font foundries are not fond of see­ing their font data ex­posed for ev­ery­one to fetch across the pond. Until re­cent­ly, using com­mer­cial fonts on the web was next to im­pos­si­ble, and the sup­port for fonts is still in its in­fan­cy, and usu­al­ly re­quires some model where fonts are pro­vid­ed in a heav­i­ly en­crypt­ed and pro­tect­ed way, in­com­pat­i­ble with SVG. It is hard to imag­ine any font foundry would allow their valu­able fonts to be pub­lished as font for­mats com­pat­i­ble with SVG.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;It’s pos­si­ble to cir­cum­vent this prob­lem by stick­ing to free fonts. But we im­me­di­ate­ly run into the next prob­lem: lack­ing SVG font sup­port in many browsers.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;An ob­vi­ous so­lu­tion is to re­place all tex­tu­al data with­in a SVG file with paths. If a user agent can dis­play SVG at all, it will be able to dis­play path data, so that’s a fall­back that will al­ways work (if SVG works at all).&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Un­for­tu­nate­ly, we loose the tex­tu­al in­for­ma­tion. That’s bad for search­ing, it’s bad for in­dex­ing, it’s un­friend­ly to­wards dis­abled users, and it might cause prob­lems down the road if we want to mod­i­fy files later on. It’s there­fore ad­vis­able to du­pli­cate text el­e­ments and to put one copy into a hid­den layer, while the other copy is trans­formed into path data.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;But there is an­oth­er draw­back: re­plac­ing text with paths in­creas­es the file size con­sid­er­ably. Part of this in­crease in size in un­avoid­able: after all, we are stor­ing glyphs as paths, and this glyph data in­evitably some­how must be trans­port­ed to the user, whether it is in the form of an aux­il­iary OTF file or some ad­di­tion­al paths in­creas­ing the size of the main SVG file.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;But an­oth­er part of this in­crease in file size &lt;i&gt;is&lt;/i&gt; per­fect­ly avoid­able. A font file con­tains the glyph def­i­ni­tion for the let­ter, say, &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;LATIN SMALL LETTER E&lt;/span&gt;, just once. A text con­vert­ed to a group of paths may con­tain the cor­re­spond­ing data sev­er­al times, one copy for each oc­cur­rence of the let­ter “e”. Even if we ac­cept the ne­ces­si­ty of the first oc­cur­rence of this data, all sub­se­quent oc­cur­rences are su­per­flu­ous. We can sub­stan­tial­ly com­press our file if we re­place all later oc­cur­rences of this let­ter with ref­er­ences to the path def­i­ni­tion of the first oc­cur­rence, by re­plac­ing the sub­se­quent &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;path&lt;/span&gt; el­e­ments with &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;use&lt;/span&gt; el­e­ments; or, using the ter­mi­nol­o­gy of Inkscape: by re­plac­ing them with linked clones. I have writ­ten an Inkscape ex­ten­sions which does ex­act­ly this.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/6-Fonts,-Texts,-Paths-and-Uses.html#extended&quot;&gt;Continue reading &quot;Fonts, Texts, Paths and Uses&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-04-21T19:09:00Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=6</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=6</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>
<dc:subject>SVG</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/5-guid.html">
    <title>Inkscape calling Inkscape</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/5-Inkscape-calling-Inkscape.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;The ca­pa­bil­i­ties of Inkscape can be ex­tend­ed with user scripts, but in a rather pe­cu­liar way: un­like other pro­grams which allow user scripts, Inkscape doesn’t ex­pose an API to a script en­vi­ron­ment. In­stead, it pipes the con­tent of the cur­rent SVG file to any ar­bi­trary user pro­gram reg­is­tered with an INX file, and this pro­gram is free to do with said file what­ev­er it wants, after which it should spew the file back via std­out to Inkscape.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;This means that an Inkscape ex­ten­sion has the most amount of free­dom imag­in­able in what it can do to the SVG file in ques­tion: it can do what­ev­er a Tur­ing ma­chine can do, and trans­form the input in ar­bi­trary and com­plete­ly out­landish ways. On the other hand, the ex­ten­sion can’t ac­cess any of the in­ter­nals of Inkscape and is com­plete­ly on its own.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Well, al­most. Inkscape at least pro­vides the &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;id&lt;/span&gt;s of the cur­rent­ly se­lect­ed ob­jects as ad­di­tion­al input op­tions, and the file it­self con­tains some hints about the cur­rent state of Inkscape (for ex­am­ple, which layer is cur­rent­ly ac­tive). But an ex­ten­sion can’t use some of Inkscape’s ef­fects. An ex­ten­sion might call other ex­ten­sions, but oth­er­wise, all ef­fects and meth­ods and tricks and pro­ce­dures it wants to use, it has to pro­vide it­self.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Which is some­times kind of an­noy­ing, since Inkscape ships with a lot of use­ful tools an ex­ten­sion might want to uti­lize. For ex­am­ple, an ex­ten­sion might want to split a path into its com­po­nents as one step with­in a larg­er pro­ce­dure. Such a split­ting of a path into com­po­nents isn’t too com­pli­cat­ed: take the path data, scan for oc­cur­rences of &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;&amp;quot;M&amp;quot;&lt;/span&gt; or &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;&amp;quot;m&amp;quot;&lt;/span&gt;, and split along them. But you also have to take into con­sid­er­a­tion that in the case of a lower case &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;&amp;quot;m&amp;quot;&lt;/span&gt;, the rel­a­tive co­or­di­nates of the first ver­tex must be re­placed with ab­so­lute co­or­di­nates, which means you have to scan the path data back­wards until you reach an ab­so­lute co­or­di­nate, and com­pute your cur­rent po­si­tion for­ward from there. Not ter­ri­bly hard to do, but an­noy­ing enough if you know that some­body else al­ready did it be­fore.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;Or per­haps you want to trans­form a text into a path, as the ex­ten­sion does we’ll dis­cuss in the fol­low­ing entry. That re­quires read­ing the ap­pro­pri­ate font, trans­form­ing glyphs to paths, deal­ing with kern­ing and a lot of com­pli­cat­ed and ad­vanced stuff, and stuff some­body al­ready solved in a com­plete­ly sat­is­fac­to­ry man­ner, since Inkscape it­self al­ready has a com­mand to trans­form texts to paths. So it is de­sir­able if we some­how could call Inkscape com­mands from with­in an Inkscape ex­ten­sion.&lt;/p&gt;

&lt;p class=&quot;first&quot;&gt;I wrote a Python mod­ule which ex­tends the &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;Effect&lt;/span&gt; class of the stan­dard &lt;span style=&quot;font-family: &#039;Courier New&#039;;color: #00007f;font-size:10pt;&quot;&gt;inkex&lt;/span&gt; mod­ule in such a way that this is, in­deed, pos­si­ble.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/5-Inkscape-calling-Inkscape.html#extended&quot;&gt;Continue reading &quot;Inkscape calling Inkscape&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-04-20T19:08:00Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=5</wfw:comment>
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>
<dc:subject>SVG</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/10-guid.html">
    <title>A Python script to convert ICO to CUR files</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/10-A-Python-script-to-convert-ICO-to-CUR-files.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;Need­ing a cur­sor as a CUR file (since that’s the only for­mat that works cross brows­er), I opened my cur­sor PNG file in The Gimp and tried to save it with a CUR ex­ten­sion, only for The Gimp to tell me that it doesn’t know that ex­ten­sion – which came as a nasty sur­prise to me, since The Gimp has no prob­lem sav­ing files in the ICO for­mat. As it turns out, Ir­fan­View, while being able to dis­play CUR files, can’t save them ei­ther. And Im­ageMag­ick, while un­der­stand­ing this for­mat, has no op­tion to de­fine a hotspot for the cur­sor (the hotspot is the one pixel with­in the cur­sor that de­fines where, ex­act­ly, you are when point­ing with the cur­sor).&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;My next idea was to look on the Wikipedia page for the CUR for­mat to see whether there are some open source (or at least free) ed­i­tors list­ed. And there I stum­bled upon the first good news of my quest: ap­par­ent­ly, the ICO for­mat and the CUR for­mat (at least in their clas­si­cal ver­sions) are ex­treme­ly sim­i­lar. With­in the main head­er of the file, I just have to change a sin­gle Byte to switch for­mats, and with­in an image table, there are two Bytes which ei­ther store some ICO-rel­e­vant in­for­ma­tion or the lo­ca­tion of the hotspot. And that’s it: if the ICO file con­tains just a sin­gle image, there are but three Bytes at fixed lo­ca­tions I have to change.&lt;/p&gt;
&lt;p class=&quot;follow&quot;&gt;So I saved my PNG as an ICO with The Gimp and wrote a lit­tle Python script to con­vert this file to a CUR file. My ini­tial script was only three lines long (read the bytes into mem­o­ry, change three of them, write them back to disk), but I added a bit of the usual com­mand line op­tions boil­er­plate plus error han­dling, and the re­sult is the fol­low­ing:&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/10-A-Python-script-to-convert-ICO-to-CUR-files.html#extended&quot;&gt;Continue reading &quot;A Python script to convert ICO to CUR files&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-04-14T20:13:22Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=10</wfw:comment>
        <slash:comments>14</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>

</item>
<item rdf:about="http://www.janthor.com/sketches/index.php?/archives/3-guid.html">
    <title>P3 Penrose Tilings</title>
    <link>http://www.janthor.com/sketches/index.php?/archives/3-P3-Penrose-Tilings.html</link>
    <description>
    &lt;p class=&quot;first&quot;&gt;For &lt;a href=&quot;http://www.janthor.com/interferences/index.php?p=52&quot;&gt;page 52&lt;/a&gt; of my &lt;a href=&quot;http://www.janthor.com/interferences&quot;&gt;In­ter­fer­ences Comic&lt;/a&gt;, I want­ed to use a Pen­rose tiling, name­ly, the P3 ver­sion of the Pen­rose tiling. A quick search on the web for Pen­rose tilings as SVG files un­earthed a file that used an L-sys­tem to draw a P3 Pen­rose tiling, but that was not what I want­ed: not only did I want a fin­ished tiling, I also want­ed the tiles to have two col­ors: one color for the “fat” rhombs and one color for the “thin” rhombs. So I wrote my own code in Python. Here is what the re­sult looks like:&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.janthor.com/sketches/index.php?/archives/3-P3-Penrose-Tilings.html#extended&quot;&gt;Continue reading &quot;P3 Penrose Tilings&quot;&lt;/a&gt;
    </description>

    <dc:publisher>Sketches</dc:publisher>
    <dc:creator>nospam@example.com (Jan Thor)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2011-04-13T16:55:00Z</dc:date>
    <wfw:comment>http://www.janthor.com/sketches/wfwcomment.php?cid=3</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.janthor.com/sketches/rss.php?version=1.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    
    <dc:subject>Python</dc:subject>
<dc:subject>SVG</dc:subject>

</item>

</rdf:RDF>
