自定义/在WordPress上使用Google阿拉伯字体

huangapple go评论56阅读模式
英文:

Custom / Google arabic font on wordpress

问题

我尝试安装自定义字体,也尝试了Google字体,但它没有在任何地方影响到我。屏幕截图显示它们的出现方式以及它们应该出现的方式。

/* 这是Google字体 */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700&display=swap');

/* 这是自定义字体 */
@font-face {
    font-family: 'kanun_arltmedium';
    font-weight: 500;
    font-style: normal;
    src: url('webfonts/kanun_arlt-medium-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-medium-webfont.woff') format('woff'), url('webfonts/kanun-arlt-medium.ttf') format('truetype');
}
@font-face {
    font-family: 'kanun_arltregular';
    font-style: normal;
    font-weight: normal;
    font-display: auto;
    src: url('webfonts/kanun_arlt-regular-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-regular-webfont.woff') format('woff'), url('webfonts/kanun-arlt-regular.ttf') format('truetype');
}
@font-face {
    font-family: 'kanun_arltbold';
    font-style: normal;
    font-weight: bold;
    font-display: auto;
    src: url('webfonts/kanun_arlt-bold-webfont.woff2') format('woff2'), url('webfonts/kanun_arlt-bold-webfont.woff') format('woff'), url('webfonts/kanun-arlt-bold.ttf') format('truetype');
}

/* 结束自定义字体CSS */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
    font-family: 'Vazirmatn', sans-serif !important;
}
<h1>مرحباً بكم في ربع قرن للموسيقى</h1>

自定义/在WordPress上使用Google阿拉伯字体

自定义/在WordPress上使用Google阿拉伯字体

自定义/在WordPress上使用Google阿拉伯字体

英文:

I've tried installing a custom font and also tried google Fonts but it's not affecting me anywhere. screenshots are given of how they are appearing and how they should appear.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

/*this is google font*/
@import url(&#39;https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700&amp;display=swap&#39;);
/* this is custom font */
@font-face {
font-family: &#39;kanun_arltmedium&#39;;
font-weight: 500;
font-style: normal;
src: url(&#39;webfonts/kanun_arlt-medium-webfont.woff2&#39;) format(&#39;woff2&#39;), url(&#39;webfonts/kanun_arlt-medium-webfont.woff&#39;) format(&#39;woff&#39;), url(&#39;webfonts/kanun-arlt-medium.ttf&#39;) format(&#39;truetype&#39;);
}
@font-face {
font-family: &#39;kanun_arltregular&#39;;
font-style: normal;
font-weight: normal;
font-display: auto;
src: url(&#39;webfonts/kanun_arlt-regular-webfont.woff2&#39;) format(&#39;woff2&#39;), url(&#39;webfonts/kanun_arlt-regular-webfont.woff&#39;) format(&#39;woff&#39;), url(&#39;webfonts/kanun-arlt-regular.ttf&#39;) format(&#39;truetype&#39;);
}
@font-face {
font-family: &#39;kanun_arltbold&#39;;
font-style: normal;
font-weight: bold;
font-display: auto;
src: url(&#39;webfonts/kanun_arlt-bold-webfont.woff2&#39;) format(&#39;woff2&#39;), url(&#39;webfonts/kanun_arlt-bold-webfont.woff&#39;) format(&#39;woff&#39;), url(&#39;webfonts/kanun-arlt-bold.ttf&#39;) format(&#39;truetype&#39;);
}
/* End Custom Fonts CSS */
[dir=&quot;rtl&quot;] h1, [dir=&quot;rtl&quot;] h2, [dir=&quot;rtl&quot;] h3, [dir=&quot;rtl&quot;] span.elementor-heading-title.elementor-size-default, h1 {
font-family: &#39;Vazirmatn&#39;, sans-serif !important;
}

<!-- language: lang-html -->

&lt;h1&gt;مرحباً بكم في ربع قرن للموسيقى&lt;/h1&gt;

<!-- end snippet -->

自定义/在WordPress上使用Google阿拉伯字体

自定义/在WordPress上使用Google阿拉伯字体

自定义/在WordPress上使用Google阿拉伯字体

答案1

得分: 0

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
    font-family: 'Vazirmatn', sans-serif;
}

@import should be at the first of the file


<details>
<summary>英文:</summary>
Put the following in style

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] span.elementor-heading-title.elementor-size-default, h1 {
font-family: 'Vazirmatn', sans-serif;
}

@import should be at the first of the file
</details>

huangapple
  • 本文由 发表于 2023年2月23日 23:46:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75547149.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定