我也来折腾,Yahei做成了Deb包。

系统字体配置、中文显示和输入法问题
回复
头像
蝴蝶兰
帖子: 202
注册时间: 2006-04-18 10:13
来自: china
联系:

我也来折腾,Yahei做成了Deb包。

#1

帖子 蝴蝶兰 » 2007-03-01 16:29

下载了0.75的雅黑字体,两个文件:msyh.ttf msyhbd.ttf。
以下我敲的命令是红字。
mkdir cccc/DEBIAN -p
mkdir cccc/etc/defoma/hints -p
mkdir cccc/usr/share/fonts/truetype/Vista -p
cp msyh*.ttf cccc/usr/share/fonts/truetype/Vista

在cccc/etc/defoma/hints/下建两个文件:ttf-vista-yaheibd.hints ttf-vista-yahei.hints
内容如下

ttf-vista-yaheibd.hints
category truetype
begin /usr/share/fonts/truetype/Vista/msyhbd.ttf
Family = Vista-Yahei
FontName = Yahei-Bold
Encoding = Unicode
Location = Chinese-Taiwan Chinese-China English Japanese
Charset = ISO10646-1 GB2312 GB18030 ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-5 ISO8859-9 ISO8859-15 JISX0212 JISX0208 JISX0201 KOI8 MICROSOFT-CP1252
UniCharset = GB2312 GB18030 ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-5 ISO8859-9 ISO8859-15 JISX0212 JISX0208 JISX0201 KOI8 MICROSOFT-CP1252
GeneralFamily = Hei
Weight = Bold
Width = Variable
Shape = Upright
Alias = microsoft-yahei 雅黑
Foundry = Microsoft
Priority = 20
X-Family = MICROSOFT_YAHEI
X-ElementAlias = foundry=microsoft:family=hei:resx=100:resy=100
TTCap = halfwidth-bw=0.5 italic-angle=0.167 no-roblique no-oblique no-ritalic
end

ttf-vista-yahei.hints
category truetype
begin /usr/share/fonts/truetype/Vista/msyh.ttf
Family = Vista-Yahei
FontName = Yahei-Medium
Encoding = Unicode
Location = Chinese-Taiwan Chinese-China English Japanese
Charset = ISO10646-1 GB2312 GB18030 ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-5 ISO8859-9 ISO8859-15 JISX0212 JISX0208 JISX0201 KOI8 MICROSOFT-CP1252
UniCharset = GB2312 GB18030 ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-5 ISO8859-9 ISO8859-15 JISX0212 JISX0208 JISX0201 KOI8 MICROSOFT-CP1252
GeneralFamily = Hei
Weight = Medium
Width = Variable
Shape = Upright
Alias = microsoft-yahei 雅黑
Foundry = Microsoft
Priority = 20
X-Family = MICROSOFT_YAHEI
X-ElementAlias = foundry=default:family=hei:resx=100:resy=100
TTCap = halfwidth-bw=0.5 italic-angle=0.167 no-roblique no-oblique no-ritalic
end

可能这两个文件的内容可以改得更好。
在cccc/DEBIAN下建四个文件:conffiles control postinst prerm
内容如下

conffiles
/etc/defoma/hints/ttf-vista-yaheibd.hints
/etc/defoma/hints/ttf-vista-yahei.hints

control
Package: ttf-vista-yahei
Version: 0.75
Section: x11
Priority: optional
Architecture: all
Depends: xutils (>= 4.0.2), defoma
Installed-Size: 29066
Maintainer: Zhuyu <zhuzhengan@yahoo.com.cn>
Description: "Microsoft Yahei" Chinese TrueType font by Microsoft Technology
雅黑字体不是自由的。有可能侵权!:)
(msyh.ttf & msyhbd.ttf)

postinst
#!/bin/sh
set -e

package=ttf-vista-yahei

FILE=/etc/defoma/hints/${package}.hints
if [ "$1" = "configure" ]; then
/usr/bin/defoma-font -t reregister-all $FILE
fi

package=ttf-vista-yaheibd

FILE=/etc/defoma/hints/${package}.hints
if [ "$1" = "configure" ]; then
/usr/bin/defoma-font -t reregister-all $FILE
fi

exit 0

prerm
#!/bin/sh
set -e

package=ttf-vista-yaheibd

FILE=/etc/defoma/hints/${package}.hints
if [ "$1" = "remove" ]; then
/usr/bin/defoma-font -t purge-all $FILE
fi

package=ttf-vista-yahei

FILE=/etc/defoma/hints/${package}.hints
if [ "$1" = "remove" ]; then
/usr/bin/defoma-font -t purge-all $FILE
fi

然后在cccc/DEBIAN下生成一个md5sums

fakeroot -- dpkg -b cccc jjjj.deb
dpkg-name jjjj.deb

最后再可耻一下,浪费一下论坛空间,看图!
:)

图中第一行为24正常,第二行36粗体
附件
2.png
上次由 蝴蝶兰 在 2007-03-03 15:33,总共编辑 1 次。
回避问题 = 曲线救国 = 棒槌
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#2

帖子 eexpress » 2007-03-01 16:53

沉默。。
● 鸣学
雕啸长空
帖子: 1897
注册时间: 2006-09-12 14:09

#3

帖子 雕啸长空 » 2007-03-01 16:58

不如直接

代码: 全选

cd ~/
tar -jcvf  fonts.tar.bz2   .fonts
但可以学学做deb :lol: :lol: :lol:
Fair winds and following seas !
头像
wyg1258
帖子: 654
注册时间: 2006-09-12 19:44
来自: whu

#4

帖子 wyg1258 » 2007-03-02 21:58

现在的 雅黑 最新的是 5.0 版本
头像
蝴蝶兰
帖子: 202
注册时间: 2006-04-18 10:13
来自: china
联系:

#5

帖子 蝴蝶兰 » 2007-03-03 15:37

fontversion=49152,这个版本是多少?你的5.0的fontversion是多少?
(第一层的贴子修改了一次,有一个大漏洞刚发现)
回避问题 = 曲线救国 = 棒槌
头像
TheThirdGhost
帖子: 1592
注册时间: 2006-07-23 16:25
来自: 南京

#6

帖子 TheThirdGhost » 2007-03-03 16:06

嘿嘿,我用的就是5.0的
头像
蝴蝶兰
帖子: 202
注册时间: 2006-04-18 10:13
来自: china
联系:

#7

帖子 蝴蝶兰 » 2007-03-03 16:11

谢谢楼上。我也正在找5.0,不知道效果会有什么变化。(好像有人说肉眼看不出)
回避问题 = 曲线救国 = 棒槌
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
联系:

#8

帖子 karron » 2007-03-03 16:12

不错。
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
lansrok
帖子: 1
注册时间: 2007-02-03 23:50

#9

帖子 lansrok » 2007-03-03 17:17

xp 里面有个cleartype技术,雅黑看起来才舒服,我自己改xp的字库为雅黑后,也发现这个问题,根本就是难看,开了clear type后就有所好转,因该说看起来很舒服了。 ubuntu改后,效果就是无视
头像
吴广德
帖子: 347
注册时间: 2006-10-26 9:24
系统: Ubuntu 18.04 LTS
来自: 中国-广西-南宁

#10

帖子 吴广德 » 2007-03-06 15:20

......楼主牛啊,这个......貌似把有版权的东东弄成deb不太好吧......
Ubuntu 18.04 LTS使用中......

主板:MSI Z97 gaming 9 ACK
CPU:I7 4790K
内存:DDR3 8G x 4 = 32G
硬盘:60G SSD(/) + 1T HD(/home)
显示器:Philips 274E5Q
头像
蝴蝶兰
帖子: 202
注册时间: 2006-04-18 10:13
来自: china
联系:

哈,好像是不太

#11

帖子 蝴蝶兰 » 2007-03-08 11:07

我是不是应该申请将此帖删掉?:):)
回避问题 = 曲线救国 = 棒槌
回复