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

Ported to version 4.0 and font spacing/colors aren't working #1

Open
mainframed opened this issue Aug 31, 2020 · 2 comments
Open

Ported to version 4.0 and font spacing/colors aren't working #1

mainframed opened this issue Aug 31, 2020 · 2 comments

Comments

@mainframed
Copy link

I'm not sure if this is dead or not but I ported this to 4.0 here:

mainframed/x3270-xft-changes@dbcb213

And it compiles and works, sort of. Two issues: The font spacing doesn't put the characters in the right place, unless I highlight over them, also intense colors (bold) seems to put the background over the text.

I'm a little in over my head when it comes to writing X11 C code and any help would be appreciated.

Here's some examples (spacing issues):
image
vs
image

And here's what happens when you use the intense hilight for 3270:

Normal:
image
xft (monospace-12):
image

@vadimshchukin
Copy link
Owner

I'm not sure if this is dead or not but I ported this to 4.0 here:

mainframed/x3270@dbcb213

And it compiles and works, sort of. Two issues: The font spacing doesn't put the characters in the right place, unless I highlight over them, also intense colors (bold) seems to put the background over the text.

I'm a little in over my head when it comes to writing X11 C code and any help would be appreciated.

Here's some examples (spacing issues):
image
vs
image

And here's what happens when you use the intense hilight for 3270:

Normal:
image
xft (monospace-12):
image

Nice to see my patch is useful for someone :-)

It was a long time ago when I was experimenting with this code. I think I had the same issue with the font spacing, apparently the spacing doesn't account with these new fonts. Back then I didn't try to actually fix it in the code, but instead I was just setting the appropriate font size in the terminal. Not sure about the second issue though. Could you try to experiment with the font size (maybe some other related parameters like the terminal resolution, etc.) to check if it works fine with some appropriate size? Maybe it affects the second issue as well. If that's true then it could be used to normally fix the issue in the code.

@mainframed
Copy link
Author

mainframed commented Sep 3, 2020

Wow thanks for getting back to me!!

Ok, can confirm that adjusting the font size fixed the kerning/spacing issue:

image

Maybe it affects the second issue as well. If that's true then it could be used to normally fix the issue in the code.

No change. I'm almost certain this has something to do with setting "intense" and I'm not familiar enough with X api to figure it out.

I think it's these lines:

    XGetGCValues(display, gc, GCForeground, &xgc_values);
    XRenderColor xr_color = {0x00ff, 0x00ff, 0x00ff, 0xffff};     /* Convert GC color to XRenderColor */
    memcpy((char*)&xr_color.red + 1, (char*)&xgc_values.foreground + 2, 1);
    memcpy((char*)&xr_color.green + 1, (char*)&xgc_values.foreground + 1, 1);
    memcpy((char*)&xr_color.blue + 1, (char*)&xgc_values.foreground + 0, 1);

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

No branches or pull requests

2 participants