Skip to content

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