Bug 60783

Summary: Add Liberation Sans Narrow to 30-metric-aliases.conf
Product: fontconfig Reporter: Petr Gajdos <pgajdos>
Component: confAssignee: fontconfig-bugs
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Petr Gajdos 2013-02-13 11:37:33 UTC
Hi,

could be possible to extend 30-metric-aliases.conf by mapping Arial Narrow <-> Liberation Sans Narrow?

E. g.

Index: conf.d/30-metric-aliases.conf
===================================================================
--- conf.d/30-metric-aliases.conf
+++ conf.d/30-metric-aliases.conf
@@ -296,5 +296,15 @@
          </accept>
        </alias>

+       <!-- Map Arial Narrow <-> Liberation Sans Narrow -->

+       <alias binding="same">
+         <family>Arial Narrow</family>
+         <accept><family>Liberation Sans Narrow</family></accept>
+       </alias>
+
+       <alias binding="same">
+         <family>Liberation Sans Narrow</family>
+         <accept><family>Arial Narrow</family></accept>
+       </alias>
 </fontconfig>

Thanks for consideration.
Comment 1 Akira TAGOH 2013-02-15 11:12:00 UTC
Why do you want to substitute them each other?
Comment 2 Petr Gajdos 2013-03-01 07:28:10 UTC
(In reply to comment #1)
> Why do you want to substitute them each other?

Because they are metric compatible, aren't they?
Comment 3 Akira TAGOH 2013-03-01 07:36:12 UTC
This is to define a fallback for those metrics-compatible fonts. how many documentations use Liberation Sans Narrow and how many people who doesn't have it but Arrial Narrow, wants to substitute for it? even though it's a free font.
Comment 4 Akira TAGOH 2013-03-01 07:55:35 UTC
To make it clear,

(In reply to comment #0)
> +       <alias binding="same">
> +         <family>Arial Narrow</family>
> +         <accept><family>Liberation Sans Narrow</family></accept>
> +       </alias>

This one would be worth adding but:

> +
> +       <alias binding="same">
> +         <family>Liberation Sans Narrow</family>
> +         <accept><family>Arial Narrow</family></accept>
> +       </alias>

This one wouldn't be.
Comment 5 Petr Gajdos 2013-03-01 07:57:44 UTC
Well, because sake of symmetry.

With same logic, you could also drop

        <alias binding="same">
          <family>Liberation Sans</family>
          <default>
          <family>Arial</family>
          </default>
        </alias>

and like, or am I missing something?
Comment 6 Akira TAGOH 2013-03-01 08:06:34 UTC
(In reply to comment #5)
> Well, because sake of symmetry.
> 
> With same logic, you could also drop
> 
>         <alias binding="same">
>           <family>Liberation Sans</family>
>           <default>
>           <family>Arial</family>
>           </default>
>         </alias>

This isn't <accept>. so is it a typo maybe?
you mean:

       <alias binding="same">
         <family>Arial Narrow</family>
         <accept><family>Liberation Sans Narrow</family></accept>
       </alias>

       <alias binding="same">
         <family>Liberation Sans Narrow</family>
         <default><family>Arial Narrow</family></default>
       </alias>

?
Comment 7 Petr Gajdos 2013-03-01 08:16:18 UTC
Maybe I do not understand you exactly, so please try to rephrase if my reply is wrong or incomplete:

(In reply to comment #6)
> (In reply to comment #5)
> > Well, because sake of symmetry.
> > 
> > With same logic, you could also drop
> > 
> >         <alias binding="same">
> >           <family>Liberation Sans</family>
> >           <default>
> >           <family>Arial</family>
> >           </default>
> >         </alias>
> 
> This isn't <accept>. so is it a typo maybe?

This isn't <accept>, but if I understand correctly, it maps 'Liberation Sans' to other families in 'Arial' group defined in 30-metric-aliases.conf. So document requiring 'Liberation Sans' will be displayed with some font in that group if installed.

With the same probability there can be document requiring 'Liberation Sans Narrow', right?
Comment 8 Petr Gajdos 2013-03-01 08:17:47 UTC
(In reply to comment #7)
> So document requiring 'Liberation Sans' will be displayed with some font in
> that group if installed.

If Liberation Sans are not installed of course.
Comment 9 Akira TAGOH 2013-03-01 08:31:07 UTC
difference between <accept> and <default> is a priority where specified font appears in the pattern. behavior depends on other recipes and what fonts are installed on system though, given that one doesn't have Liberation Sans but Arrial, fontconfig may picks up Arrial in <accept> but not necessarily in <default>. particularly other fonts are set to the pattern by other recipes.

Please see a description for <alias> in fonts.conf(5).
Comment 10 Petr Gajdos 2013-03-01 08:50:52 UTC
(In reply to comment #9)
> difference between <accept> and <default> is a priority where specified font
> appears in the pattern. behavior depends on other recipes and what fonts are
> installed on system though, given that one doesn't have Liberation Sans but
> Arrial, fontconfig may picks up Arrial in <accept> but not necessarily in
> <default>. particularly other fonts are set to the pattern by other recipes.

Because we are talking about 30-*.conf file, most likely first conf file read by fontconfig which deals with <alias>es, there very probably isn't nothing behind 'Liberation Sans Narrow' in the family list if the requested pattern itself doesn't contain more families, so <default> and <accept> should do identical work, correct?

So yes, we can use <default> but I do not see the reason right now why not do it consistently for both rules in question.
Comment 11 Akira TAGOH 2013-03-01 09:23:36 UTC
(In reply to comment #10)
> Because we are talking about 30-*.conf file, most likely first conf file
> read by fontconfig which deals with <alias>es, there very probably isn't
> nothing behind 'Liberation Sans Narrow' in the family list if the requested
> pattern itself doesn't contain more families, so <default> and <accept>
> should do identical work, correct?

Well, *if* no other receipes, yes. otherwise that depends as I've already explained in the above comment. though such assumption makes no sense. I wonder how many people/distros use them as is without any extra recipes, but anyway.
Comment 12 Akira TAGOH 2013-03-01 09:32:57 UTC
fixed in master.

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.