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

Feature suggestion: allow font-size adjustments to social card titles #2974

Closed
4 tasks done
zhyatt opened this issue Aug 25, 2021 · 7 comments
Closed
4 tasks done

Feature suggestion: allow font-size adjustments to social card titles #2974

zhyatt opened this issue Aug 25, 2021 · 7 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@zhyatt
Copy link

zhyatt commented Aug 25, 2021

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

When the length of a title on a page results in 3 lines of text on the card needed (ex. "Block confirmation tracking"), the last line of text gets partially cut off. This change feels more like the exception than the rule so a single site-wide change doesn't feel appropriate to me. Perhaps allowing the use of meta data on pages to change the title size as needed is an option.

Use Cases

This would allow more flexibility for adjusting social card presentation in order to fit different size titles.

Screenshots / Mockups

Screen Shot 2021-08-25 at 8 30 45 AM

@squidfunk
Copy link
Owner

Thanks for reporting. There are still some cases to consider for the social cards preview images, as some fonts have larger heights than Roboto (which seems to be the case here). I'd say that the height should be self-adjusting so that the user doesn't have to do anything, but I have to invest some time to see whether this is possible with a reasonable amount of effort.

I'll try to come up with a solution when I manage to find the time to work on this feature again.

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Aug 25, 2021
@squidfunk squidfunk changed the title Allow font size adjustments to social card titles Feature suggestion: allow font-size adjustments to social card titles Sep 11, 2021
@squidfunk
Copy link
Owner

Fixed in 8fb42f306.

Before introducing more options for font-sizes etc, I've decided to make the default more consistent. Social cards will receive more configuration options, maybe even custom layouts in the future. However, for this to work, I need to rethink how to handle text boxes more elastically. The problem reported was originating from different ascent and descent values of fonts. I've done my best to normalize the spacing for now, which should now lead to more consistent rendering across different fonts. Noto Sans (which you used) and Roboto are good to compare, as they are pretty different:

Noto Sans

index

Roboto

index-6

If you overlay both images, you'll see that lines are now evenly spaced, i.e. they start at the same vertical offsets. This ensures that nothing gets cut off vertically. For now, font sizes cannot be set explicitly, but I'll consider this in the future. Other things to be addressed in the future:

  • Better handling of long titles: either handle with ellipsis, or shrink-to-fit font size
  • Custom positioning, spacing, etc.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Oct 17, 2021
@squidfunk
Copy link
Owner

Released as part of 7.3.4+insiders-3.1.4

@yrashk
Copy link
Sponsor

yrashk commented Apr 10, 2023

It feels like I need dynamic font sizing as it just tends to cut off the title, sometimes changing its meaning:

image

Where the title is actually this:

Avoiding Postgres Extensions Limitations

@squidfunk
Copy link
Owner

squidfunk commented Apr 10, 2023

Thanks! I have a working prototype with automatic font sizing, just need to finish it 😀 Social cards will get an update soon. Note that this is a rather pathological case with three long words. As a workaround you might try using another font!

@yrashk
Copy link
Sponsor

yrashk commented Apr 10, 2023

I am super eager to try it out, as people have already noticed the problem! https://twitter.com/diggya/status/1645280932557905920

@squidfunk
Copy link
Owner

Awesome! I expect it to hit the shelves later this year, as I'm currently focusing on re-architecting the search – there are so many open change requests regarding search that need to be handled first 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants