Bug 99485 - Monospace 10 (DejaVuSansMono) in freetype >= 2.6 has invalid size
Summary: Monospace 10 (DejaVuSansMono) in freetype >= 2.6 has invalid size
Status: RESOLVED NOTABUG
Alias: None
Product: freetype
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Werner Lemberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-21 17:48 UTC by Kirill Zhumarin
Modified: 2017-02-12 16:51 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
bug (25.94 KB, image/png)
2017-01-21 17:48 UTC, Kirill Zhumarin
Details
freetype bug fix example (155.92 KB, image/png)
2017-01-21 20:43 UTC, Kirill Zhumarin
Details

Description Kirill Zhumarin 2017-01-21 17:48:18 UTC
Created attachment 129085 [details]
bug

See a screenshot!

Bug:
"p" in "Monospace 10" has height 10px - too small :(
"p" in "Monospace 11" has height 12px - too big :(

Expected:
"p" in "Monospace 10" has height 11px - normal!
"p" in "Monospace 11" has height 12px - normal!

Monospace font: DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
OS: Ubuntu 16.10
Freetype: 2.7 and 2.6

Downgrade to freetype 2.5.2 fixes problems!
Comment 1 Kirill Zhumarin 2017-01-21 20:43:05 UTC
Created attachment 129090 [details]
freetype bug fix example
Comment 2 Kirill Zhumarin 2017-01-21 20:43:45 UTC
Hm... i found this path in ubuntu freetype 2.5.2 and bug fixed!

Sample: https://bugs.freedesktop.org/attachment.cgi?id=129090


# Description: revert commit which creates regressions in gtk
# Ubuntu: https://bugs.launchpad.net/freetype/+bug/972223
# Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636776
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -246,10 +246,7 @@
     FT_Request_Metrics( size->face, req );
 
     if ( FT_IS_SCALABLE( size->face ) )
-    {
       error = tt_size_reset( ttsize );
-      ttsize->root.metrics = ttsize->metrics;
-    }
 
     return error;
   }
Comment 3 Werner Lemberg 2017-01-21 21:20:33 UTC
Please see

  http://lists.nongnu.org/archive/html/freetype-devel/2012-04/msg00001.html

and the following e-mails in the thread for an explanation why your report is invalid.
Comment 4 Kirill Zhumarin 2017-01-22 00:17:20 UTC
Okay, commit is invalid. But look at the screenshot: https://bugs.freedesktop.org/attachment.cgi?id=129090
It bug. This bug exists several years, but not fixed. Why? 
Maybe there is another bug-report? Else why this bug closed?
Comment 5 Werner Lemberg 2017-01-22 05:22:08 UTC
Kirill, I can only repeat: There is *no* bug. You are simply *accustomed* to
the old value.

(0) You should always mention the used DPI value.  I guess you are using 96dpi,
    right?  Then 10pt and 11pt correspond to the ppem values 13ppem and 15ppem
    (ppem values are always rounded to integer values), respectively.

(1) The code snippet you are referencing to doesn't apply to the issue at all!
    It comes from the TrueType driver, but if I test with `ftgrid' I get a `p'
    height of 10px for and 11px for 13 and 15 ppem, respectively.  (I tested
    DejaVuSansMono version 2.34.)

(2) Consequently, you are using the auto-hinter.  Here it is completely up to
    FreeType to do the hinting.  I no longer remember the reason, but there
    was obviously a change in the auto-hinter that resulted in modified heights
    of lowercase glyphs.  You might consider this as a bug, *I* consider it as
    a global improvement for hinting.  There is more than a single font that
    the auto-hinter has to take care of.

(3) As mentioned earlier, ppem values must be integer, but pt values can be
    fractional!  If I select 10.5pt, I get 10.5*96/72=14ppem, and – tadaa –
    FreeType's auto-hinter uses a height of 11px for glyph `p'.

Corollary: Either set up your OS to use the TrueType bytecode engine, or
select a size of 10.5pt.  All these issues should have been asked and
discussed on the FreeType mailing list instead of opening a bug report!
Comment 6 Yan Pas 2017-02-12 14:06:15 UTC
By the way, with 10.5 DeJavu Mono underscore symbol is invisible. Is it freetype's bug?
Comment 7 Werner Lemberg 2017-02-12 16:51:57 UTC
Using `ftview' I see character `_' for all resolutions.  However, underlining is normally not a character but created as a graphics.  So I'm rather sure this is not a FreeType bug.


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.