Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle fonts used in schematics together with LibrePCB #282

Merged
merged 4 commits into from Jun 30, 2018

Conversation

ubruhin
Copy link
Member

@ubruhin ubruhin commented Jun 25, 2018

This makes LibrePCB using Noto Fonts for schematics. To ensure consistent look over all platforms, the fonts are bundled together with LibrePCB. So the look of schematics no longer depends on the available system fonts.

Preview:
auswahl_004

Fixes #153.

@ubruhin ubruhin added this to the 0.1 milestone Jun 25, 2018
@ubruhin ubruhin self-assigned this Jun 25, 2018
@dbrgn
Copy link
Member

dbrgn commented Jun 26, 2018

Can the bundled fonts be easily replaced with system fonts during packaging?

@ubruhin
Copy link
Member Author

ubruhin commented Jun 26, 2018

Can the bundled fonts be easily replaced with system fonts during packaging?

Yeah, actually one can just remove the fonts directory, then Qt automatically falls back to system fonts (fonts are recognized by their name, no matter if they are system fonts or bundled fonts).

font.setStyleStrategy(QFont::StyleStrategy(QFont::OpenGLCompatible | QFont::PreferQuality));
font.setStyleHint(QFont::TypeWriter);
font.setFamily("Monospace");
QFont font = qApp->getDefaultMonospaceFont();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Qt prefers the bundled fonts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I just noticed that we provide this method ourself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right :) Qt itself doesn't really distinguish between bundled or system fonts...

@ubruhin ubruhin force-pushed the 153-bundle-schematic-fonts branch from 77e8d3e to fb429c8 Compare June 30, 2018 17:58
@ubruhin ubruhin merged commit 527b815 into master Jun 30, 2018
@ubruhin ubruhin deleted the 153-bundle-schematic-fonts branch June 30, 2018 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants