有关 fontconfig 配置文件 test 条件关系问题

系统字体配置、中文显示和输入法问题
回复
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

有关 fontconfig 配置文件 test 条件关系问题

#1

帖子 cuihao » 2012-12-31 19:43

就是这种形式:

代码: 全选

<test qual="any" name="property" target="default" compare="eq">
多个test放到一起时,怎么判断关系呢?我知道全是“any”的话就相当于 A or B or C ...,全是 all 就是 and 关系。
那要是有 any 有 all 呢?比如(随便弄的……):

代码: 全选

        <test qual="all" name="姓名">
            <string>张三</string>
        </test>
        <test qual="any" name="性别">
            <string>男</string>
        </test>
        <test qual="any" name="昵称">
            <string>zhangsan</string>
        </test>
这样得到的结果是什么呢?比如:

代码: 全选

姓名=张三 and (性别=男 or 昵称=zhangsan)
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 有关 fontconfig 配置文件 test 条件关系问题

#2

帖子 eexpress » 2012-12-31 21:51

test直接嵌套吧。
● 鸣学
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

Re: 有关 fontconfig 配置文件 test 条件关系问题

#3

帖子 cuihao » 2012-12-31 22:37

? :em06
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: 有关 fontconfig 配置文件 test 条件关系问题

#4

帖子 自由建客 » 2013-01-09 20:33

Debian wheezy 还是 2.9.0,没这个问题。哈哈……
http://www.freedesktop.org/software/fon ... Log-2.9.91,「Use multiple <match>s or <alias>es for OR operator and multiple <test>s for AND operator.」当如何翻译。反正我的理解是「使用『多 <match>』 或『 <alias>』表示『或』操作,以及使用『多 <test>』表示『与』操作」。
兄弟们,请自行尝试。哥已经没洗发水了。哈哈……
哥若不关心,就没人能给个正确答案吗? :em04
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: 有关 fontconfig 配置文件 test 条件关系问题

#5

帖子 自由建客 » 2013-01-09 22:29

妈的!几乎重写配置了,而且还变得冗长乏味!一千行变三千行了!

举例:
过去[xml]
<!-- 花園明朝 -->
<match target="scan">
<test name="family">
<string>HanaMinA</string>
<string>HanaMinB</string>
</test>
<edit name="family" mode="assign_replace">
<string>HanaMin</string><string>花園明朝</string>
</edit>
<edit name="familylang" mode="assign_replace">
<string>en</string><string>ja</string>
</edit>
</match>
[/xml]

现在[xml]
<!-- 花園明朝 -->
<match target="scan">
<test name="family">
<string>HanaMinA</string>
</test>
<edit name="family" mode="assign_replace">
<string>HanaMin</string><string>花園明朝</string>
</edit>
<edit name="familylang" mode="assign_replace">
<string>en</string><string>ja</string>
</edit>
</match>
<match target="scan">
<test name="family">
<string>HanaMinB</string>
</test>
<edit name="family" mode="assign_replace">
<string>HanaMin</string><string>花園明朝</string>
</edit>
<edit name="familylang" mode="assign_replace">
<string>en</string><string>ja</string>
</edit>
</match>
[/xml]

过去[xml]
<match target="font">
<test name="family">
<string>AR PL UKai CN</string>
<string>AR PL UKai HK</string>
<string>AR PL UKai TW</string>
<string>AR PL UKai TW MBE</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
[/xml]
现在[xml]
<match target="font">
<test name="family">
<string>AR PL UKai CN</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family">
<string>AR PL UKai HK</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family">
<string>AR PL UKai TW</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family">
<string>AR PL UKai TW MBE</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
[/xml]
头像
cuihao
帖子: 4793
注册时间: 2008-07-24 11:33
来自: 郑州
联系:

Re: 有关 fontconfig 配置文件 test 条件关系问题

#6

帖子 cuihao » 2013-01-09 22:36

:em01 其实,test意义不明的问题,开发者规定一下就可以解决的。
何必大动干戈。
求人不如求它仨: 天蓝的Wiki 屎黄的Wiki 绿
Site: CUIHAO.TK    Twitter: @cuihaoleo
Machine: Athlon64 X2 5200+ / 2x2GB DDR2-800 / GeForce GTS 450
AD: ~まだ見ぬ誰かの笑顔のために~
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: 有关 fontconfig 配置文件 test 条件关系问题

#7

帖子 自由建客 » 2013-01-09 23:21

cuihao 写了::em01 其实,test意义不明的问题,开发者规定一下就可以解决的。
何必大动干戈。
不是不明,只是手册没说明。其实手册什么问题都没说明,任何人都可以拿任何一个标签说不明!我想,过不多久,那个多值功能又要加回去了。 :em04
fontconfig 很多 bug,代码也是一片混乱。反正我是绝望了。
头像
Cherrot
帖子: 981
注册时间: 2011-04-03 10:01
系统: Ubuntu 12.XX
来自: 帝都
联系:

Re: 有关 fontconfig 配置文件 test 条件关系问题

#8

帖子 Cherrot » 2013-01-11 11:02

哈哈 建客都有绝望的时候 :em04
Ubuntu技巧汇总http://wiki.ubuntu.org.cn/UbuntuSkills --你遇到的各种问题可能已经在里面了
我的技术博客http://www.cherrot.com
Code tells you how, comments should tell you why.
yqh1203
帖子: 108
注册时间: 2005-11-06 16:54

Re: 有关 fontconfig 配置文件 test 条件关系问题

#9

帖子 yqh1203 » 2013-06-03 17:14

我靠,这样搞,不搞死人?
自由建客 写了:妈的!几乎重写配置了,而且还变得冗长乏味!一千行变三千行了!

举例:
过去[xml]
<!-- 花園明朝 -->
<match target="scan">
<test name="family">
<string>HanaMinA</string>
<string>HanaMinB</string>
</test>
<edit name="family" mode="assign_replace">
<string>HanaMin</string><string>花園明朝</string>
</edit>
<edit name="familylang" mode="assign_replace">
<string>en</string><string>ja</string>
</edit>
</match>
[/xml]

现在[xml]
<!-- 花園明朝 -->
<match target="scan">
<test name="family">
<string>HanaMinA</string>
</test>
<edit name="family" mode="assign_replace">
<string>HanaMin</string><string>花園明朝</string>
</edit>
<edit name="familylang" mode="assign_replace">
<string>en</string><string>ja</string>
</edit>
</match>
<match target="scan">
<test name="family">
<string>HanaMinB</string>
</test>
<edit name="family" mode="assign_replace">
<string>HanaMin</string><string>花園明朝</string>
</edit>
<edit name="familylang" mode="assign_replace">
<string>en</string><string>ja</string>
</edit>
</match>
[/xml]

过去[xml]
<match target="font">
<test name="family">
<string>AR PL UKai CN</string>
<string>AR PL UKai HK</string>
<string>AR PL UKai TW</string>
<string>AR PL UKai TW MBE</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
[/xml]
现在[xml]
<match target="font">
<test name="family">
<string>AR PL UKai CN</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family">
<string>AR PL UKai HK</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family">
<string>AR PL UKai TW</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family">
<string>AR PL UKai TW MBE</string>
</test>
<edit name="spacing"><const>dual</const></edit>
<edit name="minspace"><bool>false</bool></edit>
</match>
[/xml]
回复