convert fonts to English fonts and write directions to ltr
- User
convert fonts to English fonts and write directions to ltr
- Assistant
- User
- Assistant
convert fonts to English fonts and write directions to ltr
Certainly! Converting non-English fonts or scripts to English fonts requires understanding the original script and translating it to English. Additionally, if you're dealing with right-to-left (RTL) languages like Arabic or Hebrew and wish to change the text direction to left-to-right (LTR), you will need to reverse the order of the text after translating it to English. Here is a step-by-step guide:
First, identify the language and text you want to convert. For example:
Arabic:
مرحبا كيف حالك؟
Hebrew:
מה שלומך?
Use a reliable translation tool or a professional translator to convert the text into English.
Arabic to English:
مرحبا كيف حالك؟ -> Hello, how are you?
Hebrew to English:
מה שלומך? -> How are you?
Arabic and Hebrew are RTL languages, which means texts start from the right side. After translating to English, which is LTR, ensure the text is read from left to right.
Arabic:
مرحبا كيف حالك؟Hello, how are you?Hebrew:
מה שלומך?How are you?If you are working with documents or web pages, make sure you have set the text direction appropriately. Here's how you can do it in HTML:
HTML Direction for LTR:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LTR Example</title>
</head>
<body>
<p>Hello, how are you?</p>
<p>How are you?</p>
</body>
</html>
HTML Direction for Mixed or RTL Content: If you have a mix of languages, you might need to specify the direction for specific elements.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mixed Direction Example</title>
</head>
<body>
<!-- This is an English paragraph and should be LTR -->
<p>Hello, how are you?</p>
<!-- This is an Arabic paragraph and should be RTL -->
<p dir="rtl">مرحبا كيف حالك؟</p>
<!-- This is a Hebrew paragraph and should be RTL -->
<p dir="rtl">מה שלומך?</p>
</body>
</html>
If you need a specific script or have more complex documents, it might involve additional fonts and layout considerations. Feel free to ask for more details if you have a particular use case!
do it in the following codes: @font-face { font-family: 'Droid Arabic Kufi'; font-style: normal; font-weight: 400; src: local('Droid Arabic Kufi'), local('DroidArabicKufi'), url(http://themes.googleusercontent.com/static/fonts/droidarabickufi/v3/8W45GN15zj1qR-20QwKIxqPi4JPRJMb6v4DHFDoSX-k.ttf) format('truetype'); } body { color:#20292f; font-family: 'Droid Arabic Kufi', Oswald; font-size: 16px; background: #f8f8f8; } nav.navbar.navbar-default.navbar-top { background: #0c0b39; position: relative; line-height: 41px; margin-bottom: 0; margin-top: 0; padding: 0; border: 0; } .navbar-default.navbar-top .navbar-collapse { padding-top: 0; } nav.navbar.navbar-default.navbar-top ul{ margin-bottom: 0; } nav.navbar.navbar-default.navbar-top ul li { display: inline-block; padding: 5px; } .navbar-top li.selected { background: #ff8000; } nav.navbar.navbar-default.navbar-top ul li a { display: block; padding: 0 10px; font-size: 13px; color: #ddd; } .navbar-default { border-color: #e7e7e700; padding: 10px 0; transition: all 0.5s; z-index: 997; background: #0c0b39; border-radius: 0; } .navbar-default .navbar-collapse{ border-color: #fff; padding-top:0; } .top-nav-collapse{ position: fixed; box-shadow: -21.213px 21.213px 30px 0px rgba(158, 158, 158, 0.3); background: #fff; transition: all 0.5s; } .navbar-toggle { float: right; margin-right: 15px; margin-left: auto; } .navbar-brand { float: left !important; } .navbar-header { padding-top: 24px; } .navbar-default .navbar-nav>.active>a{ transition: all 0.5s; color: #5e5e5e; background-color: #ffffff; } .navbar-default .navbar-nav>.active>a:hover { color: #ffffff; background-color: #5e5e5e; } .navbar-default .navbar-nav>li { list-style: none; } .navbar-default .navbar-nav>li>a { color: #ddd; font-weight: bold; font-size: 14px; text-transform: capitalize; outline: none; } .navbar-default .navbar-nav>li>a:hover { color: #ff8000; } .navbar-default .navbar-brand { color: #2196F3; font-size: 24px; font-weight: bold; } .navbar-default .navbar-nav>li>span { padding-top: 15px; padding-bottom: 10px; line-height: 20px; display: block; color: #ddd; font-weight: bold; font-size: 14px; } header { width: 100%; padding:50px 0; background: #ffffff; } header img { max-height: 200px; width: 100%; } h1.title { color: #000000; font-size: 30px; font-weight: bold; } section.main { background: #ffffff; padding: 50px 0; } aside { background: #fafaff; border: 1px solid #eee; padding: 10px; } aside ul{ padding: 0; } li { padding: 10px 0; } aside a{ color: #000000; font-size: 14px; font-weight: bold; } .post-outer { width: 100%; margin: 0 auto 40px auto; transition: 0.3s; display: inline-block; height: auto; background-color: #ffffff; line-height: 2; border-radius: 1px; z-index: 1; box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.15); } .post-outer:hover { box-shadow: 0px 12px 19px -7px rgba(0, 0, 0, 0.3); transform: translateY(-10px); -webkit-transform: translateY(-10px); -ms-transform: translateY(-10px); -moz-transform: translateY(-10px); } h3.post-title.entry-title { display: block; font-size: 20px; text-align: right; text-decoration: none; margin: 0 0 10px; padding: 0; min-height: auto; max-height: none; font-weight: 700; line-height: 1.2; color: #111315; font-family: 'Droid Arabic Kufi', Oswald; width: 66.66666667%; float: left; } h3.post-title.entry-title a { display: block; font-size: 20px; text-align: right; text-decoration: none; margin: 0; padding: 0 15px; min-height: auto; max-height: none; font-weight: 700; line-height: 1.7; color: #111315; font-family: 'Droid Arabic Kufi', Oswald; text-decoration: none; } h3.post-title.entry-title a:hover { color:#ff8000; } p.main-art { padding: 0; line-height:1.7; text-align: right; float: right; overflow: hidden; font-family: 'Droid Arabic Kufi', Oswald; } .col-md-12.Share { margin-top: 15px; } .col-md-12.Share .fa { font-size: 20px; color: #ff8000; } .text-center.more { text-align: center; float: left; margin-bottom: 15px; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } a.des-more { outline: none; font-size: 16px; text-align: center; text-decoration: none; font-weight: 500; cursor: pointer; line-height: 50px; color: #0c0b39; border: 1px solid #0c0b39; background: #fff; float: none; margin: 0 auto 15px; overflow: hidden; max-width: 170px; padding: 5px 17px; border-radius: 20px; } .des-more:hover { color: #fff; background: #0c0b39; border: 1px solid transparent; } aside .widget h2 { font-size: 16px; background:#0c0b39; color: #fff; text-align: center; padding: 20px 0px;
} footer { background:#0c0b39; padding: 20px 0 0; color: #555555; } footer .widget h2 { position: relative; margin-bottom: 37px; font-size:16px; color: #ffffff; font-weight: bold; } footer .widget h2:before { background: #ffffff; content: ""; height: 3px; left: auto; position: absolute; width: 75%; top: 33px; right: 0; float: none; margin: auto; } footer li { list-style: none; padding: 6px 0; } footer a { color: #ffffff; }
.footer-bottom { background: #ff8000; padding: 20px; margin-top: 20px; text-align: center; color: #555555; font-weight: bold; } .FollowByEmail .follow-by-email-inner .follow-by-email-address { padding: 1px 6px; border: 1px solid #ffffff; width: 98% !important; height: 35px !important; } .FollowByEmail .follow-by-email-inner .follow-by-email-submit { width: 60px; margin: 0; margin-right: 8px; margin-left: 0; border: 0; border-radius: 2px; -moz-border-radius: 2px; background: #ff8000; color: #fff; cursor: pointer; font-size: 13px; height: 35px; z-index: 0; } span.post-comment-link { display: none; } .post-footer { display: none; } li { list-style: none; } @media screen and (max-width: 992px){ h3.post-title.entry-title { width: 100%; float: none; margin-bottom: 15px; font-size: 18px; } .col-md-4.main-img img { max-height: 400px; height: auto; margin-bottom: 15px; } .text-center.more { float: none; } .col-md-6.Share-inner { text-align: center; margin: 15px 0; display: block; overflow: hidden; border-top: 1px #ddd solid; padding-top: 11px; } } @media screen and (max-width: 768px){ h3.post-title.entry-title { width: 100%; float: none; margin-bottom: 15px; font-size: 18px; }
} ]]></b:skin>
<b:if cond='data:blog.pageType != "static_page"'> <b:if cond='data:blog.pageType == "item"'>
</b:if> </b:if>
Certainly! To convert the provided code for left-to-right (LTR) text direction and to replace non-English fonts with English fonts, the main adjustments will be within the CSS and possibly some minor HTML modifications. Here's how it can be done:
Change the font-family from 'Droid Arabic Kufi' to a commonly used English font. We can use 'Arial' or 'Times New Roman' as examples. Also, ensure the primary font is loaded first and fallback fonts are listed thereafter.
Any text-align: right should be changed to text-align: left. Similarly, float: right should be changed to float: left and vice versa if needed.
The HTML dir attribute should not be required unless you are handling mixed content. By default, English content is left-to-right (LTR).
Here's the modified CSS code with the necessary changes for an LTR English layout:
@font-face {
font-family: 'Arial';
font-style: normal;
font-weight: 400;
src: local('Arial'), local('Arial-Regular'), url(http://example.com/fonts/arial.ttf) format('truetype');
}
body {
color: #20292f;
font-family: 'Arial', Oswald;
font-size: 16px;
background: #f8f8f8;
}
nav.navbar.navbar-default.navbar-top {
background: #0c0b39;
position: relative;
line-height: 41px;
margin-bottom: 0;
margin-top: 0;
padding: 0;
border: 0;
}
.navbar-default.navbar-top .navbar-collapse {
padding-top: 0;
}
nav.navbar.navbar-default.navbar-top ul {
margin-bottom: 0;
}
nav.navbar.navbar-default.navbar-top ul li {
display: inline-block;
padding: 5px;
}
.navbar-top li.selected {
background: #ff8000;
}
nav.navbar.navbar-default.navbar-top ul li a {
display: block;
padding: 0 10px;
font-size: 13px;
color: #ddd;
}
.navbar-default {
border-color: #e7e7e700;
padding: 10px 0;
transition: all 0.5s;
z-index: 997;
background: #0c0b39;
border-radius: 0;
}
.navbar-default .navbar-collapse {
border-color: #fff;
padding-top: 0;
}
.top-nav-collapse {
position: fixed;
box-shadow: -21.213px 21.213px 30px 0px rgba(158, 158, 158, 0.3);
background: #fff;
transition: all 0.5s;
}
.navbar-toggle {
float: left;
margin-left: 15px;
margin-right: auto;
}
.navbar-brand {
float: left !important;
}
.navbar-header {
padding-top: 24px;
}
.navbar-default .navbar-nav>.active>a {
transition: all 0.5s;
color: #5e5e5e;
background-color: #ffffff;
}
.navbar-default .navbar-nav>.active>a:hover {
color: #ffffff;
background-color: #5e5e5e;
}
.navbar-default .navbar-nav>li {
list-style: none;
}
.navbar-default .navbar-nav>li>a {
color: #ddd;
font-weight: bold;
font-size: 14px;
text-transform: capitalize;
outline: none;
}
.navbar-default .navbar-nav>li>a:hover {
color: #ff8000;
}
.navbar-default .navbar-brand {
color: #2196F3;
font-size: 24px;
font-weight: bold;
}
.navbar-default .navbar-nav>li>span {
padding-top: 15px;
padding-bottom: 10px;
line-height: 20px;
display: block;
color: #ddd;
font-weight: bold;
font-size: 14px;
}
header {
width: 100%;
padding: 50px 0;
background: #ffffff;
}
header img {
max-height: 200px;
width: 100%;
}
h1.title {
color: #000000;
font-size: 30px;
font-weight: bold;
}
section.main {
background: #ffffff;
padding: 50px 0;
}
aside {
background: #fafaff;
border: 1px solid #eee;
padding: 10px;
}
aside ul {
padding: 0;
}
li {
padding: 10px 0;
}
aside a {
color: #000000;
font-size: 14px;
font-weight: bold;
}
.post-outer {
width: 100%;
margin: 0 auto 40px auto;
transition: 0.3s;
display: inline-block;
height: auto;
background-color: #ffffff;
line-height: 2;
border-radius: 1px;
z-index: 1;
box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.15);
}
.post-outer:hover {
box-shadow: 0px 12px 19px -7px rgba(0, 0, 0, 0.3);
transform: translateY(-10px);
-webkit-transform: translateY(-10px);
-ms-transform: translateY(-10px);
-moz-transform: translateY(-10px);
}
h3.post-title.entry-title {
display: block;
font-size: 20px;
text-align: left;
text-decoration: none;
margin: 0 0 10px;
padding: 0;
min-height: auto;
max-height: none;
font-weight: 700;
line-height: 1.2;
color: #111315;
font-family: 'Arial', Oswald;
width: 66.66666667%;
float: left;
}
h3.post-title.entry-title a {
display: block;
font-size: 20px;
text-align: left;
text-decoration: none;
margin: 0;
padding: 0 15px;
min-height: auto;
max-height: none;
font-weight: 700;
line-height: 1.7;
color: #111315;
font-family: 'Arial', Oswald;
}
h3.post-title.entry-title a:hover {
color: #ff8000;
}
p.main-art {
padding: 0;
line-height: 1.7;
text-align: left;
float: left;
overflow: hidden;
font-family: 'Arial', Oswald;
}
.col-md-12.Share {
margin-top: 15px;
}
.col-md-12.Share .fa {
font-size: 20px;
color: #ff8000;
}
.text-center.more {
text-align: center;
float: left;
margin-bottom: 15px;
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
a.des-more {
outline: none;
font-size: 16px;
text-align: center;
text-decoration: none;
font-weight: 500;
cursor: pointer;
line-height: 50px;
color: #0c0b39;
border: 1px solid #0c0b39;
background: #fff;
float: none;
margin: 0 auto 15px;
overflow: hidden;
max-width: 170px;
padding: 5px 17px;
border-radius: 20px;
}
.des-more:hover {
color: #fff;
background: #0c0b39;
border: 1px solid transparent;
}
aside .widget h2 {
font-size: 16px;
background: #0c0b39;
color: #fff;
text-align: center;
padding: 20px 0px;
}
footer {
background: #0c0b39;
padding: 20px 0 0;
color: #555555;
}
footer .widget h2 {
position: relative;
margin-bottom: 37px;
font-size: 16px;
color: #ffffff;
font-weight: bold;
}
footer .widget h2:before {
background: #ffffff;
content: "";
height: 3px;
left: auto;
position: absolute;
width: 75%;
top: 33px;
right: 0;
float: none;
margin: auto;
}
footer li {
list-style: none;
padding: 6px 0;
}
footer a {
color: #ffffff;
}
.footer-bottom {
background: #ff8000;
padding: 20px;
margin-top: 20px;
text-align: center;
color: #555555;
font-weight: bold;
}
.FollowByEmail .follow-by-email-inner .follow-by-email-address {
padding: 1px 6px;
border: 1px solid #ffffff;
width: 98% !important;
height: 35px !important;
}
.FollowByEmail .follow-by-email-inner .follow-by-email-submit {
width: 60px;
margin: 0;
margin-right: 8px;
margin-left: 0;
border: 0;
border-radius: 2px;
-moz-border-radius: 2px;
background: #ff8000;
color: #fff;
cursor: pointer;
font-size: 13px;
height: 35px;
z-index: 0;
}
span.post-comment-link {
display: none;
}
.post-footer {
display: none;
}
li {
list-style: none;
}
@media screen and (max-width: 992px) {
h3.post-title.entry-title {
width: 100%;
float: none;
margin-bottom: 15px;
font-size: 18px;
}
.col-md-4.main-img img {
max-height: 400px;
height: auto;
margin-bottom: 15px;
}
.text-center.more {
float: none;
}
.col-md-6.Share-inner {
text-align: center;
margin: 15px 0;
display: block;
overflow: hidden;
border-top: 1px #ddd solid;
padding-top: 11px;
}
}
@media screen and (max-width: 768px) {
h3.post-title.entry-title {
width: 100%;
float: none;
margin-bottom: 15px;
font-size: 18px;
}
}
]]
<!-- Main page -->
<b:if cond='data:blog.pageType != "static_page"'>
<b:if cond='data:blog.pageType == "item"'>
<style type='text/css'>
.post-outer {
padding: 0 20px;
}
.post-outer:hover {
transform: none;
}
.post-outer img {
max-width: 100%;
width: 100%;
max-height: 600px;
height: 100%;
margin-left: auto !important;
margin-right: auto !important;
display: block;
}
h3.post-title.entry-title {
width: 100%;
float: none;
}
p.main-art {
text-align: left;
float: left;
}
.main-img {
float: left;
}
</style>
</b:if>
</b:if>
<script type='text/javascript'>
summary_noimg = 250;
summary_img = 200;
img_thumb_height = 188;
img_thumb_width = 100;
</script>
<script type='text/javascript'>
//<![CDATA[
function removeHtmlTag(strx, chop) {
if (strx.indexOf("<") != -1) {
var s = strx.split("<");
for (var i = 0; i < s.length; i++) {
if (s[i].indexOf(">") != -1) {
s[i] = s[i].substring(s[i].indexOf(">") + 1, s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length - 1) ? chop : strx.length - 2;
while (strx.charAt(chop - 1) != ' ' && strx.indexOf(' ', chop) != -1) chop++;
strx = strx.substring(0, chop - 1);
return strx + '...';
}
function createSummaryAndThumb(pID) {
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if (img.length >= 1) {
imgtag = '<div class="col-md-4 main-img" style="float:left;"><img src="' + img[0].src + '" width="' + img_thumb_width + '%" height="' + img_thumb_height + 'px"/></div>';
summ = summary_img;
}
var summary = imgtag + '<div class="col-md-8"><p class="main-art">' + removeHtmlTag(div.innerHTML, summ) + '</p></div>';
div.innerHTML = summary;
}
//]]>
</script>
right to left and vice versa.This should convert your layout from RTL to LTR while applying an English font. Please replace the example font URL http://example.com/fonts/arial.ttf with an actual URL if needed.
Not yet included in a published release.