Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement stroke texts for footprints and boards #246
Note: There are still some open questions to clarify before this is ready to merge. But here already an explanation about this new feature:
Until now we used TrueType fonts in footprints/boards, but they cannot be exported into the Gerber format without extremely high effort. So we need stroke fonts (like most CAD/EDA applications). But because we were not happy with existing stroke font technologies, we started to develop specifications for a new stroke font: https://github.com/fontobene/fontobene/blob/master/SPECIFICATION.md
As these specifications will be ready soon, I started to implement them in LibrePCB. They can now be used in footprints and boards. Schematics still use TrueType fonts as no Gerber export is required.
Application Font Pool
Now the application has a directory where FontoBene files are located. They are loaded at runtime, so they need to be deployed together with the application. The library editor uses the default application font when editing footprints.
Project Font Pool
To remove the dependency of projects/boards to the application-wide fonts (and thus make projects even more self-contained), projects copy the application-wide fonts into the directory
In addition, this even allows users to use other fonts for their boards :) Other EDA tools do not provide this flexibility as fonts are often strongly bundled with the application.
Default Board Font
Currently there is only one font available, but in future we may provide various fonts and allow the user to specify what font should be used for every text object placed on a board. So we need to specify which one is the default font. That's now a property of every board, so you can choose the default font for every board separately.
Board Text Objects
Users can now place standalone text objects on boards:
To modify these text objects, there's a property dialog:
Footprint Text Objects
Footprints (in the library) typically contain text objects for name and value. When adding a footprint to a board, all its contained text objects are now copied as separate text objects (not just referenced), decoupled from the footprint. The original footprint text objects are not shown in a board. This way the decoupled text objects can be modified (e.g. moved/rotated) separately.
Footprint texts can also be removed from a board if not used. Maybe some time we can add a "lock text objects" property to footprints to avoid accidentally removing or modifying text objects.
Board File Changes
In the demo workspace you can see what has changed in the board file: LibrePCB/demo-workspace@94942f5#diff-8482b174ff3f28dcc855f119f2294404
Of course a board file is now a lot larger. But I think that's worth it...
Feedback is very welcome! You can already check this branch out to test the new features. It's not too late to make some changes