<div dir="auto">Oops, correctly "fullname". No space.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2023年4月14日(金) 23:53 Akira TAGOH <<a href="mailto:akira@tagoh.org">akira@tagoh.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2023年4月14日(金) 23:11 Idriss Fekir <<a href="mailto:mcsm224@gmail.com" target="_blank" rel="noreferrer">mcsm224@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 4/14/23 12:16, Akira TAGOH wrote:<br>
> On Thu, Apr 13, 2023 at 10:48 PM Idriss Fekir <<a href="mailto:mcsm224@gmail.com" rel="noreferrer noreferrer" target="_blank">mcsm224@gmail.com</a>> wrote:<br>
>> Sorry, my question wasn't clear, what i meant is, is there a way in in<br>
>> the config file to say, "if given this string, match it to this psname,<br>
>> or this full_name", e.g: if given "Iosevka Extrabold Extended Oblique"<br>
>> match it to the font with psname:"Iosevka-Extrabold-Extended-Oblique".<br>
> <br>
> No. we could guess a postscript name from family and/or fullname but<br>
> it is't perfect because they are stored as independent metadata. they<br>
> are free to set regardless of regularity.<br>
> <br>
> So you need to do compare "family" and "postscriptname" separately.<br>
> <br>
>>>> My goal is, at application startup to check for fonts that aren't<br>
>>>> matched properly, then remap then load the config, is there a general<br>
>>>> solution?<br>
>>><br>
>>> That depends on the meaning of "not matched". speaking of the fallback<br>
>>> font, that is exactly what fontconfig does. In case of your issue,<br>
>>> that is the case-by-case. If there are any generally useful solutions,<br>
>>> please let us know.<br>
>>><br>
>><br>
>> What could be done in this particular case? that is,<br>
>> `fc-match "Isoveka Extrabold Extended Oblique"` outputs<br>
>> `Noto Sans Regular` instead of the correct font.<br>
> <br>
> You want to substitute it with Noto Sans no matter what they exist and<br>
> change the weight and the slant too?<br>
<br>
No, i just want for the font to match correctly,<br>
`fc-match "Isoveka Extrabold Extended Oblique"` should output <br>
`iosevka-extrabold.ttc: "Iosevka" "Extrabold Extended Oblique"`<br>
but it doesn't output that. It outputs `NotoSans-Regular.ttf: "Noto <br>
Sans" "Regular"`, which is wrong since i do have that Iosevka font <br>
installed.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Ah, got it. You set the wrong query string then. What you want to would be:</div><div dir="auto"><br></div><div dir="auto">$ fc-match ":full name=Isoveka Extrabold Extended Oblique"</div><div dir="auto"><br></div><div dir="auto">Or</div><div dir="auto"><br></div><div dir="auto">$ fc-match "Isoveka:style=Extrabold Extended Oblique"</div><div dir="auto"><br></div><div dir="auto">Though I'm not sure what the real issue was then. I presume that you wanted to reproduce your issue on some application with fc-match?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The only way i'm getting the correct font is with<br>
`fc-match ":postscriptname=Iosevka-Extrabold-Extended-Oblique"`<br>
i just want the output of:<br>
`fc-match "Isoveka Extrabold Extended Oblique"`<br>
to be identical to the output of:<br>
`fc-match ":postscriptname=Iosevka-Extrabold-Extended-Oblique"`<br>
(because matching like this with the psname outputs the correct font)<br>
<br>
Really sorry that my previous question wasn't clear enough.<br>
<br>
> I didn't test but this may *theoretically* works:<br>
> <br>
> <match><br>
>    <test name="fullname"><br>
>      <string>Isoveka Extrabold Extended Oblique</string><br>
>    </test><br>
>    <edit name="family" mode="prepend"><br>
>      <string>Noto Sans</string><br>
>    </edit><br>
>    <edit name="weight" mode="prepend"><br>
>      <const>regular</const><br>
>    </edit><br>
>    <edit name="slant" mode="prepend"><br>
>      <const>roman</const><br>
>    </edit><br>
> </match><br>
> <br>
> This assumes that applications request a font with fullname. you may<br>
> need to replace it with "family", and "style" or "weight" and "slant"<br>
> in some case.<br>
> If you want to fallback only when they aren't available, that may be<br>
> much more complicated.<br>
> <br>
>> Another question, what does `FcConfigSubstituteWithPat` do, i couldn't<br>
>> understand from the man page.<br>
> <br>
> Well, there are three matching patterns in fontconfig. "pattern",<br>
> "font", and "scan". These patterns are performed only when "kind" is<br>
> the same. however, if you call FcConfigSubstituteWithPat(config,<br>
> pfont, ppat, FcMatchFont) then, you can get both "pattern" in ppat and<br>
> "font" in pfont FcPatterns. see FcFontRenderPrepare() for more<br>
> details.<br>
> <br>
>><br>
>> Sorry for asking so many questions.<br>
>><br>
>> Thank.<br>
>> --<br>
>> Idriss<br>
> <br>
> <br>
> <br>
<br>
Thank a lot.<br>
-- <br>
Idriss<br>
</blockquote></div></div></div>
</blockquote></div>