LibrePCB Blog

LibrePCB Meets FontoBene

Finally! LibrePCB has a fully functional stroke font which can be used on PCBs. So now you can place designators or other text items on silkscreen (or other layers) which of course are then exported into the generated Gerber files. The new font file format FontoBene was developed especially for LibrePCB.

Board Texts

Why a stroke font instead of OTF/TTF?

It may sound strange to implement a primitive stroke font in 2018 when we actually have much more powerful TrueType and OpenType fonts since many years. But there are still reasons to stick with the good old stroke fonts.

One reason is that OpenType and TrueType fonts are very complex and thus require high effort to integrate them into LibrePCB. For example the Gerber export is not as trivial as you may expect because Gerber supports neither fonts nor B├ęzier curves. On the other side, fonts consisting only of a bunch of lines are extremely easy to export into Gerber files.

Beside their simplicity, stroke fonts even have a clear advantage compared to OTF/TTF. Since you can set the stroke width to a value greater than or equal to the minimum silkscreen line width specified by your PCB manufacturer, you can be sure that the text items are printed properly and thus are perfect readable.

Text Properties

Introducing FontoBene

Unfortunately we were not happy with the available stroke font formats because of several reasons. Hershey and NewStroke fonts have many edges because they only consist of straight line segments. LFF from LibreCAD and CXF from QCad look much smoother because they support circular arc segments, but unfortunately there aren’t any clear specifications available and the existing fonts have non-permissive, partly even unknown licenses.

So we started to create clear specifications for a new stroke font file format, called FontoBene. Because the project is completely independent from any software project (even from LibrePCB), our hope is that it will also be used by other projects some time.

FontoBene

Currently LibrePCB uses the NewStroke font which we converted to FontoBene, mainly because it is available under the CC0 Public Domain license. This means that we currently don’t yet take advantage of having support for circular arc segments. The goal is to improve the font step by step.

Self-Contained Projects

In contrast to other EDA tools, LibrePCB embeds the used font files into each project. When creating a new project, The font files from the applications installation directory are just copied into the projects directory.

The main advantage of this concept is that it makes projects more self-contained, i.e. projects are not affected at all if we modify or even replace the font files bundled with the application. So there is no risk to break existing projects by modifying the applications font files.

Another advantage is that users are free to modify the font files of specific projects. For example if our font is missing a glyph you would need, or if you’re unhappy with the look of some glyphs, you can just modify the font files in your project to fix it. Other EDA tools do not allow users to modify their (built-in) fonts.

LibrePCB Talk at FOSDEM 2018

The Free and Open Source Software Developers’ European Meeting (FOSDEM) is a great event for developers and users interested in free software. It is hosted at the ULB Solbosch Campus in Brussels, Belgium. This year it takes place on February 3 / 4.

FOSDEM

There are many different tracks available, but for us the most interesting one is the CAD and Open Hardware devroom. It contains talks about PCB design, FPGA design, SPICE simulation and open hardware in general.

And this year we have submitted the Introduction to LibrePCB talk to present our project! The talk takes place on Saturday, February 3, 16:00 in room K.4.201. For those who cannot attend, there are also live streams available :-)

LibrePCB Has Switched to S-Expressions

One major goal of LibrePCB is to use human readable files to represent libraries, projects and so on. This is important to let the user understand what the EDA tool actually does when modifying a schematic or board. In addition, a good file format is essential for version control systems to keep track of changes in libraries and projects.

But LibrePCB doesn’t just want to have some human readable file format. It wants to use the best possible file format for our specific needs!

XML and Similar Formats

Until now, LibrePCB used XML as file format. But unfortunately we were not very happy with it, because of several reasons:

  • The XML specifications are rather complex (we used only a small subset of the available features). In this blog post you can see that this complexity can even be dangerous!
  • The syntax is quite verbose (it even contains redundant information, e.g. <size>2.54</size>).
  • Available XML generators typically provide only little control over the formatting of the generated XML files. This leads to either very long files (many linebreaks) or very long lines (only few linebreaks). Both is bad for readability.

Other file formats (or their generators) have similar issues, so it seems that the only reasonable solution is to use a custom file format, or at least a custom generator.

S-Expressions with Custom Generator

To avoid completely reinventing the wheel, we decided to use the S-Expressions file format. KiCad uses this file format since version 4.0, and it seems that it’s really well suited for the use case of an EDA tool.

S-Expressions are very simple to understand, but still powerful enough for LibrePCB. And the syntax is not verbose, but still expressive.

With a custom S-Expressions generator, we are now able to control every little bit of the format of our generated files. Here you can see the difference between the old XML file format and the new S-Expressions file format:

XML vs. S-Expressions

Note: Even if the S-Expressions file has 6 lines more than the XML file, it’s ~16% smaller in size!

LibrePCB Has a Blog! :-)

Here it is: The long awaited blog of LibrePCB!

Hello Blog!

It’s still very basic, but this will be improved some time ;)

From now on, we will use this blog to provide various information, e.g. announcements of upcoming events, release notes, development progress or technical explanations.

If you have any input regarding this blog or our website in general, please open an issue on the GitHub repository.