You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

535 lines
21 KiB

4 months ago
<!DOCTYPE html>
<html dir=rtl lang="fa">
<head>
<meta charset="UTF-8">
<title>IranSansX OpenType features in CSS</title>
<meta http-equiv="Content-Language" content="fa">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet">
<style>
html {
background: #EAEAEA
}
body {
font-family: 'IranSansX', sans-serif;
background-color: #eaeaea;
padding: 0;
font-family: IranSansX, sans-serif;
max-width: 40rem;
margin: auto;
padding-top: 3rem
}
.body {
background-color: #fff;
border-radius: 30px;
padding: 20px;
margin: 2rem auto;
max-width: 40rem;
scroll-behavior: smooth;
}
section {
border-bottom: 1px solid #ccc;
margin-bottom: 2rem;
padding-bottom: 2rem;
}
section:last-child {
border-bottom: none;
}
h2 {
display: block;
font-size: 1.5em;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
margin-inline-start: 0px;
margin-inline-end: 0px;
font-weight: bold;
}
a {
color: #333;
outline: 0 !important;
transition: all 0.3s ease-in-out;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
opacity: 0.7;
transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}
a:active {
text-decoration: none;
}
.font-example {
font-weight: 600;
font-size: 60px;
margin: 0;
padding: 0;
line-height: 100%normal;
position: relative;
}
.rendered-example {
position: relative;
}
.rendered-example:before {
content: 'Result';
background-color: #000;
color: white;
display: block;
left: 0rem;
padding: .25rem .5rem;
position: absolute;
right: 0;
top: 0;
text-align: left
}
.dlig {
font-variant-ligatures: discretionary-ligatures;
-moz-font-feature-settings: "dlig";
-webkit-font-feature-settings: "dlig";
font-feature-settings: "dlig";
}
.ss01 {
-moz-font-feature-settings: "ss01";
-webkit-font-feature-settings: "ss01";
font-feature-settings: "ss01";
font-weight: 900;
}
.ss01 {
-moz-font-feature-settings: "ss01";
-webkit-font-feature-settings: "ss01";
font-feature-settings: "ss01";
font-size: 60px;
}
.ss03 {
-moz-font-feature-settings: "ss03";
-webkit-font-feature-settings: "ss03";
font-feature-settings: "ss03";
font-size: 60px;
}
.ss04 {
-moz-font-feature-settings: "ss04";
-webkit-font-feature-settings: "ss04";
font-feature-settings: "ss04";
font-size: 60px;
}
.rtl-text {
direction: ltr
}
.js-emailcopybtn {
font-family: IranSansX;
margin: 0;
position: absolute;
top: 3px;
right: 10px;
z-index: 9;
background: #a483bb;
color: #fff;
padding: 1px 13px;
border-radius: 10px;
font-size: 13px;
cursor: pointer;
text-shadow: none;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;#a483bb
}IranSansX VF
.js-emailcopybtn:hover {
background: #000
}
.js-emailcopybtn::before {
content: "کپی";
}
.fontother {
background: #00B4CF;
color: #fff;#a483bb
float: left;
padding: 10px 25px;
font-size: 16px;
margin-left: 15px;
margin-top: 20px;
border-radius: 5px;
}
.logo {
width: 150px;
margin-right: 15px
}
p > code,
li > code {
background-color: #efefef;
color: #905;
display: inline-block;
margin: 0 .2rem;
padding: .15rem .25rem;
direction: ltr;
}
pre[class*=language-]{
margin: 1.5rem 0 3rem !important;
}
.bad {
color: firebrick;
}
.code-example-bad {
border-left: 3px solid firebrick;
}
.good {
color: rgb(102, 153, 0);
}
.code-example-good {
border-left: 3px solid rgb(102, 153, 0);
}
.rendered-example {
background-color: #474747;
margin: 0 0 1rem;
padding: 50px 30px 30px;
text-align: center;
color: #fff;
}
pre + .rendered-example {
margin-top: -2.5rem;
}
pre.language-markup, pre.language-css {
padding-top: 2rem !important;
position: relative;
}
.language-markup:before, .language-css:before {
content: 'HTML';
background-color: lightsalmon;
color: #000;
display: block;
left: 0rem;
padding: .25rem .5rem;
position: absolute;
right: 0;
top: 0;
}
.language-css:before {
content: 'CSS';
background-color: #ead0fd;
}
.size-example {
font-size: 1.2rem;
}
.font-weight-example {
font-weight: normal;
}
.color-example {
color: #4286f4;
}
.line-height-example {
line-height: 1.7;
}
.transform-example {
text-transform: uppercase;
}
.decoration-example {
text-decoration: underline;
}
.letter-spacing-example {
letter-spacing: 0em;
}
code[class*=language-],
pre[class*=language-] {
font-family: IranSansX;
font-size: 12px;
color: #000;
background: 0 0;
text-align: left;
white-space: pre-wrap;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
direction: ltr;
}
code[class*=language-]::-moz-selection,
code[class*=language-]::-moz-selection,
pre[class*=language-]::-moz-selection,
pre[class*=language-]::-moz-selection {
text-shadow: none;
background: #b3d4fc
}
code[class*=language-]::selection,
code[class*=language-]::selection,
pre[class*=language-]::selection,
pre[class*=language-]::selection {
text-shadow: none;
background: #b3d4fc
}
@media print {
code[class*=language-],
pre[class*=language-] {
text-shadow: none
}
}
pre[class*=language-] {
padding: 1em;
margin: .5em 0;
/* overflow: auto */
}
:not(pre)>code[class*=language-],
pre[class*=language-] {
background: #efefef
}
:not(pre)>code[class*=language-] {
padding: .1em;
border-radius: .3em;
white-space: normal
}
.token.cdata,
.token.comment,
.token.doctype,
.token.prolog {
color: #708090
}
.token.punctuation {
color: #999
}
.namespace {
opacity: .7
}
.token.boolean,
.token.constant,
.token.deleted,
.token.number,
.token.property,
.token.symbol,
.token.tag {
color: #905
}
.token.attr-name,
.token.builtin,
.token.char,
.token.inserted,
.token.selector,
.token.string {
color: #690
}
.language-css .token.string,
.style .token.string,
.token.entity,
.token.operator,
.token.url {
color: #708090;
background: hsla(0, 0%, 100%, .5)
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a
}
.token.function {
color: #DD4A68
}
.token.important,
.token.regex,
.token.variable {
color: #e90
}
.token.bold,
.token.important {
font-weight: 700
}
.token.italic {
font-style: italic
}
.token.entity {
cursor: help
}
.footer {
text-align: center;
direction: ltr;
font-size: 14px;
margin-bottom: 50px
}
.footer a {
color: #FF2434
}
</style>
</head>
<body>
<a target="_blanck" href="https://fontiran.com"><img class="logo" src="https://fontiran.com/front/img/logo.svg"></a>
<div class="body">
<h2>فارسی کردن اعداد انگلیسی و عربی</h2>
<h2>Stylistic alternates (ss01) </h2>
<p>با فعال کردن استایلستیک سری ss01 اعداد انگلیسی بصورت فارسی نمایش داده میشود. در مثال زیر ردیف اول اعداد فارسی است و ردیف دوم اعداد انگلیسی است که فارسی شده است. </p>
<pre class="language-css" onclick="javascript:copyToClipboard(this.textContent)"><p class="js-emailcopybtn"></p>
<code>.ss01 {
-moz-font-feature-settings: "ss01";
-webkit-font-feature-settings: "ss01";
font-feature-settings: "ss01";
}
</code></pre>
<figure class="rendered-example">
<p class="font-example ss01">
۱۲۳۴۵۶۷۸۹۰
<br>
1234567890
</p>
</figure>
</section>
<section>
<br> <br>
<h2>هم عرض (monospace) کردن اعداد </h2>
<h2>Stylistic alternates (ss03) </h2>
<p>با فعال کردن استایلستیک سری ss03 اعداد بصورت منو اسپیس تایپ میشود یعنی عرض همه اعداد برابر است و مناسب استفاده در لیستها و جداول اطلاعات.
<br>
در سطر دوم اعداد انگلیسی فارسی و همعرض شده است.
</p>
<pre class="language-css" onclick="javascript:copyToClipboard(this.textContent)"><p class="js-emailcopybtn"></p>
<code>.ss03 {
-moz-font-feature-settings: "ss03";
-webkit-font-feature-settings: "ss03";
font-feature-settings: "ss03";
}
</code></pre>
<figure class="rendered-example">
<p class="font-example ss03">
۱۲۳۴۵۶۷۸۹۰
<br>
1234567890
</p>
</figure>
</section>
<section>
<br> <br>
<h2>تغییر تراز عمودی اعداد</h2>
<h2>Stylistic alternates (ss04) </h2>
<p>با فعال کردن استایلستیک سری ss04 اعداد کمی پایینتر از خط کرسی قرار میگیرد تا تراز عمودی در باکسهای طراحی وسط باشد.
<br>
در مثال زیر: خط اول تراز اعداد در حالت پیشفرض و در خط دوم به کمک استایل ss04 تراز تغییر کرده است. </p>
<pre class="language-css" onclick="javascript:copyToClipboard(this.textContent)"><p class="js-emailcopybtn"></p>
<code>.ss04 {
-moz-font-feature-settings: "ss04";
-webkit-font-feature-settings: "ss04";
font-feature-settings: "ss04";
}
</code></pre>
<figure class="rendered-example">
<p class="font-example">
<mark style="background-color: #EAEAEA;">۱۲۳۴۵۶۷۸۹۰ ریال<mark/>
</p>
<br>
<p class="font-example ss04">
<mark style="background-color: #EAEAEA;">۱۲۳۴۵۶۷۸۹۰ ریال<mark/>
</p>
</figure>
</section>
</div>
<div class="footer">
To use this font, it is necessary to obtain the license from <a href="http://fontiran.com">www.fontiran.com</a>
</div>
<script>
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,a=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,a.util.encode(e.content),e.alias):"Array"===a.util.type(e)?e.map(a.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e){var t=a.util.type(e);switch(t){case"Object":var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=a.util.clone(e[r]));return n;case"Array":return e.map&&e.map(function(e){return a.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=a.util.clone(a.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||a.languages;var i=r[e];if(2==arguments.length){n=arguments[1];for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);return i}var l={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(l[s]=n[s]);l[o]=i[o]}return a.languages.DFS(a.languages,function(t,a){a===r[e]&&t!=e&&(this[t]=l)}),r[e]=l},DFS:function(e,t,n,r){r=r||{};for(var i in e)e.hasOwnProperty(i)&&(t.call(e,i,e[i],n||i),"Object"!==a.util.type(e[i])||r[a.util.objId(e[i])]?"Array"!==a.util.type(e[i])||r[a.util.objId(e[i])]||(r[a.util.objId(e[i])]=!0,a.languages.DFS(e[i],t,i,r)):(r[a.util.objId(e[i])]=!0,a.languages.DFS(e[i],t,null,r)))}},plugins:{},highlightAll:function(e,t){var n={callback:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",n);for(var r,i=n.elements||document.querySelectorAll(n.selector),s=0;r=i[s++];)a.highlightElement(r,e===!0,n.callback)},highlightElement:function(t,n,r){for(var i,s,l=t;l&&!e.test(l.className);)l=l.parentNode;l&&(i=(l.className.match(e)||[,""])[1].toLowerCase(),s=a.languages[i]),t.className=t.className.replace(e,"").replace(/\s+/g," ")+" language-"+i,l=t.parentNode,/pre/i.test(l.nodeName)&&(l.className=l.className.replace(e,"").replace(/\s+/g," ")+" language-"+i);var o=t.textContent,u={element:t,language:i,grammar:s,code:o};if(a.hooks.run("before-sanity-check",u),!u.code||!u.grammar)return u.code&&(u.element.textContent=u.code),void a.hooks.run("complete",u);if(a.hooks.run("before-highlight",u),n&&_self.Worker){var g=new Worker(a.filename);g.onmessage=function(e){u.highlightedCode=e.data,a.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),a.hooks.run("after-highlight",u),a.hooks.run("complete",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=a.highlight(u.code,u.grammar,u.language),a.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r&&r.call(t),a.hooks.run("after-highlight",u),a.hooks.run("complete",u)},highlight:function(e,t,r){var i=a.tokenize(e,t);return n.stringify(a.util.encode(i),r)},tokenize:function(e,t,n){var r=a.Token,i=[e],s=t.rest;if(s){for(var l in s)t[l]=s[l];delete t.rest}e:for(var l in t)if(t.hasOwnProperty(l)&&t[l]){var o=t[l];o="Array"===a.util.type(o)?o:[o];for(var u=0;u<o.length;++u){var g=o[u],c=g.inside,p=!!g.lookbehind,d=!!g.greedy,m=0,h=g.alias;if(d&&!g.pattern.global){var f=g.pattern.toString().match(/[imuy]*$/)[0];g.pattern=RegExp(g.pattern.source,f+"g")}g=g.pattern||g;for(var y=0,b=0;y<i.length;b+=i[y].length,++y){var v=i[y];if(i.length>e.length)break e;if(!(v instanceof r)){g.lastIndex=0;var w=g.exec(v),k=1;if(!w&&d&&y!=i.length-1){if(g.lastIndex=b,w=g.exec(e),!w)break;for(var P=w.index+(p?w[1].length:0),x=w.index+w[0].length,A=y,j=b,_=i.length;A<_&&j<x;++A)j+=i[A].length,P>=j&&(++y,b=j);if(i[y]instanceof r||i[A-1].greedy)continue;k=A-y,v=e.slice(b,j),w.index-=b}if(w){p&&(m=w[1].length);var P=w.index+m,w=w[0].slice(m),x=P+w.length,C=v.slice(0,P),E=v.slice(x),N=[y,k];C&&N.push(C);var S=new r(l,c?a.tokenize(w,c):w,h,w,d);N.push(S),E&&N.push(E),Array.
var copyToClipboard = (function() {
var _dataString = null;
document.addEventListener("copy", function(e){
if (_dataString !== null) {
try {
if (window.clipboardData && window.clipboardData.setData) {
window.clipboardData.setData('Text', _dataString);
}
else if (e.clipboardData && e.clipboardData.setData) {
e.clipboardData.setData('text/plain', _dataString);
}
e.preventDefault();
} finally {
_dataString = null;
}
}
});
return function(data) {
_dataString = data;
document.execCommand("copy");
};
})();
</script>
</body>
</html>