[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetype-devel
Subject:    Re: [ft-devel] Variable fonts: hhea/typo/win metrics interpreted differently for instances compared 
From:       Behdad Esfahbod <behdad () behdad ! org>
Date:       2018-12-22 20:06:33
Message-ID: CAF63+7Wad0TXKBGtgzL8EjtLuuqDcm_o4dKY9PM8Z6XYD58SDw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sat, Dec 22, 2018 at 11:23 AM Nikolaus Waxweiler <madigens@gmail.com>
wrote:

>
> > The thinking within the working group was that no one uses win
> > metrics, so we didn't encode their variations.  Indeed, the only time
> > one uses them these days is if typo and hhea metrics are not set...
>
> >
> But MVAR tags for win metrics exist?
>
> https://docs.microsoft.com/en-us/typography/opentype/spec/mvar#value-tags
>
> 'hcla'  horizontal clipping ascent      OS/2.usWinAscent
> 'hcld'  horizontal clipping descent     OS/2.usWinDescent
>
> Or are they specifically for clipping avoidance and should never modify
> line metrics?


You are right.  Those are for clipping on older Windows systems.  Only if
there's no usable line size in hhea or typo ones should one use win.


> Then the code should be removed anyway from the MVAR
> apply function. I see in the HB code you linked that you use the typo
> metrics if the typo bit is set and hhea metrics otherwise. I can find
> no mention of win* metrics in the codebase. Should FreeType behave
> similarly? I.e.
>





> 1. If OS/2 table exists and typo bit is on, use typo metrics
> 2. Otherwise, use hhea metrics
> 3. Unless they are zero, then use typo metrics. If they are zero as
> well, so be it.
> (4. Always ignore win metrics)
>
> The comment given in sfobjs.c:1662 says that some ARIALNB.ttf has typo
> metrics set to zero. So, not sure about 4., maybe only for static fonts?
>
> I'm in a bit of a bind with Cantarell, as I already released a version
> that ships with GNOME and does not have the typo bit set. Grr. I guess
> I need to look into how to make GTK or whatever add line gap somewhere
> or change the metrics around...
>
>

-- 
behdad
http://behdad.org/

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr">On Sat, Dec 22, 2018 at 11:23 AM Nikolaus Waxweiler \
&lt;<a href="mailto:madigens@gmail.com">madigens@gmail.com</a>&gt; \
wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><br> &gt; The thinking within the working group \
was that no one uses win <br> &gt; metrics, so we didn&#39;t encode their variations. \
Indeed, the only time <br> &gt; one uses them these days is if typo and hhea metrics \
are not set...<br> <br>
&gt; <br>
But MVAR tags for win metrics exist?<br>
<br>
<a href="https://docs.microsoft.com/en-us/typography/opentype/spec/mvar#value-tags" \
rel="noreferrer" target="_blank">https://docs.microsoft.com/en-us/typography/opentype/spec/mvar#value-tags</a><br>
 <br>
&#39;hcla&#39;   horizontal clipping ascent         OS/2.usWinAscent<br>
&#39;hcld&#39;   horizontal clipping descent        OS/2.usWinDescent<br>
<br>
Or are they specifically for clipping avoidance and should never modify <br>
line metrics?</blockquote><div><br></div><div>You are  right.   Those are for \
clipping on older Windows systems.   Only if there&#39;s no usable line size in hhea \
or typo ones should one use win.</div><div>  </div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> Then the code should be removed anyway from the \
MVAR <br> apply function. I see in the HB code you linked that you use the typo <br>
metrics if the typo bit is set and hhea metrics otherwise. I can find <br>
no mention of win* metrics in the codebase. Should FreeType behave <br>
similarly? I.e.<br></blockquote><div><br></div><div><br></div><div><br></div><div>  \
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px \
solid rgb(204,204,204);padding-left:1ex"> 1. If OS/2 table exists and typo bit is on, \
use typo metrics<br> 2. Otherwise, use hhea metrics<br>
3. Unless they are zero, then use typo metrics. If they are zero as <br>
well, so be it.<br>
(4. Always ignore win metrics)<br>
<br>
The comment given in sfobjs.c:1662 says that some ARIALNB.ttf has typo <br>
metrics set to zero. So, not sure about 4., maybe only for static fonts?<br>
<br>
I&#39;m in a bit of a bind with Cantarell, as I already released a version <br>
that ships with GNOME and does not have the typo bit set. Grr. I guess <br>
I need to look into how to make GTK or whatever add line gap somewhere <br>
or change the metrics around...<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail_signature">behdad<br><a href="http://behdad.org/" \
target="_blank">http://behdad.org/</a></div></div>



_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic