-
-
Notifications
You must be signed in to change notification settings - Fork 949
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
Adds right-to-left script option. #281
base: main
Are you sure you want to change the base?
Conversation
Implements right-to-left script (rtl) functionality to Typing SVG, meaning the animation will start from the right if true. Useful for languages such as Arabic, Hebrew, Urdu, or simply for style.
Implements right-to-left script (rtl) functionality to Typing SVG, meaning the animation will start from the right if true. Useful for languages such as Arabic, Hebrew, Urdu, or simply for style. Testers wanted.
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.
Thanks for working on this issue, your help is much appreciated!
It seems like it is not fully working, the letters are upside-down:
It should look like this:
Tested with Hebrew lorem ipsum:
@@ -71,7 +69,6 @@ Below are links to profiles where you can see Readme Typing SVGs in action! | |||
[![UlisesAlexanderAM](https://github.com/UlisesAlexanderAM.png?size=60)](https://github.com/UlisesAlexanderAM "UlisesAlexanderAM on GitHub") | |||
[![SpookyJelly](https://github.com/SpookyJelly.png?size=60)](https://github.com/SpookyJelly "SpookyJelly on GitHub") | |||
[![cfcife](https://github.com/cfcife.png?size=60)](https://github.com/cfcife "cfcife on GitHub") | |||
[![majidtdeni666](https://github.com/majidtdeni666.png?size=60)](https://github.com/majidtdeni666 "majidtdeni666 on GitHub") |
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.
Adding/removing examples is off topic for this PR and preferably a separate branch/PR should be opened for unrelated changes
@@ -125,6 +123,7 @@ Feel free to [open a PR](https://github.com/DenverCoder1/readme-typing-svg/issue | |||
| `background` | Background color of the text (default: `00000000`) | string | Hex code without # (eg. `FEFF4C`) | | |||
| `center` | `true` to center text or `false` for left aligned (default: `false`) | boolean | `true` or `false` | | |||
| `vCenter` | `true` to center vertically or `false`(default) to align above the center | boolean | `true` or `false` | | |||
| `rtl` | `true` to use right-to-left script (Arabic, Hebrew…) (default: `false`) | boolean | `true` or `false` | |
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.
What if instead of having a parameter, it could determine the direction to display the text based on the directionality of the first unidirectional character (eg. if it starts with an English letter it's LTR, if it starts with Arabic it's RTL, standard punctuation is ignored)? Alternatively, it could be determined based on a count comparison of RTL vs LTR characters. By making it automatic, it could simplify configuration and the demo site.
Feel free to let me know what you think.
Summary
Implements right-to-left script (rtl) functionality to Typing SVG, meaning the animation will start from the right if true. Default is still false.
Useful for languages such as Arabic, Hebrew, Urdu, or simply for style. Testers wanted.
Type of change
How has this been tested?
composer test
.