-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Xft2 with fallback #403
Xft2 with fallback #403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mikeandmore
Really good work. A few stylistic changes, but otherwise seems to look good to me on a first pass!
libs/Fft.c
Outdated
@@ -332,6 +332,7 @@ static void MatchFont(Display *dpy, | |||
*yoff += info.yOff; | |||
|
|||
if (render_char) render_char(user_data, &sp); | |||
else if (sp.font != font) XftFontClose(dpy, sp.font); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh -- the style here is terrible. Not your fault though, you're just in-keeping with what's already there.
We should really get something like clang-format
to handle this for us. (Hint, hint. :P)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, that's a pure typo though.
libs/Fft.c
Outdated
// Searching 64 shorts doesn't takes a full hash table. That's only two | ||
// cache lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment style needs changing.
libs/Fft.c
Outdated
unsigned short hash = FcPatternHash(src); | ||
hash ^= code; // Because FcPatternHash() does not hash charset due to its cost. | ||
|
||
for (int i = font_cache.fifo_start; i < font_cache.fifo_end; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C89 loop delclaration, please.
Let me know if I miss anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mikeandmore
Thanks. This looks good to me. Will likely merge tomorrow.
Hey @mikeandmore This looks good now. Just one final thing to do before I merge this. Please can you squash:
into:
Best way to do this is on your
Then in your editor, where it litsts:
Change Hope that makes sense. Cheers, |
1. We don't need CombineChars for Xft2, we can convert using Fontconfig on the fly. 2. XftFontMatch() is slow and so we need a cache. This cache works well for menus because same characters are rendered repeatly when the cursor moves in/out a menu item.
e17b8a5
to
88431ae
Compare
pushed. |
This PR removes Xft1 support and add font fallback to Xft2 support. With font fallback, fvwm can now render unicode strings.