Home Home
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Thomas Schraitle

Documentation team member, DocBook and XML supporter, book writer, and playing with XSLT, RELAX NG, Python, typography, fonts, and LaTeX

Author Archive

Hackweek: Finished Lower Case Letters

August 29th, 2008 by

The lower case letters are finished now! Well, to be precise, they are drawn, but they still need some tweaking.

See here a rough picture:
TomsMono, Version 0.1

Download the SFD and OpenType file from my public webspace (could take some time to get synchronized).

What’s missing:

  • Some proportions should be corrected
  • Hinting needs to be improved
  • Digits
  • More characters
  • Bold, italic, and bold+italic versions of the font
  • And probably much, much more

Have fun! Feedback is always welcome! 🙂

Hackweek: Drawing the Lower Case Characters

August 28th, 2008 by

In my previous post, I talked about the majuscles. Now it’s time to implement the minuscles, or the lower case characters.

This time, I omitted the sketch and try to implement it directly in FontForge. I think, it worked pretty well, but judge it yourself:

First draft of the lower case characters

It’s a first draft. Of course, I have to adjust a lot of things. The font is far from finished or being perfect. 🙂

After this, I have to find a good name. Any suggestions? Robert thinks, Toms Mono is a funny name and I should keep it. 😉

Hackweek: Create a Condensed Monospace Font

August 27th, 2008 by

You see it every day, you normally don’t think about it, but it is nevertheless important: Fonts.

Obviously we need fonts to communicate with each other, especially in digital media. A whole industry create thousends of fonts for different task: for books, magazines, headlines, comics, funerals, weddings, and much, much more.

However, these fonts are not free and as such cost money. Unfortunately, in the past there was a lack of good looking, professional fonts. The situation nowadays are getter better and better as we have very promising open source fonts: DejaVu, Gentium, LinuxLibertine, to name a few. Without these, our world of characters would be very small and we would have a limited choice only. It’s a pity that all these beautiful fonts don’t have a condensed monospace version. This would be very useful, for example you can have more characters on a line and you don’t have to break them into pieces.

As I haven’t found a suitable font for me, I thought why not create one? Of course, I could have used one of the above, apply some transformations and be happy (or not). But this is not really creative, so I thought why not design something totally new? So I have chosen this project for Hackweek.

Let’s make it clear: It is really hard and nobody really know the time and sweat that goes into a font. To create a really good looking font it is really a challenge—and obviously not possible during Hackweek. But I think, to create something new and gain some experience, this can be a lot of fun. 🙂

So here is the rough procedure that I used for this font:

  1. Draw some sketches
  2. Scan it with a scanner
  3. Import the image into Fontforge into the background
  4. Rescale the image
  5. (Re)draw manually the lines, straight and curved. You could try to use a tool that automates this task, but the results were not very satisfying.
  6. Expand the lines and make the “flesh” of the glyph.
  7. Remove any overlaps
  8. Adjust the width, curve, etc.
  9. Make a print out, look at it, and repeat some of the steps…

As I learn more and more of FontForge, these tasks become (hopefully) easier. The font is similar to Dejavu Mono, but not identical. The result of all these steps is shown in this graphic (be warned, obscure text ahead):

Toms Mono

As you can see I have drawn the majuscules only. I will try to implement the minuscles and other characters too, at the latest of the next Hackweek. 😉

Funny, but jimmac is working also on a font too. Good luck to you! 🙂

I will publish the font when I think it is in a somehow useful state. It will be released under an open source license (probably Open Font License or GPL, I don’t know yet).

Feedback welcome! 🙂

How to search more efficiently in Bugzilla with pybugz

June 19th, 2008 by

If you just want to search for bugs in Bugzilla, it’s (a bit?) painful: start the browser, type in the URL, insert your login and password and try to find out where to go. There is an easier way to do: pybugz for commandline lovers!

Thanks to Peter Poeml, get this very useful Python script from here. After you have installed it you need only two steps to configure it:

  1. Create a file ~/.bzuser and insert your Bugzilla login.

  2. Login into Bugzilla and insert your password. This creates the file ~/.bugz_cookie:

    $ /usr/bin/bugz-login

The script knows several subcommands, its interface is similar to CVS or Subversion. You can search, get, post, modify, attach and download an attachment, all with this utility. For example, if you want all bugs about “XML”, regardless of the product or component, you just type:

$ bugz search xml

That gives the following output:

 * Using https://bugzilla.novell.com/
 * Searching for 'XML'
 [ deleted a lot of lines ]

Maybe you want to narrow your search for KDE and specific products? No problem, here is an example:

$ bugz search KDE --product="openSUSE 11.0"
 * Using https://bugzilla.novell.com/
 * Searching for 'KDE' with the following options:
 * product = ['openSUSE 11.0']
113512 kde-maintainers Firefox in KDE - Only Uses GNOME Programs
170055 dmueller Firefox sets desktop background for Gnome under KDE
176179 kde-maintainers User can't edit properties for default notifications under KDE Storage Media and entries disepeared !
203548 sbrabec workrave-kde is an empty applet by default
[... and many more ...]

Of course, if you know the bug number you can retrieve it with:

$ bugz get 378240

and it will list all the details of the bug. Very useful! I haven’t tried the other subcommands yet, but I think they are also very convenient.

There are many more things to discover. So, when was your last time searching for bugs? 🙂

Query your XML with xpathgrep.py

June 9th, 2008 by

Maybe you know this problem: You have a couple of XML files and you need a specific information. Probably everybody would think of grep or similar tools first. But maybe your query is a bit more complicated than just a simple piece of text. What do do?

Recently I’ve found a very useful command line utility, which is probably not very known. It’s named xpathgrep.py and you can get it from the lxml repository (you need lxml too). Let’s assume we have the following DocBook file:

File db.xml
<?xml version="1.0"?>
<book>
  <title>My Cooking Book</title>
  <chapter>
    <title>Ingredients</title>
    <para>...</para>
  </chapter>
  <chapter id="howtocook">
    <title>How to cook</title>
    <para>...</para>
  </chapter>
</book>

Now, if I want to get all the titles I have to use a XPath (which is a path description language for XML, similar to Unix/Linux paths, but more powerful). To get all title elements all I have to do is to write //title, regardless of the level:

$ xpathgrep.py //title db.xml

and I get this:

<title>My Cooking Book</title>

<title>Ingredients</title>

<title>How to cook</title>

Nice, isn’t it? Probably you say: “But, hey, I can get this with grep too!” Yes, but if you want just all chapter titles, you have a problem with grep. With XPath and xpathgrep.py I only modify my XPath expression a bit:

$ xpathgrep.py //chapter/title db.xml

Now this reduces the above output just to the wanted chapter titles. And I can extent my query just for all chapters that doesn’t have an id attribute:

$ xpathgrep.py '//chapter[not(@id)]/title' db.xml

(You need the apostroph because of the shell.) The tool outputs this:

<title>Ingredients</title>

That’s nice, isn’t it? There are a lot of more to discover. A few hours ago I send a small patch to the lxml-devel mailinglist to support namespaces. Hopefully, it will be accepted. 🙂

Toms´ Musings about…

June 7th, 2008 by

Some time ago, I saw this posting about the new blogging platform. Well, I played with this a idea a bit and thought, this would be a good opportunity. 🙂

So who am I? Well, I’m with SUSE (or SuSE, S.u.S.E.?) since 2000 and mainly in charge with documentation. Apart from that, I’m known to attack heavily XML and XSLT stylesheets, to some degree I work also with Python. As you have suspected, yes, I’m also a long time DocBook user (should I say advocate?) and helped migrated our old LaTeX sources to DocBook years ago. And I love to play with typography and the like.

Yes, you guessed it: It’s very likely that I will write about DocBook, XML, XSLT, Python, typography and anything in between. Of course, anything what I think it interesting too.

Stay tuned! 😉