|
本帖最后由 chigre3 于 2016-4-5 20:22 编辑 1 R, C/ T) w5 `/ ~# l0 r
5 k: w& g1 O& g+ ?3 N
字体测试说明:、
w0 m# w" ~. A0 s" u1. MDICT PC版,只要指定的字体系统已经安装,包括 CJK擴展E區 都能正常显示;
) J& c' S/ L5 d ~" ~2. MDICT ANDROID版,貌似只能支持到 CJK擴展B區 部分字符;
! C i4 f! s- n1 \8 n3. GoldenDict Android版,同样的文件(转stardict格式)和css,CJK擴展E區 正常显示
, R2 V5 H# g0 b8 {9 u& _" f6 v( E r4 w' I# J
中國哲學書電子化計劃 字體試驗頁
9 s, h/ s! f; f3 C1 m2 i8 \9 {* k9 Jhttp://ctext.org/font-test-page/zh
; O& ?- k7 C# P" E9 R* U! S現在公開されている花園明朝:2016年02月01日版; v, a+ v8 W1 }" e! z
) n/ M) h& k( n6 kPS. 以下只是简单举例,事实上,手机上用的话,还是尽量少自定义字体为好,加载显示速度有影响啊!% n* `% i- z4 t
0 U- C! m* B' x6 w, D1 P1 s
【词典.mdx】的词条都使用了外置式CSS,例如:! h( Z" d$ ^& h' O8 M
-----------------------------------------------------* w4 T7 q: B' T8 Q0 ?
- word! K- I$ v, X5 d5 e$ A0 P% y4 R4 }
- <link rel="stylesheet" type="text/css" href="css_for_android.css">- u, |7 }+ P; V, {# N0 S
- <dic-cont>
: |' I. S- A9 B - <dic-g_f><dic-w>word</dic-w></dic-g_f>' ~) k& i5 @8 l \! ]
- <dic-g_f>对应词、释义:</dic-g_f>
+ M v$ ]: v$ q7 Z - <dic-g_s><dic-ex_en>example1</dic-ex_en><dic-ex_zh> / 例句1中文翻译</dic-ex_zh></dic-g_s>
' z9 X" p# U3 Y! Y - <dic-g_s><dic-ex_en>example2</dic-ex_en><dic-ex_zh> / 例句2中文翻译</dic-ex_zh></dic-g_s> H# Q) p1 W# y6 z* M1 X
- </dic-cont>7 Z* f; n# Q% f% [( c
- </>
复制代码 * t0 f9 ]4 {5 Z8 g
-----------------------------------------------------
; V, N+ O. G/ B2 j【css_for_android.css】里,自定义字体等:
* y" w5 q% T& P5 S% i* F
' ]. d% r9 [! [! C9 X6 b2 s4 o9 u- /*MDICT安卓版本自定义几个本词典需要的字体,需将字体复制到SD卡下mdict目录fonts文件夹里*/ q; s! A* M9 {3 d& P; B
- @font-face{font-family:"Palatino Linotype";font-weight:normal;font-style:normal;src:url('file:///sdcard/mdict/fonts/pala.ttf');}
- d2 F) y6 }* j/ z/ _8 O - @font-face{font-family:"Palatino Linotype";font-weight:bold;font-style:normal;src:url('file:///sdcard/mdict/fonts/palab.ttf');}
|! G& V8 r8 r$ v$ f5 D/ H - @font-face{font-family:"Palatino Linotype";font-weight:normal;font-style:italic;src:url('file:///sdcard/mdict/fonts/palai.ttf');}/ {0 O& ~. C0 r2 X$ h1 T
- @font-face{font-family:"Palatino Linotype";font-weight:bold;font-style:italic;src:url('file:///sdcard/mdict/fonts/palabi.ttf');}' l. p/ F" X! a: X" u
- @font-face{font-family:"Georgia";font-weight:normal;font-style:normal;src:url('file:///sdcard/mdict/fonts/georgia.ttf');}
2 ^7 q& n5 V8 l# }, M. H) u - @font-face{font-family:"Georgia";font-weight:bold;font-style:normal;src:url('file:///sdcard/mdict/fonts/georgiab.ttf');}; I8 @' D1 j1 _
- @font-face{font-family:"Georgia";font-weight:normal;font-style:italic;src:url('file:///sdcard/mdict/fonts/georgiai.ttf');}
1 b, X' ?# k8 s5 D/ l. [ - @font-face{font-family:"Georgia";font-weight:bold;font-style:italic;src:url('file:///sdcard/mdict/fonts/georgiaz.ttf');}; h0 c( B% { t6 u+ R T3 a
- @font-face{font-family:"Kaiti";font-weight:normal;font-style:normal;src:url('file:///sdcard/mdict/fonts/simkai.ttf');}8 {) k& e$ b* [$ z" z( B( ?: h
- 5 T+ {3 @4 _& q
- /*本CSS只作用于本词典,不影响其他词典的CSS*/
8 V e h g6 ]# V5 S - dic-cont{font-size:1em;font-family:"Palatino Linotype",Georgia,"Times New Roman","Microsoft YaHei",STXihei,serif;}
" L6 g7 ?( H, {/ v0 w: c# {; m - dic-cont dic-g_f{display:block;font-family:inherit;}6 b$ A. T) T4 B' m$ ^2 A6 {
- 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;}+ A2 K3 y2 L& b7 I' U
- dic-cont dic-w{font-size:1.3em;font-weight:bold;color:blue;}+ B l2 Q; b) k2 D, f1 f8 Z1 w/ \
- dic-cont dic-ex_en{color:#369;}
! R R. @# ?+ g; e- z2 n$ E4 k - dic-cont dic-ex_zh{color:#666;}
复制代码
5 ?2 |9 @+ P1 y# y( O3 e1 [+ d; Z/ Z7 S& L1 @
截图是真的词典查询结果,和上面的例子不相关的啦~ 效果是同一个道理
! z& Y8 R" j: p& R- \ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?免费注册
x
|