We always advertise that FcFontMatch() returns the first item from FcFontSort(). This isn't true if the first font in the sort list has no character coverage and trimming is enabled. This happens with symbol.ttf since it has no usable cmap table. We should fix this by never trimming the first font in the list.
(In reply to comment #0) > We always advertise that FcFontMatch() returns the first item from > FcFontSort(). How is FcFontMatch() is relevant to that? I think it do more with the intelligent way than FcFontSort() because it checks the language coverage for the first font in the list. > This isn't true if the first font in the sort list has no > character coverage and trimming is enabled. This happens with symbol.ttf > since it has no usable cmap table. We should fix this by never trimming the > first font in the list. I guess you are talking about FcFontSort() since FcFontMatch() doesn't have a feature to trim the list. so the suggestion may be to check the language coverage for the first font in the list as well as FcFontMatch() ?
(In reply to comment #1) > (In reply to comment #0) > > We always advertise that FcFontMatch() returns the first item from > > FcFontSort(). > > How is FcFontMatch() is relevant to that? What I said. We always advertise that FcFontMatch() returns the same font that is at the top of the list of FcFontSort(). Pango relies on that for example. I believe Qt does too. > I think it do more with the > intelligent way than FcFontSort() because it checks the language coverage > for the first font in the list. Correct. > > This isn't true if the first font in the sort list has no > > character coverage and trimming is enabled. This happens with symbol.ttf > > since it has no usable cmap table. We should fix this by never trimming the > > first font in the list. > > I guess you are talking about FcFontSort() since FcFontMatch() doesn't have > a feature to trim the list. so the suggestion may be to check the language > coverage for the first font in the list as well as FcFontMatch() ? No. My suggestion is the other way around: to never trim the first font in FcFontSort(). I'll attach a patch.
Created attachment 90545 [details] [review] Patch
(In reply to comment #2) > What I said. We always advertise that FcFontMatch() returns the same font > that is at the top of the list of FcFontSort(). Pango relies on that for > example. I believe Qt does too. Well, my question is "This isn't true if the first font in the sort list has no character coverage and trimming is enabled.". what does this "This" point to? I saw your patch attached. but FcSortWalk() is called from FcFontSetSort() only which is called from FcFontSort() only. either functions are not involved with FcFontMatch() nor FcFontSetMatch(). it sounded to me like you were saying there are a problem in FcFontMatch() or so. so just got confused now.
Let me show it with an example. Currently: $ fc-match symbol symbol.ttf: "Symbol" "Regular" $ fc-match symbol --sort | head -n 1 Symbol.pfb: "Symbol" "Regular" $ fc-match symbol --sort --all | head -n 1 symbol.ttf: "Symbol" "Regular" I want to make sure the above three commands all return the same font. Ie. I want to make sure FcFontMatch() always returns the first font from FcFontSort(). You can say FcFontMatch() is buggy, or you can say FcFontSort() is buggy. Doesn't matter. We want the above to return the same font, and the easiest way to fix it is the patch I attached.
(In reply to comment #5) > Let me show it with an example. > > Currently: > > $ fc-match symbol > symbol.ttf: "Symbol" "Regular" > > $ fc-match symbol --sort | head -n 1 > Symbol.pfb: "Symbol" "Regular" > > $ fc-match symbol --sort --all | head -n 1 > symbol.ttf: "Symbol" "Regular" Ah, got it. though fc-match --sort and/or --all doesn't use FcFontMatch() at all. that's why, but anyway. > I want to make sure the above three commands all return the same font. Ie. > I want to make sure FcFontMatch() always returns the first font from > FcFontSort(). You can say FcFontMatch() is buggy, or you can say > FcFontSort() is buggy. Doesn't matter. We want the above to return the > same font, and the easiest way to fix it is the patch I attached. agreed.
Good to go in?
Yes, please. thanks
commit fee834a9c9e1089a9ae29b1d8e8b6a4cc710204b Author: Behdad Esfahbod <behdad@behdad.org> Date: Mon Dec 9 21:21:57 2013 -0500 Bug 72380 - Never drop first font when trimming Let me show it with an example. Currently: $ fc-match symbol symbol.ttf: "Symbol" "Regular" $ fc-match symbol --sort | head -n 1 Symbol.pfb: "Symbol" "Regular" $ fc-match symbol --sort --all | head -n 1 symbol.ttf: "Symbol" "Regular" I want to make sure the above three commands all return the same font. Ie. I want to make sure FcFontMatch() always returns the first font from FcFontSort(). As such, never trim first font.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.