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: Support for formatting titles as right-to-left text #131

Closed
DenverCoder1 opened this issue Aug 28, 2023 · 2 comments · Fixed by #144
Closed

🚀 Feature: Support for formatting titles as right-to-left text #131

DenverCoder1 opened this issue Aug 28, 2023 · 2 comments · Fixed by #144
Assignees
Labels
feature New feature or request good first issue Good for newcomers up-for-grabs

Comments

@DenverCoder1
Copy link
Owner

DenverCoder1 commented Aug 28, 2023

Description

In the best case scenario, it should automatically be able to determine whether the title text should be displayed left-to-right or right-to-left and format it as such, without the use of a query parameter. The lang query parameter cannot necessarily be relied on since videos with English titles probably should not be right-aligned.

A library or a simple RTL character count vs LTR character count could be used to determine which direction the title should be formatted in.

Actual output

https://ytcards.demolab.com/?id=dQw4w9WgXcQ&title=לורם%20איפסום%20דולור%20סיט%20אמט,%20קונסקטורר%20אדיפיסינג%20אלית&lang=he&timestamp=1693000000&max_title_lines=2&width=250&border_radius=5

image

Expected output

image

<g xmlns="http://www.w3.org/2000/svg" transform="translate(240, 150)">
    <text fill="#ffffff" font-family="Roboto, Segoe UI, Ubuntu, Arial, sans-serif" font-weight="600" font-size="15px" direction="rtl">
        <tspan x="0" dy="20px">לורם איפסום דולור סיט אמט,</tspan>
        <tspan x="0" dy="20px">קונסקטורר אדיפיסינג אלית</tspan>
    </text>
</g>

The x offset should be {{ width - 10 if rtl_title else 10 }}. The direction of the text should be set to {{ 'rtl' if rtl_title else 'ltr' }}.

rtl_title is a made up variable that will need to be created based on the direction of the title text (not the same as the existing rtl which is for the stats)

@DenverCoder1 DenverCoder1 added feature New feature or request good first issue Good for newcomers up-for-grabs labels Aug 28, 2023
@Vyvy-vi
Copy link
Contributor

Vyvy-vi commented Sep 30, 2023

I would really like to work on this issue

@DenverCoder1
Copy link
Owner Author

@Vyvy-vi Great! Feel free to let me know if you have any questions 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers up-for-grabs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants