Salve, I have a set of fonts with no italic but a small caps style. How can I prevent that fontconfig assigns a faux italic and instead map italic to small-caps, such that small-caps is used whenever italic is requested? I tried this in my fonts.conf but it only changes the family name, not the font used: <match target="font"> <test name="family"> <string>TT2010</string> </test> <test name="slant"> <const>roman</const> </test> <test target="pattern" name="slant" compare="not_eq"> <const>roman</const> </test> <edit name="family" mode="assign"> <string>TT2010 SC</string> </edit> <edit name="slant" mode="assign"> <const>oblique</const> </edit> </match> This gives me tt-regular.ttf: "TT2010 SC" "Regular" and not ?tt-sc.ttf? and hence anything italic becomes just plain roman instead of roman small caps. What does work is <edit name="file" mode="assign">. But that can?t be right? Am I misunderstanding the examples in /etc/fonts w.r.t. re-assigning a family? --Tobias
On Fri, 15 Jan 2010 17:30:48 +0100, Tobias Wolf <towolf at gmail.com> wrote:> <match target="font">This executes after the matching process, and so by this point the target files have been selected.> What does work is <edit name="file" mode="assign">. But that can?t be > right? Am I misunderstanding the examples in /etc/fonts w.r.t. > re-assigning a family?There isn''t any provision for looping back through the matching process to switch files. Fontconfig isn''t quite Turing-complete yet. -- keith.packard at intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20100115/b1e1f3cc/attachment.pgp
On Fri, Jan 15, 2010 at 5:50 PM, Keith Packard <keithp at keithp.com> wrote:> On Fri, 15 Jan 2010 17:30:48 +0100, Tobias Wolf <towolf at gmail.com> wrote: > >> <match target=3D"font"> > > This executes after the matching process, and so by this point the > target files have been selected.I started with pattern and then permuted all kinds of things until something changed. Obviously I have a fragile grasp of what all this means.>> What does work is <edit name=3D"file" mode=3D"assign">. But that can=E2=80=99t be >> right? Am I misunderstanding the examples in /etc/fonts w.r.t. >> re-assigning a family? > > There isn''t any provision for looping back through the matching process > to switch files. Fontconfig isn''t quite Turing-complete yet.Are you saying what I want can=E2=80=99t be done, or that I used the wrong approach? Please clarify. --Tobias
On 01/15/2010 11:30 AM, Tobias Wolf wrote:> What does work is <edit name="file" mode="assign">. But that can?t be > right?Well, that''s the closest you can get right now.> Am I misunderstanding the examples in /etc/fonts w.r.t. re-assigning a family?Which ones? What you can do is: <match target="pattern"> <test name="family"> <string>TT2010</string> </test> <test name="slant" compare="not_eq"> <const>roman</const> </test> <edit name="family" mode="assign"> <string>TT2010 SC</string> </edit> <edit name="slant" mode="assign"> <const>roman</const> </edit> </match> This should work if you ask for "TT2010" only. behdad> --Tobias
On Tue, Jan 19, 2010 at 12:05 AM, Behdad Esfahbod <behdad at behdad.org> wrote:> On 01/15/2010 11:30 AM, Tobias Wolf wrote: > > Am I misunderstanding the examples in /etc/fonts w.r.t. re-assigning a family? > > Which ones? ?What you can do is: > > <match target="pattern"> > ? ? ? ?<test name="family"> > ? ? ? ? ? ? ? ?<string>TT2010</string> > ? ? ? ?</test> > ? ? ? ?<test name="slant" compare="not_eq"> > ? ? ? ? ? ? ? ?<const>roman</const> > ? ? ? ?</test> > ? ? ? ?<edit name="family" mode="assign"> > ? ? ? ? ? ? ? ?<string>TT2010 SC</string> > ? ? ? ?</edit> > ? ? ? ?<edit name="slant" mode="assign"> > ? ? ? ? ? ? ? ?<const>roman</const> > ? ? ? ?</edit> > </match> > > This should work if you ask for "TT2010" only.Ah. Aua. That?s it. Thank you, Behdad! ... Scales from my eyes ... I had left in an excess test stanza that conflicted with what I wanted to test. --Tobias