ax86 - entwicklunghttps://www.ax86.net/2021-06-12T22:08:00+02:00Now you can easily generate your own TTF versions of the Terminus font2010-08-28T21:19:00+02:002021-06-12T22:08:00+02:00Tbluetag:www.ax86.net,2010-08-28:/2010/08/28/generate-your-own-ttf-versions-of-the-terminus-font/<p>More than 6 months ago, I wrote about <a class="reference external" href="https://www.ax86.net/2009/11/03/generating-up-to-date-ttf-files-for-the-terminus-font/">generating <span class="caps">TTF</span> versions of the
Terminus
font</a>
(and published mine on that occasion), but I didn’t actually explain
<strong>how</strong> to generate them.</p>
<p>I found the answer to my problem (“How do I get <span class="caps">TTF</span> files from the
Terminus <span class="caps">BDF</span> source files?”) in the <a class="reference external" href="https://fontforge.org/docs/faq.html#faq-bitmap-outline">FontForge
<span class="caps">FAQ</span></a>:</p>
<ul class="simple">
<li>Create a new font.</li>
<li>Import the different sizes (one <span class="caps">BDF</span> file per font size). Make sure to
import the <span class="caps">BDF</span> file with the <strong>biggest</strong> bitmaps into the glyph background!</li>
<li>Select all glyphs.</li>
<li>Autotrace them.</li>
<li>Add extrema.</li>
<li>Simplify all glyphs.</li>
<li>Save as <span class="caps">TTF</span>.</li>
</ul>
<p>This process requires the <a class="reference external" href="http://autotrace.sf.net">AutoTrace</a>
program and <a class="reference external" href="http://fontforge.sf.net">FontForge</a>, obviously. While
repeating these steps at least two times (for the medium and bold
versions of Terminus) is not <em>that</em> hard, I really like to automate
things. I also wanted an italic version (I accomplished that by running
the <span class="caps">BDF</span> files through
<a class="reference external" href="http://hp.vector.co.jp/authors/VA013651/freeSoftware/mkbold-mkitalic.html">mkitalic</a>).</p>
<p>Fortunately, FontForge is
<a class="reference external" href="https://fontforge.org/docs/scripting/scripting.html">scriptable</a>! This
allowed me to write a script in FontForge’s own “legacy” scripting
language (the build I used didn’t support Python scripts…) to perform
the steps described above, a small wrapper for AutoTrace to remove the
obnoxious borders it adds to the resulting Postscript “images” and a
small shell script wrapper that runs mkitalic to produce italic <span class="caps">BDF</span>
files, tells FontForge to use my AutoTrace wrapper and finally runs the
FontForge script for the three different font weights (medium, bold and italic).</p>
<p>Since I had to do some research to obtain the above information, I
thought it would be nice to allow other people to easily generate <span class="caps">TTF</span>
versions of Terminus (mind you, I <em>might</em> lose interest some day!). The
scripts I wrote were only tested on unixoid systems (I didn’t test
whether they correctly run on Windows, e. g. using Cygwin or CoLinux;
they probably do, though).</p>
<p>Get the scripts here: <a class="reference external" href="https://github.com/Tblue/mkttf/archive/master.zip">https://github.com/Tblue/mkttf/archive/master.zip</a>.</p>
<p>Also check out my <a class="reference external" href="https://github.com/Tblue/mkttf">Git repository</a> on GitHub.</p>
<p>Read the included <span class="caps">README</span> file for information on how to use the
<tt class="docutils literal">mkttf.sh</tt> script. Feel free to post comments (questions, constructive criticism…)!</p>
<p>You might want to use these scripts to generate <span class="caps">TTF</span> versions of other
fonts than Terminus, too; since the scripts are all fairly generic, it
should be sufficient to modify <tt class="docutils literal">mkttf.sh</tt>.</p>
<p>Have fun!</p>
Generating up-to-date TTF files for the Terminus font2009-11-03T21:14:00+01:002009-11-03T21:14:00+01:00Tbluetag:www.ax86.net,2009-11-03:/2009/11/03/generating-up-to-date-ttf-files-for-the-terminus-font/<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference external" href="https://www.ax86.net/terminus%3A/">Look here</a> for the most recent
version of Terminus (<span class="caps">TTF</span>)!</p>
</div>
<p>My favourite monospaced programming font is
<a class="reference external" href="http://sourceforge.net/projects/terminus-font/files/">Terminus</a> — I
use it on each of my two machines.</p>
<p>The downloadable tarball contains scripts to generate versions of the
font which can be read e. g. by the X server or used with a Linux <span class="caps">TTY</span>.
That works wonderfully.</p>
<p>My old favourite text editor (<a class="reference external" href="http://geany.org">Geany</a>) used
fontconfig to manage fonts, so I didn’t have to to change anything to
make Terminus work with it. But recently I switched to a more
feature-rich <span class="caps">IDE</span>: <a class="reference external" href="http://netbeans.org">Netbeans</a>. Since Netbeans is
a Java application, it cannot use the font files which the X server (and
fontconfig) can read but instead needs <span class="caps">TTF</span> files.</p>
<p>Luckily, there is a <a class="reference external" href="http://fractal.csie.org/~eric/wiki/Terminus_font"><span class="caps">TTF</span>
version</a> of
Terminus available on the web. It works with Java (and Netbeans, too),
but that’s where my problems began: Firstly, the font seems to miss the
€uro symbol and secondly, it uses slanted single quotes, which simply
look ugly to me (too much like backticks). It also seems to be based on
an extremely old release of the Terminus font (dated back to 2004; that
wouldn’t even bother me that much if it would work flawlessly).</p>
<p>So what’s the solution? I figured out how to generate my own <span class="caps">TTF</span> version
of Terminus (even with outlines!) which fixes all my problems I
mentioned above. It isn’t perfect (well, the outlines aren’t), but it
works. Better than nothing, right?</p>
<p>Since I am such a generous person (ahem), I decided to make the files
available to the public. You can get them at
<a class="reference external" href="http://files.ax86.net/terminus-ttf">http://files.ax86.net/terminus-ttf</a>; please read the <span class="caps">README</span>.txt file for
licensing information.</p>
<p>To make your <span class="caps">JRE</span> aware of the fonts, copy them to its font directory
(/opt/java/jre/lib/fonts on Arch Linux).</p>
<p>Some closing and/or useful remarks:</p>
<ul>
<li><p class="first">According to commentator
<a class="reference external" href="https://www.ax86.net/2009/11/03/generating-up-to-date-ttf-files-for-the-terminus-font/#comment-generating-up-to-date-ttf-files-for-the-terminus-font-3">Infinality</a>:</p>
<blockquote>
<p>[The fonts] must be rendered in monochrome B/W. If you render
them in grayscale or subpixel they will be smeary.</p>
</blockquote>
<p>Thanks for the hint!</p>
</li>
<li><p class="first">The “ge1” patch has been applied to the <span class="caps">BDF</span> source files.</p>
</li>
<li><p class="first">Beware of the italic version: It’s extremely ugly (it has been
generated automatically by
<a class="reference external" href="http://hp.vector.co.jp/authors/VA013651/freeSoftware/mkbold-mkitalic.html">mkitalic</a>).</p>
</li>
<li><p class="first">I only tested the fonts on Linux and with Sun’s <span class="caps">JRE</span>. That means I
didn’t test how the font outlines look (as I said above, some of them
are not totally equal to the bitmaps), since Java uses the embedded
bitmaps (which should be fine, since I didn’t alter them).</p>
</li>
<li><p class="first">Tools I used to generate the fonts:
<a class="reference external" href="http://fontforge.sf.net">FontForge</a>,
<a class="reference external" href="http://autotrace.sf.net">AutoTrace</a>.</p>
</li>
<li><p class="first">For more information on how I actually <strong>generated</strong> the <span class="caps">TTF</span> files,
read <a class="reference external" href="https://www.ax86.net/2010/08/28/generate-your-own-ttf-versions-of-the-terminus-font/">Now you can easily generate your own <span class="caps">TTF</span> versions of the
Terminus
font</a>.</p>
</li>
<li><p class="first">Happy coding!</p>
</li>
</ul>
b2evolution (nun endgültig) komplett auf Deutsch2009-04-15T22:01:00+02:002009-04-15T22:01:00+02:00Tbluetag:www.ax86.net,2009-04-15:/2009/04/15/b2evolution-nun-endgueltig-komplett-auf/<p>Seit einigen Tagen ist die deutsche Übersetzung von b2evolution
abgeschlossen (momentane Phase: Ausbügeln von Tippfehlern etc.) und ist
bei Launchpad
<a class="reference external" href="https://translations.launchpad.net/b2evolution/trunk/+translations">einsehbar</a>.</p>
<p>Wer b2evolution benutzt und eine deutsche Übersetzung vermisst hat, kann
also aufatmen ;-) und vielleicht auch nach Fehlern etc. in der
Übersetzung schauen, wenn er möchte…</p>
<p>Vielleicht werden auch mehr deutsche Benutzer b2evolution benutzen, da
es b2evo nun komplett auf Deutsch gibt? Wer weiß, man wird sehen! :-)</p>
Hübsche Daten mit PHP2008-07-18T22:26:00+02:002008-07-18T22:26:00+02:00Tbluetag:www.ax86.net,2008-07-18:/2008/07/18/huebsche-daten-mit-php/<p>Falls jemand einmal in der Lage sein sollte, Daten in <span class="caps">PHP</span> “hübsch”
(“Heute”, “Gestern”, “am 03.09.2006 um 13:30:42”) darzustellen zu
müssen/wollen, habe ich für denjenigen den passenden <span class="caps">PHP</span>-Code.</p>
<div class="highlight"><pre><span></span><span class="cp"><?php</span>
<span class="c1">// Für alle Fälle:</span>
<span class="nb">date_default_timezone_set</span><span class="p">(</span><span class="s1">'Europe/Berlin'</span><span class="p">);</span>
<span class="c1">// Für deutsche Wochentagsabkürzungen, bei Bedarf entspr. abändern:</span>
<span class="nb">setlocale</span><span class="p">(</span><span class="nx">LC_TIME</span><span class="p">,</span> <span class="s1">'de_DE'</span><span class="p">);</span>
<span class="k">function</span> <span class="nf">nicedate</span><span class="p">(</span><span class="nv">$timestamp </span><span class="o">=</span> <span class="k">NULL</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$timestamp </span><span class="o">===</span> <span class="k">NULL</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$timestamp </span><span class="o">=</span> <span class="nb">time</span><span class="p">();</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$timestamp </span><span class="o">>=</span> <span class="nb">mktime</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&&</span>
<span class="nv">$timestamp </span><span class="o"><=</span> <span class="nb">mktime</span><span class="p">(</span><span class="mi">23</span><span class="p">,</span> <span class="mi">59</span><span class="p">,</span> <span class="mi">59</span><span class="p">))</span>
<span class="p">{</span>
<span class="c1">// Bei Bedarf Datumsformat abändern, siehe auch die anderen</span>
<span class="c1">// zwei strftime()-Aufrufe.</span>
<span class="k">return</span> <span class="nb">strftime</span><span class="p">(</span><span class="s1">'Heute um %H:%M:%S'</span><span class="p">,</span> <span class="nv">$timestamp</span><span class="p">);</span>
<span class="p">}</span> <span class="k">elseif</span> <span class="p">(</span>
<span class="nv">$timestamp </span><span class="o">>=</span> <span class="nb">mktime</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">date</span><span class="p">(</span><span class="s1">'n'</span><span class="p">),</span> <span class="nb">date</span><span class="p">(</span><span class="s1">'j'</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&&</span>
<span class="nv">$timestamp </span><span class="o"><=</span> <span class="nb">mktime</span><span class="p">(</span><span class="mi">23</span><span class="p">,</span> <span class="mi">59</span><span class="p">,</span> <span class="mi">59</span><span class="p">,</span> <span class="nb">date</span><span class="p">(</span><span class="s1">'n'</span><span class="p">),</span> <span class="nb">date</span><span class="p">(</span><span class="s1">'j'</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="p">{</span>
<span class="k">return</span> <span class="nb">strftime</span><span class="p">(</span><span class="s1">'Gestern um %H:%M:%S'</span><span class="p">,</span> <span class="nv">$timestamp</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">return</span> <span class="nb">strftime</span><span class="p">(</span><span class="s1">'%a, %d.%m.%y, %H:%M:%S'</span><span class="p">,</span> <span class="nv">$timestamp</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="c1">// Aktuelles Datum:</span>
<span class="k">echo</span> <span class="nx">nicedate</span><span class="p">()</span><span class="o">.</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span>
<span class="c1">// Gestern:</span>
<span class="k">echo</span> <span class="nx">nicedate</span><span class="p">(</span><span class="nb">mktime</span><span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mo">00</span><span class="p">,</span> <span class="nb">date</span><span class="p">(</span><span class="s1">'n'</span><span class="p">),</span> <span class="nb">date</span><span class="p">(</span><span class="s1">'j'</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span>
<span class="c1">// Damals...</span>
<span class="k">echo</span> <span class="nx">nicedate</span><span class="p">(</span><span class="nb">mktime</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">23</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1999</span><span class="p">))</span><span class="o">.</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span>
<span class="c1">// Beispiel der Konvertierung eines Strings in einen Timestamp,</span>
<span class="c1">// siehe auch: http://www.php.net/manual/en/function.strtotime.php</span>
<span class="k">echo</span> <span class="nx">nicedate</span><span class="p">(</span><span class="nb">strtotime</span><span class="p">(</span><span class="s1">'Fri, 18 Jul 2008 14:12:06 GMT'</span><span class="p">));</span>
<span class="cp">?></span>
</pre></div>
<p>Die Ausgabe sieht dann so aus:</p>
<pre class="literal-block">
Heute um 14:22:32
Gestern um 13:30:00
Mo, 01.03.99, 10:45:23
Gestern um 16:12:06
</pre>
Vorratsdatenspeicherungs-Pagepeel: Plugin für b2evolution2008-06-03T22:38:00+02:002008-06-03T22:38:00+02:00Tbluetag:www.ax86.net,2008-06-03:/2008/06/03/vorratsdatenspeicherung-pagepeel-plugin/<p>Ich machs kurz: Ich habe mir ein b2evolution-Plugin geschrieben, das das
<a class="reference external" href="http://wiki.vorratsdatenspeicherung.de/Online-Demo">Pagepeel des <span class="caps">AK</span>
Vorratsdatenspeicherung</a>
einblendet. Es gibt ein paar Konfigurationseinstellungen, ich bin jetzt
allerdings zu müde, das genauer zu erklären. Eine kleine Dokumentation
zu den Einstellungen liegt bei.</p>
<p><a class="reference external" href="https://www.ax86.net/2008/06/03/vorratsdatenspeicherung-pagepeel-plugin/akvs_onlinedemo_plugin.zip">Download</a>
(Version 1.0.2; getestet mit b2evolution 2.4.2, funktioniert evtl.
auch mit früheren Versionen; veröffentlicht unter der <a class="reference external" href="http://www.opensource.org/licenses/gpl-2.0.php"><span class="caps">GPL</span>
v2</a>).</p>
<p>Installation: Zip-Archiv entpacken und den enthaltenen Ordner in das
Verzeichnis <em>plugins</em> verschieben, im Backend Plugin aktivieren,
Blog-IDs in den Plugin-Einstellungen eintragen, freuen. :) Kritik ist
natürlich willkommen.</p>