[Fontconfig-bugs] [Bug 90330] Preserve binding when preparing patterns

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue May 19 16:37:28 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90330

--- Comment #22 from Karl Tomlinson <bugs.freedesktop at karlt.net> ---
(In reply to Behdad Esfahbod from comment #20)
> <prefer> seems to only be used currently to implement virtual families
> (sans, serif, etc).

> So, <prefer> currently happens without binding="same".  I guess it should. 
> Generally, sounds like <accept> and <prefer> should go with binding="same",
> whereas <default> shouldn't.  Does that sound about right?

When using <prefer> with sans-serif, etc., the weak binding is important and
so I assume intentional.

If the app asks for "sans-serif", then the behavior with weak is that the font
provided supports the language.  binding="same" would remove that behavior and
always return the same font regardless of language.

I suspect that bindings don't map well to prefer/accept/default because
bindings are about whether language support should take priority.
prefer/accept/default determine order amongst existing families of the same
binding (though I'm not sure that the behavior of always preferring all strong
families over any weak families is intentional).

Adding a "no match" binding for use in FcFontRenderPrepare may still be a way
to provide the useful information that the font didn't match the family at
all.  I can't think of a conflict with existing binding usage.

> If user asked for "sans", however, it would be useful to tell them that
> indeed what we returned is the preferred sans font...

I think it is sufficient to distinguish "weak" for preferred font for this
language, and "no match" for random font which may or may not support the
language.

binding="same" is often important, however, to ensure that a weak
<accept> doesn't behave like a <default>. 

>         <alias binding="same">
>           <family>Nimbus Sans</family>
>           <default>
>           <family>Helvetica</family>
>           </default>
>         </alias>
> 
> I think the default should be accept instead.

Probably (without checking how that interacts with other aliases in that
file), because I assume the intention is that, if an app asks for "Nimbus
Sans", "Some fallback font", then the priority should be "Nimbus Sans",
"Helvetica", "Some fallback font", rather than the current "Nimbus Sans",
"Some fallback font", "Helvetica".  Perhaps there are counter examples, but
accept and default at least provide some degree of choice in behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20150519/51a72e5a/attachment-0001.html>


More information about the Fontconfig-bugs mailing list