Satya Narayan Mishra
2006-Apr-01 09:46 UTC
[Fontconfig] fc-match and fc-match --sort disagree
Hi I am new to fontconfig and don''t know how all the innards work. I tried to look in the docs, but didn''t come up with anything. When I run fc-match Symbol I get Vera.ttf: "Bitstream Vera Sans" "Roman" When I run fc-match --sort Symbol | head -1 I get: opens___.ttf: "OpenSymbol" "Regular" I, of course, want the second to be used in the applications. I have in /etc/fonts/local.conf . <alias> <family>Symbol</family> <prefer> <family>OpenSymbol</family> <family>Standard Symbols L</family> </prefer> </alias> I would appreciate any help. Satya
Satya Narayan Mishra <snmishra@hotpop.com> ????????:> Hi > > I am new to fontconfig and don''t know how all the innards work. I tried > to look in the docs, but didn''t come up with anything. > > When I run fc-match Symbol I get Vera.ttf: "Bitstream Vera Sans" "Roman" > When I run fc-match --sort Symbol | head -1 I get: > opens___.ttf: "OpenSymbol" "Regular" > > I, of course, want the second to be used in the applications. > > I have in /etc/fonts/local.conf . > <alias> > <family>Symbol</family> > <prefer> > <family>OpenSymbol</family> > <family>Standard Symbols L</family> > </prefer> > </alias> > > > I would appreciate any help.You can use this: <match target="pattern"> <test name="family"> <string>symbol</string> </test> <edit name="family" mode="append" binding="strong"> <string>OpenSymbol</string> </edit> <edit name="family" mode="append" binding="strong"> <string>Standard Symbols L</string> </edit> </match> -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
Satya Narayan Mishra wrote:> Hi > > I am new to fontconfig and don''t know how all the innards work. I tried > to look in the docs, but didn''t come up with anything. > > When I run fc-match Symbol I get Vera.ttf: "Bitstream Vera Sans" "Roman" > When I run fc-match --sort Symbol | head -1 I get: > opens___.ttf: "OpenSymbol" "Regular" > > I, of course, want the second to be used in the applications. > > I have in /etc/fonts/local.conf . > <alias> > <family>Symbol</family> > <prefer> > <family>OpenSymbol</family> > <family>Standard Symbols L</family> > </prefer> > </alias>Yes, the results should be the same. I don''t quite know why they''re not; that would be a bug. It seems that <prefer> creates an FcValueBindingWeak (fcxml.c:1417), which causes the family-name to not get matched by FcFontMatch. If line 1417 created an FcValueBindingStrong instead, fc-match Symbol gives the apparently right thing. Keith, any insights? Is it a bug in FcFontMatch (this is in both 2.3.2 and 2.3.94) or in FcFontSort? pat
On Tue, 2006-04-04 at 00:39 -0400, Patrick Lam wrote:> It seems that <prefer> creates an FcValueBindingWeak (fcxml.c:1417), > which causes the family-name to not get matched by FcFontMatch. If line > 1417 created an FcValueBindingStrong instead, fc-match Symbol gives the > apparently right thing. Keith, any insights? Is it a bug in > FcFontMatch (this is in both 2.3.2 and 2.3.94) or in FcFontSort?all aliases should create weak bindings. Oh. The problem here is that a weak binding is ''less important'' than the language, but for Symbol, we don''t care about language. I suggest using the more general match/edit rules and setting a strong binding for the family name. That will avoid having the language override the selection. -- keith.packard@intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060403/46d8e817/attachment.pgp
Keith Packard <keithp@keithp.com> ????????:> On Tue, 2006-04-04 at 00:39 -0400, Patrick Lam wrote: > >> It seems that <prefer> creates an FcValueBindingWeak (fcxml.c:1417), >> which causes the family-name to not get matched by FcFontMatch. If line >> 1417 created an FcValueBindingStrong instead, fc-match Symbol gives the >> apparently right thing. Keith, any insights? Is it a bug in >> FcFontMatch (this is in both 2.3.2 and 2.3.94) or in FcFontSort? > > all aliases should create weak bindings. Oh. The problem here is that a > weak binding is ''less important'' than the language, but for Symbol, we > don''t care about language. I suggest using the more general match/edit > rules and setting a strong binding for the family name. That will avoid > having the language override the selection.I think that''s what I suggested to Satya Narayan Mishra <snmishra@hotpop.com>: <match target="pattern"> <test name="family"> <string>symbol</string> </test> <edit name="family" mode="append" binding="strong"> <string>OpenSymbol</string> </edit> <edit name="family" mode="append" binding="strong"> <string>Standard Symbols L</string> </edit> </match> I use a rule like that in the /etc/fonts setup for SuSE Linux to make Mozilla display symbols correctly and this works just fine. -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????