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

adding RTL support #303

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

adding RTL support #303

wants to merge 1 commit into from

Conversation

mostaf7583
Copy link

Description

This pull request adds support for RTL (Right-to-Left) languages. Specifically, I've included Arabic text with the appropriate HTML structure and CSS styles to ensure proper rendering. The font used is 'Amiri', and I've provided a path to the font file.

Here's the htmlString that demonstrates the changes:

String htmlString = 
    "<html lang=\"ar\">\n" +
    "<head>\n" +
    "    <meta charset=\"UTF-8\" />\n" +
    "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n" +
    "    <title>سورة الفلق</title>\n" +
    "    <style>\n" +
    "        @font-face {\n" +
    "            font-family: 'Amiri';\n" +
    "            src: url('file:///home/mostafa/Desktop/Archive/testingplayer/searchfr/temp/temp_bc/org.kie.bc.KIEWebapp/fonts/Amiri-Regular.ttf');\n" +
    "        }\n" +
    "        body {\n" +
    "            font-family: 'Amiri', serif;\n" +
    "            direction: rtl;\n" +
    "            text-align: right;\n" +
    "            background-color: #f9f9f9;\n" +
    "            color: #333;\n" +
    "            padding: 20px;\n" +
    "            margin: 0;\n" +
    "        }\n" +
    "        .verse {\n" +
    "            margin-bottom: 20px;\n" +
    "        }\n" +
    "        .verse-number {\n" +
    "            font-weight: bold;\n" +
    "            color: #555;\n" +
    "        }\n" +
    "    </style>\n" +
    "</head>\n" +
    "<body>\n" +
    "    <div class=\"verse\">\n" +
    "        <span class=\"verse-number\">١</span> قُلْ أَعُوذُ بِرَبِّ ٱلْفَلَقِ\n" +
    "    </div>\n" +
    "    <div class=\"verse\">\n" +
    "        <span class=\"verse-number\">٢</span> مِن شَرِّ مَا خَلَقَ\n" +
    "    </div>\n" +
    "    <div class=\"verse\">\n" +
    "        <span class=\"verse-number\">٣</span> وَمِن شَرِّ غَاسِقٍ إِذَا وَقَبَ\n" +
    "    </div>\n" +
    "    <div class=\"verse\">\n" +
    "        <span class=\"verse-number\">٤</span> وَمِن شَرِّ ٱلنَّفَّٰثَٰتِ فِى ٱلْعُقَدِ\n" +
    "    </div>\n" +
    "    <div class=\"verse\">\n" +
    "        <span class=\"verse-number\">٥</span> وَمِن شَرِّ حَاسِدٍ إِذَا حَسَدَ\n" +
    "    </div>\n" +
    "</body>\n" +
    "</html>";

Notes

  • The font file path provided in the CSS (src: url('file:///home/mostafa/Desktop/Archive/testingplayer/searchfr/temp/temp_bc/org.kie.bc.KIEWebapp/fonts/Amiri-Regular.ttf');) should be updated to the correct path in your environment.
  • The HTML and CSS are designed to ensure the content is displayed correctly in RTL format, with proper font styling and alignment.

Additional Information

This is my first ever pull request, and I'm excited to contribute to this project. I appreciate your time and feedback on this addition. Thank you for the opportunity to contribute!


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.

1 participant