|
本帖最后由 chigre3 于 2016-4-5 20:22 编辑
. o. D2 x |6 t
- C; C5 F( s; Z6 n& o o: r字体测试说明:、2 h/ |6 t% u" d) q
1. MDICT PC版,只要指定的字体系统已经安装,包括 CJK擴展E區 都能正常显示;0 c' O2 J! H, t! r
2. MDICT ANDROID版,貌似只能支持到 CJK擴展B區 部分字符;& w% n7 g; G4 J8 \) s2 E0 i+ y
3. GoldenDict Android版,同样的文件(转stardict格式)和css,CJK擴展E區 正常显示
8 Y _2 h# S* k/ [
E/ y( q9 Q2 k9 P1 D# [$ \4 ?5 f中國哲學書電子化計劃 字體試驗頁
/ K2 M/ Q/ ]/ o4 }0 |http://ctext.org/font-test-page/zh
$ a Z$ F) h* ~/ B4 i* ]* M( j9 f/ k現在公開されている花園明朝:2016年02月01日版; V" C9 [9 S+ ^5 E0 b6 g
$ w- c3 P6 L" L* h' w
PS. 以下只是简单举例,事实上,手机上用的话,还是尽量少自定义字体为好,加载显示速度有影响啊!
: e% t( P; T! @
T* g$ c+ [" T# A5 Y【词典.mdx】的词条都使用了外置式CSS,例如:
2 j9 e+ u w; y/ a7 Q: C) m4 Z----------------------------------------------------- W* Z" B5 B" b: f
- word: I8 r# n/ }7 D) N: j y/ A9 t
- <link rel="stylesheet" type="text/css" href="css_for_android.css">
% v/ Y5 j5 K& X6 j3 C! S; p - <dic-cont>8 n6 H" F/ Y" i" l: d5 k! J
- <dic-g_f><dic-w>word</dic-w></dic-g_f>3 l0 d5 z' Z- O- _4 A9 F6 D
- <dic-g_f>对应词、释义:</dic-g_f>1 V" X5 p1 t8 a3 z# a1 h$ u
- <dic-g_s><dic-ex_en>example1</dic-ex_en><dic-ex_zh> / 例句1中文翻译</dic-ex_zh></dic-g_s>8 F- e( S: F! t
- <dic-g_s><dic-ex_en>example2</dic-ex_en><dic-ex_zh> / 例句2中文翻译</dic-ex_zh></dic-g_s>
2 K, E# R! R. {) w - </dic-cont>
& A% p" ^" R' J/ T. m9 u2 |, J - </>
复制代码 2 W) [7 C" d4 I+ a' h6 U
-----------------------------------------------------/ R' W; _* s* p2 O7 W
【css_for_android.css】里,自定义字体等:
0 C; V' ^+ z2 z i1 t" L6 B5 u6 j P( |
- /*MDICT安卓版本自定义几个本词典需要的字体,需将字体复制到SD卡下mdict目录fonts文件夹里*/
3 f9 A, E+ Q# b0 M - @font-face{font-family:"Palatino Linotype";font-weight:normal;font-style:normal;src:url('file:///sdcard/mdict/fonts/pala.ttf');}0 Q# T' X1 x7 l+ W2 ?# d. K
- @font-face{font-family:"Palatino Linotype";font-weight:bold;font-style:normal;src:url('file:///sdcard/mdict/fonts/palab.ttf');}
" [2 g' M- c: v& ?+ n - @font-face{font-family:"Palatino Linotype";font-weight:normal;font-style:italic;src:url('file:///sdcard/mdict/fonts/palai.ttf');}7 U, k& t2 Q: {8 j% {, u' t8 I
- @font-face{font-family:"Palatino Linotype";font-weight:bold;font-style:italic;src:url('file:///sdcard/mdict/fonts/palabi.ttf');}
5 L: b3 A- i4 ~4 T - @font-face{font-family:"Georgia";font-weight:normal;font-style:normal;src:url('file:///sdcard/mdict/fonts/georgia.ttf');}; F: M0 C7 D! H7 q5 L2 h9 {
- @font-face{font-family:"Georgia";font-weight:bold;font-style:normal;src:url('file:///sdcard/mdict/fonts/georgiab.ttf');}/ o" f$ V" r( ]3 a) C6 P# D
- @font-face{font-family:"Georgia";font-weight:normal;font-style:italic;src:url('file:///sdcard/mdict/fonts/georgiai.ttf');}
2 w( e4 J, i) X - @font-face{font-family:"Georgia";font-weight:bold;font-style:italic;src:url('file:///sdcard/mdict/fonts/georgiaz.ttf');}4 \/ ?9 O6 k5 H `5 e% `
- @font-face{font-family:"Kaiti";font-weight:normal;font-style:normal;src:url('file:///sdcard/mdict/fonts/simkai.ttf');}* g2 l! n" s& N, c2 r- `
- ; B1 f% E+ s% f3 {/ s/ {
- /*本CSS只作用于本词典,不影响其他词典的CSS*/
( q0 u6 v9 |3 D( g - dic-cont{font-size:1em;font-family:"Palatino Linotype",Georgia,"Times New Roman","Microsoft YaHei",STXihei,serif;}
& q |; `; ]- n, X - dic-cont dic-g_f{display:block;font-family:inherit;}
; J; D: \; U8 H# Y8 C - dic-cont dic-g_s{display:block;margin-left:1.5em;font-size:.9em;font-family:Georgia,"Times New Roman","KaiTi","Microsoft YaHei",STXihei,serif;}
/ m9 d) q3 V2 d/ H5 m. B0 b, l& w, _ - dic-cont dic-w{font-size:1.3em;font-weight:bold;color:blue;}7 n& N& `0 C) k$ j1 s7 w/ f
- dic-cont dic-ex_en{color:#369;}1 A& M* D$ S, ?1 e4 |; G; V
- dic-cont dic-ex_zh{color:#666;}
复制代码
3 M/ v5 P: M: L( a9 N5 Q4 u! x: [: x+ B
截图是真的词典查询结果,和上面的例子不相关的啦~ 效果是同一个道理; V; b# c L; b/ Z2 f% l' x0 Q
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?免费注册
x
|