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

Use property align-to indent title pixel width #404

Closed
wants to merge 3 commits into from

Conversation

manateelazycat
Copy link

If title include CJK font, title won't alignment like export, because Chinese char is not same width as English char.

This patch use align-to force title indent width special pixel.

@manateelazycat
Copy link
Author

Here is screenshot before apply patch https://ibb.co/RDzxScK

CJK char indent after apply patch https://ibb.co/pJz4z74

@skeeto
Copy link
Owner

skeeto commented Dec 31, 2020

I'm indeed seeing improved behavior when the frame is wide:

before
after

But no improvement when the frame is thin, where entry titles are truncated:

before-thin
after-thin

I also don't like that the space between entry title and feed title is gone, but that could probably be fixed by prefixing titles with a space.

I tested with https://www.tofugu.com/feed (the first thing I could find), but feel free to suggest any other feeds for testing.

@chen-chao
Copy link

But no improvement when the frame is thin, where entry titles are truncated

This is because elfeed-indent-pixel position is unfortunately back in the title characters when window-width is small (it ignores elfeed-search-title-min-width and elfeed-search-title-max-width actually).

A value that is complicated but near to the original behavior is:

(+ date-width 2 (max elfeed-search-title-min-width (min title-width elfeed-search-title-max-width)))

The pixel length of multi-bytes CJK characters is less than the pixel length of equal-bytes spaces (i.e. CJK titles are shorter). So this should be fine.

@manateelazycat
Copy link
Author

@skeeto I commit new patch to make align-to property works with thin window.

@chuxubank
Copy link

chuxubank commented Jan 9, 2021

@manateelazycat The newest commit still have defect on wide screen

Details image

@manateelazycat
Copy link
Author

@manateelazycat The newest commit still have defect on wide screen

Details

Done

@manateelazycat
Copy link
Author

@skeeto Can you merge this patch? Thanks.

@skeeto
Copy link
Owner

skeeto commented Jan 22, 2021 via email

@yantar92
Copy link

yantar92 commented Jan 22, 2021 via email

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.

None yet

5 participants