[Fontconfig] Granular synthetic emboldening possible ?

Jay Aurabind jay.aurabind at gmail.com
Thu Jan 24 07:07:31 UTC 2019


On Wed, 23 Jan 2019 at 15:04, Akira TAGOH <akira at tagoh.org> wrote:

> On Wed, Jan 23, 2019 at 5:50 PM Werner LEMBERG <wl at gnu.org> wrote:
> > Uh, oh, bad wording on my side, sorry.  What he's actually after is
> > not emboldening per se but asking for *weight* N and wanting
> > fontconfig return a font with weight N+5 – ideally without
> > emboldening.
>
> Well, if simply wanting to increase a weight in what fontconfig returns:
>
> <match target="font">
>   <edit name="weight" mode="assign">
>     <plus>
>         <name>weight</name>
>         <int>5</int>
>     </plus>
>   </edit>
> </match>
>
> will always increase 5 to weight in result for example though, it
> won't take any effects on rendering.
> Or always wanting to *request* N+5 whether or not exactly finding it out:
>
> <match target="pattern">
>   <edit name="weight" mode="assign">
>     <plus>
>       <name>weight</name>
>       <int>5</int>
>     </plus>
>   </edit>
> </match>
>
>

I did some experiments with the suggested configuration. I found that not
all fonts support granular increase of weights. For instance, FreeSans OTF
font has its next width at value 51 (I used the config to request "N+5"
suggested by Akira.). Values until 50 have no change on rendering. However,
Roboto woff type does not seem to change below or at 51. This expt was
under the assumption that OTF types are more "vectorial" than TTF. I did
this by rejecting all TTF fonts and explicitly allowing only the folders I
want in fonts.conf (Thanks again, Akira, your another thread in fc mailing
list helped). The situation is now much better. Simply getting rid of TTF's
are giving a sharper looking fonts. Only if it had just a little more
weight, it would have hit the sweetspot for me.

So the experiment suggests that no two fonts are created equal, despite
being more vectorial by virtue of encoding in OTF format. This begs the
question, are there any FreeType Supported font formats that can actually
do granular weight rendering if requested by fontconfig? With the config
example, I believe fontconfig has done its part of requesting what I need.
Now the ball is in Freetype's court? ;) I do remember Werner mentioning
about the advanced web fonts that Freetype "allows access to", but for
them, the configuration is decided by the browser. This means I need to
poke my browser's font rendering mechanism as well. Besides, the systemwide
config option I tested did not affect browser's web page rendering. I wish
there was one place to tweak them all.

But this may not helps if no such fonts available on system.
>

> Anyway, if modifying a weight takes effects to the rendering, we don't
> need emboldeing at all. so...
> or am I still misunderstanding requrements here?
>
>
I think an appropriate requirement statement is "System-wide granular font
base weight adjustment"

> >
> >
> >     Werner
>
>
>
> --
> Akira TAGOH
>


-- 

Thanks and Regards,
*Aurabindo J*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20190124/6a9a33d3/attachment.html>


More information about the Fontconfig mailing list