Skip to content

Commit

Permalink
Updated file
Browse files Browse the repository at this point in the history
"Noto Sans Tibetan" is used as the default font to display Tibetan on Windows.
  • Loading branch information
bumpagyal committed Dec 10, 2019
1 parent 4922e00 commit 70faa06
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 45 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Tibetan-Style

This plugin is for the problem that WordPress default Tibetan font is too small on Windows system. When the user does not install any Tibetan font, "Monlam UI" is used as the default font to display Tibetan text.
This plugin is for the problem that WordPress default Tibetan font is too small on Windows. When the user does not install any Tibetan font, "Noto Sans Tibetan" is used as the default font to display Tibetan.

此插件为针对在 Windows 系统里 WordPress 后台默认藏文字体太小的问题,当用户未安装任何藏文字体时 Monlam UI 作为默认字体来显示藏文。
此插件为针对在Windows系统里WordPress后台默认藏文字体太小的问题,当用户未安装任何藏文字体时"Noto Sans Tibetan"作为默认字体来显示藏文。

## 如何使用
下载本项目后,无需解压直接在 WordPress 后台添加插件并启用即可
下载本项目后,无需解压直接在WordPress后台添加插件并启用即可

## 前端页面调用
启用此插件后,主题会自动调用有字库提供的 Web fonts 文件,只要在您的主题样式表文件 style.css 里 font-family 属性添加 "Microsoft Himalaya" 字体即可。

### 例如
```css
font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Monlam UI", sans-serif;
font-family: "Segoe UI","Helvetica Neue",Kokonor,Kailasa,"Tibetan Machine Uni","Noto Sans Tibetan",sans-serif;
```

## 协议
Expand Down
11 changes: 11 additions & 0 deletions css/base-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Build Tibetan font styles */
body:lang(bo), button:lang(bo),
input:lang(bo),
select:lang(bo),
optgroup:lang(bo),
textarea:lang(bo),
html:lang(bo) .wp-embed .wp-embed-excerpt,
html:lang(bo) #wpadminbar *,
html:lang(bo) .wp-embed {
font-family: "Segoe UI","Helvetica Neue",Kokonor,Kailasa,"Tibetan Machine Uni","Noto Sans Tibetan",sans-serif
}
14 changes: 2 additions & 12 deletions css/tibetan-editor-style.css → css/editor-style.css

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

25 changes: 25 additions & 0 deletions css/index-win.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Noto Sans Tibetan (Tibetan) http://www.google.com/fonts/earlyaccess
*/
@font-face {
font-family: 'Noto Sans Tibetan';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(//fonts.gstatic.com/ea/notosanstibetan/v1/NotoSansTibetan-Regular.eot);
src: url(//fonts.gstatic.com/ea/notosanstibetan/v1/NotoSansTibetan-Regular.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/notosanstibetan/v1/NotoSansTibetan-Regular.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/notosanstibetan/v1/NotoSansTibetan-Regular.woff) format('woff'),
url(//fonts.gstatic.com/ea/notosanstibetan/v1/NotoSansTibetan-Regular.ttf) format('truetype');
unicode-range: U+0F00-0FFF; /* Tibetan glyphs */
}

/*
* Tibetan typography in Firefox
*/
@-moz-document url-prefix() {
* {
word-wrap: break-word;
word-break: break-all
}
}
21 changes: 0 additions & 21 deletions css/tibetan-style.css

This file was deleted.

Binary file removed fonts/monlam_ui.woff2
Binary file not shown.
30 changes: 25 additions & 5 deletions tibetan-style.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/*
Plugin Name: Tibetan Style
Plugin URI: https://www.tibetitw.com/wordpress-plugin/tibetan-style/
Description: This plugin is for the problem that WordPress default Tibetan font is too small on Windows system. When the user does not install any Tibetan font, "Monlam UI" is used as the default font to display Tibetan text.
Version: 2.2.1
Description: This plugin is for the problem that WordPress default Tibetan font is too small on Windows. When the user does not install any Tibetan font, "Noto Sans Tibetan" is used as the default font to display Tibetan.
Version: 2.2.2
Author: Bumpa G. Rebkong
Author URI: https://www.tibetitw.com/
License: GPL2
Expand All @@ -12,16 +12,36 @@

// WordPress Custom Font @ Admin Embed
function admin_custom_font() {
wp_register_style( 'tibetan-style', plugin_dir_url(__FILE__) . 'css/tibetan-style.css', false, '' );

if(preg_match("/(Win|WIN|Windows|win|winNT).*?([\d.]+)/",$_SERVER['HTTP_USER_AGENT'])){
wp_register_style( 'tibetan-win-style', plugin_dir_url(__FILE__) . 'css/index-win.css', false, '' );
wp_enqueue_style( 'tibetan-win-style');
}

wp_register_style( 'tibetan-style', plugin_dir_url(__FILE__) . 'css/base-style.css', false, '' );
wp_enqueue_style( 'tibetan-style' );


}
add_action( 'wp_enqueue_scripts', 'admin_custom_font' );
add_action( 'enqueue_embed_scripts', 'admin_custom_font' );

// WordPress Custom Font @ Admin Login Editor
function admin_editor_font() {
wp_register_style( 'tibetan-editor-style', plugin_dir_url(__FILE__) . 'css/tibetan-editor-style.css', false, '' );

if(preg_match("/(Win|WIN|Windows|win|winNT).*?([\d.]+)/",$_SERVER['HTTP_USER_AGENT'])){
wp_register_style( 'tibetan-win-style', plugin_dir_url(__FILE__) . 'css/index-win.css', false, '' );
wp_enqueue_style( 'tibetan-win-style');
}

wp_register_style( 'tibetan-editor-style', plugin_dir_url(__FILE__) . 'css/editor-style.css', false, '' );
wp_enqueue_style( 'tibetan-editor-style' );

}
add_action( 'login_enqueue_scripts', 'admin_editor_font' );
add_action( 'admin_enqueue_scripts', 'admin_editor_font' );
add_action( 'admin_enqueue_scripts', 'admin_editor_font' );





0 comments on commit 70faa06

Please sign in to comment.