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

Option to use bold font weight #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

metafates
Copy link

This PR adds a boolean argument --font-bold. If it is present, swaylock will use CAIRO_FONT_WEIGHT_BOLD as specified here

Closes #182

@hramrach
Copy link

It would be nice to support all font variants, rather than a hardcoded subset.

How do other application support those fonts that come in half dozen different weights and 3 different variants?

@hramrach
Copy link

From the docs:

Note: The cairo_select_font_face() function call is part of what the cairo designers call the "toy" text API. It is convenient for short demos and simple programs, but it is not expected to be adequate for serious text-using applications.

For "real" font selection, see the font-backend-specific font_face_create functions for the font backend you are using. (For example, if you are using the freetype-based cairo-ft font backend, see cairo_ft_font_face_create_for_ft_face() or cairo_ft_font_face_create_for_pattern().) The resulting font face could then be used with cairo_scaled_font_create() and cairo_set_scaled_font().

Similarly, when using the "real" font support, you can call directly into the underlying font system, (such as fontconfig or freetype), for operations such as listing available fonts, etc.

It is expected that most applications will need to use a more comprehensive font handling and text layout library, (for example, pango), in conjunction with cairo.

@hramrach
Copy link

This is likely the expected interface https://gtk.developpez.com/doc/en/pango/pango-Fonts.html#pango-font-description-from-string

It can parse the different font variants and options from free-form text description, there is no need to have a separate program parameter for each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

unable to set bold font
2 participants