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

fix issue #1469 #1503

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions modules/s3/codecs/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
biDiImported = False
current.log.warning("PDF Codec", "BiDirectional Support not available: Install Python-BiDi")

from rtl import reshaper

PDF_WIDTH = 0
PDF_HEIGHT = 1

Expand Down Expand Up @@ -124,29 +126,16 @@ def biDiText(text):
"""

text = s3_unicode(text)

if biDiImported and current.deployment_settings.get_pdf_bidi():

isArabic = False
isBidi = False

for c in text:
cat = unicodedata.bidirectional(c)

if cat in ("AL", "AN"):
isArabic = True
isBidi = True
break
elif cat in ("R", "RLE", "RLO"):
isBidi = True

if isArabic:
text = arabic_reshaper.reshape(text)

if isBidi:
text = get_display(text)

return text
result = ''
if reshaper.has_arabic_letters(text):
for word in text.split(' '):
if reshaper.is_arabic_word(word) or reshaper.has_arabic_letters(word) or reshaper.has_digits(word):
result = ' ' + get_display(arabic_reshaper.reshape(word)) + result
else:
result += ' ' + word
else:
result = text
return result

# =============================================================================
class S3RL_PDF(S3Codec):
Expand Down
3 changes: 2 additions & 1 deletion modules/s3cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class S3Config(Storage):
# defaults to ["Helvetica", "Helvetica-Bold"] if not-specified here
# Requires installation of appropriate font - e.g. using import_font in tasks.cfg
# Unifont can be downloaded from http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.ttf
fonts = {"ar": ["unifont", "unifont"],
fonts = {"ar": ["iran_sans/fonts/ttf/IRANSansWeb", "iran_sans/fonts/ttf/IRANSansWeb_Bold"],
"fa": ["iran_sans/fonts/ttf/IRANSansWeb", "iran_sans/fonts/ttf/IRANSansWeb_Bold"],
#"dv": ["unifont", "unifont"],
#"dz": ["unifont", "unifont"],
"km": ["unifont", "unifont"],
Expand Down
76 changes: 76 additions & 0 deletions static/fonts/iran_sans/css/fontiran.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
*
* Name: IRAN Sans-Serif Font
* Version: 5.0
* Author: Moslem Ebrahimi (moslemebrahimi.com)
* Created on: Dec 25, 2012
* Updated on: Sep 01, 2017
* Website: http://fontiran.com
* Copyright: Commercial/Proprietary Software
--------------------------------------------------------------------------------------
فونت های ایران سن سریف یک نرم افزار مالکیتی محسوب می شود. جهت آگاهی از قوانین استفاده از این فونت ها لطفا به وب سایت (فونت ایران دات کام) مراجعه نمایید
--------------------------------------------------------------------------------------
IRAN Sans-serif fonts are considered a proprietary software. To gain information about the laws regarding the use of these fonts, please visit www.fontiran.com
--------------------------------------------------------------------------------------
*
**/
@font-face {
font-family: IRANSans;
font-style: normal;
font-weight: 900;
src: url('../fonts/eot/IRANSansWeb_Black.eot');
src: url('../fonts/eot/IRANSansWeb_Black.eot?#iefix') format('embedded-opentype'), /* IE6-8 */
url('../fonts/woff2/IRANSansWeb_Black.woff2') format('woff2'), /* FF39+,Chrome36+, Opera24+*/
url('../fonts/woff/IRANSansWeb_Black.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('../fonts/ttf/IRANSansWeb_Black.ttf') format('truetype');
}
@font-face {
font-family: IRANSans;
font-style: normal;
font-weight: bold;
src: url('../fonts/eot/IRANSansWeb_Bold.eot');
src: url('../fonts/eot/IRANSansWeb_Bold.eot?#iefix') format('embedded-opentype'), /* IE6-8 */
url('../fonts/woff2/IRANSansWeb_Bold.woff2') format('woff2'), /* FF39+,Chrome36+, Opera24+*/
url('../fonts/woff/IRANSansWeb_Bold.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('../fonts/ttf/IRANSansWeb_Bold.ttf') format('truetype');
}
@font-face {
font-family: IRANSans;
font-style: normal;
font-weight: 500;
src: url('../fonts/eot/IRANSansWeb_Medium.eot');
src: url('../fonts/eot/IRANSansWeb_Medium.eot?#iefix') format('embedded-opentype'), /* IE6-8 */
url('../fonts/woff2/IRANSansWeb_Medium.woff2') format('woff2'), /* FF39+,Chrome36+, Opera24+*/
url('../fonts/woff/IRANSansWeb_Medium.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('../fonts/ttf/IRANSansWeb_Medium.ttf') format('truetype');
}
@font-face {
font-family: IRANSans;
font-style: normal;
font-weight: 300;
src: url('../fonts/eot/IRANSansWeb_Light.eot');
src: url('../fonts/eot/IRANSansWeb_Light.eot?#iefix') format('embedded-opentype'), /* IE6-8 */
url('../fonts/woff2/IRANSansWeb_Light.woff2') format('woff2'), /* FF39+,Chrome36+, Opera24+*/
url('../fonts/woff/IRANSansWeb_Light.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('../fonts/ttf/IRANSansWeb_Light.ttf') format('truetype');
}
@font-face {
font-family: IRANSans;
font-style: normal;
font-weight: 200;
src: url('../fonts/eot/IRANSansWeb_UltraLight.eot');
src: url('../fonts/eot/IRANSansWeb_UltraLight.eot?#iefix') format('embedded-opentype'), /* IE6-8 */
url('../fonts/woff2/IRANSansWeb_UltraLight.woff2') format('woff2'), /* FF39+,Chrome36+, Opera24+*/
url('../fonts/woff/IRANSansWeb_UltraLight.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('../fonts/ttf/IRANSansWeb_UltraLight.ttf') format('truetype');
}
@font-face {
font-family: IRANSans;
font-style: normal;
font-weight: normal;
src: url('../fonts/eot/IRANSansWeb.eot');
src: url('../fonts/eot/IRANSansWeb.eot?#iefix') format('embedded-opentype'), /* IE6-8 */
url('../fonts/woff2/IRANSansWeb.woff2') format('woff2'), /* FF39+,Chrome36+, Opera24+*/
url('../fonts/woff/IRANSansWeb.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('../fonts/ttf/IRANSansWeb.ttf') format('truetype');
}
190 changes: 190 additions & 0 deletions static/fonts/iran_sans/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
@import url(fontiran.css); /* لینک فایلی که وظیفه بارگذاری فونت ها را برعهده دارد */
body {
font-family: IRANSans !important;
font-weight: 300;
direction: rtl;
background-color: #E2E2E2;
margin: 0;
}
h1, h2, h3, h4, h5, h6,input, textarea {
font-family: IRANSans !important;
}
h1 {
font-weight: bold;
}
.wrapper {
max-width: 900px;
margin: 0 auto;
}
.ltr {
direction: ltr;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-small {
font-size: 0.8em;
}
.text-xsmall {
font-size: 0.6em;
}
.text-large {
font-size: 1.2em;
}
.text-xlarge {
font-size: 1.4em;
}
.text-underline {
text-decoration:underline;
}
.text-ultralight {
font-weight: 200;
}
.text-light {
font-weight: 300;
}
.text-regular {
font-weight: normal;
}
.text-medium {
font-weight: 500;
}
.text-bold {
font-weight: bold;
}
.text-black {
font-weight: 900;
}
blockquote {
font-weight: 500;
padding: 10px;
border: 1px dashed #666666;
}

.mainbox {
width: 100%;
background-color: #EFEFEF;
display: table;
margin-bottom: 30px;
border-right: 8px solid #FFFF33;
}

.mainboxnegativ {
width: 100%;
background-color: #000000;
display: table;
margin-bottom: 30px;
border-right: 8px solid #FFFF33;
color: #F9F9F9;
}

.mainbox2 {
font-size: 1em;
width: 90%;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
}

.mainbox3 {
width: 100%;
background-color: #b8b8b8;
display: table;
margin-bottom: 30px;
border-right: 8px solid #bd70ff;
}

.mainbox2negativ {
font-size: 1em;
color: #F9F9F9;
background-color: #000000;
padding-right: 20px;
}

.farsiparagraph {
font-size: 1em;
width: 47%;
float:right;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;

}
.englishparagraph {
font-size: 1em;
width: 47%;
float: left;
direction:ltr;
padding-left: 20px;
padding-top: 10px;
padding-bottom: 10px;


}
.rightbox {
width: 60%;
padding-right: 20px;
padding-left: 5px;
float: right;
margin-left: 10px;
margin-bottom: 0px;
min-width: 0px;
background-color: #F7F7F7;

}

.titelbox {
width: 60%;
padding-right: 25px;
padding-left: 0px;
float: right;
margin-left: 10px;
margin-bottom: 0px;
min-width: 0px;
background-color: #F2F2F2;
color: #4B4B4B;
}


.lefttbox {

padding-right: 20px;
padding-left: 4px;
float: right;
margin-bottom: 10px;
min-width: 0px;
}

.alphabet {
width: 35%;
float: left;
font-size: 21em;
text-align: center;
font-weight: 500;
color: #999999;
}

.alphabet2 {
width: 35%;
float: left;
direction: ltr;
font-size: 1.6em;
text-align: left;
font-weight: 500;
color: #333333;
margin-top: 100px;
}
.footer {
font-weight: 300;
font-size: 0.7em;
text-align: center;
direction: ltr;
margin-bottom: 0px;
padding-bottom: 0px;
}
Binary file added static/fonts/iran_sans/fonts/eot/IRANSansWeb.eot
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added static/fonts/iran_sans/fonts/ttf/IRANSansWeb.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion static/scripts/S3/s3.gis.js
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@ OpenLayers.ProxyHost = S3.Ap.concat('/gis/proxy?url=');
// In Global scope as called from HTML (iframe onLoad)
S3.gis.popupLoaded = function(id) {
// Display the hidden form
$('#' + id + '_contentDiv iframe').contents().find('#popup form').show();
$('#' + id + '_contentDiv iframe').contents().find('#popup').show();
// Iterate through all Maps (usually just 1)
var maps = S3.gis.maps;
var map_id, map, popup, popups, i, len;
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/S3/s3.gis.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.