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

Enable pango font fallback #1222

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Conversation

bynect
Copy link
Member

@bynect bynect commented Oct 26, 2023

This is a simple addition to text rendering that allows fallback fonts. This improved my experience with #1211 when using a monospace with font awesome glyphs.

However this is not a complete solution! The problem with multiple fonts is in pango design.
It allows only one font to be loaded when rendering. In this patch I simply add the pango attribute for font fallback.

@bynect
Copy link
Member Author

bynect commented Oct 26, 2023

I just noticed that my editor removed some space 😅

src/draw.c Outdated
*/
// left side (fill)
cairo_set_source_rgba(c, cl->highlight.r, cl->highlight.g, cl->highlight.b, cl->highlight.a);
draw_rounded_rect(c, x_bar_1, frame_y, progress_width_1, progress_height,
draw_rounded_rect(c, x_bar_1, frame_y, progress_width_1, progress_height,
Copy link
Member

Choose a reason for hiding this comment

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

Why is there a change in progress bar drawing?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just noticed that my editor removed some space 😅 ^^

@bynect
Copy link
Member Author

bynect commented Nov 22, 2023

Looking back at it, I am quite at loss as to why the ci failed

@fwsmit
Copy link
Member

fwsmit commented Dec 31, 2023

Looking back at it, I am quite at loss as to why the ci failed

It seems the test failed because of some other reason. Pushing some code should re-run the test (I cannot find the button to re-run).

@fwsmit
Copy link
Member

fwsmit commented Dec 31, 2023

Does it fallback to the second font in the list or to some other font on the system?
It should fallback to the second font in the system, but I'm not sure why that's not happening. Do you have an idea?

@bynect
Copy link
Member Author

bynect commented Dec 31, 2023

Does it fallback to the second font in the list or to some other font on the system?
It should fallback to the second font in the system, but I'm not sure why that's not happening. Do you have an idea?

According to pango docs it should fallback using system font settings (so ignoring the given font list). But it seems like this works only on supported systems (fontconfig and maybe others).

@fwsmit
Copy link
Member

fwsmit commented Jan 25, 2024

@bynect could you push this branch, so the CI runs again? You might need to make a small change, which you can revert afterwards.

@bynect
Copy link
Member Author

bynect commented Jan 25, 2024

@fwsmit I removed the change in the bar code and force pushed

@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (19865c0) 66.03% compared to head (0d9c9d5) 65.43%.
Report is 45 commits behind head on master.

Files Patch % Lines
src/draw.c 20.00% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1222      +/-   ##
==========================================
- Coverage   66.03%   65.43%   -0.60%     
==========================================
  Files          46       46              
  Lines        7595     7753     +158     
==========================================
+ Hits         5015     5073      +58     
- Misses       2580     2680     +100     
Flag Coverage Δ
unittests 65.43% <20.00%> (-0.60%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fwsmit
Copy link
Member

fwsmit commented Jan 30, 2024

@fwsmit I removed the change in the bar code and force pushed

Thanks! The tests pass now, so I'll go ahead an merge!

@fwsmit fwsmit merged commit e3ffa8f into dunst-project:master Jan 30, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants