unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
@ 2016-02-16 15:22 Andy Moreton
  2016-02-22 18:17 ` Eli Zaretskii
  2016-02-23 23:22 ` Andy Moreton
  0 siblings, 2 replies; 10+ messages in thread
From: Andy Moreton @ 2016-02-16 15:22 UTC (permalink / raw)
  To: 22699

[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]

With DejaVu Sans Mono (version 2.35), accented characters are not
displayed properly at some sizes, and appear truncated at the top (as if
a pixel row is missing).

For example, LATIN SMALL LETTER A WITH RING ABOVE "å"

Displays properly
-----------------
In Windows font dialog, choose "Deja Vu Sans Mono", "Bold", "9"

`describe-char' shows the font as:
uniscribe:-outline-DejaVu Sans 
Mono-bold-normal-normal-mono-12-*-*-*-c-*-iso8859-1 (#xA7)

Top of ring is clipped
----------------------
In Windows font dialog, choose "Deja Vu Sans Mono", "Book", "9"

`describe-char' shows the font as:
uniscribe:-outline-DejaVu Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-=
iso8859-1 (#xA7)

This only appears with DejaVu Sans Mono version 2.35 at this size, with the
"Book" or "Oblique" font styles (larger or smaller sizes display
properly).

In GNU Emacs 25.0.91.2 (x86_64-w64-mingw32)
  of 2016-02-16 built on AJM-DESKTOP
Repository revision: b1a3ebedba88689d26f44cf7db338104b849ae99
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
  'configure --prefix=c:/emacs/emacs-25 --build=x86_64-w64-mingw32
  --without-dbus --enable-checking --enable-check-lisp-object-type
  --with-gif --with-jpeg --with-png --with-tiff --with-xpm --with-gnutls
  --with-rsvg --with-xml2 --without-imagemagick --with-modules 'CFLAGS=
  -g3 -O0' build_alias=x86_64-w64-mingw32
  PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS MODULES

Important settings:
   value of $LANG: en_US.UTF-8
   locale-coding-system: cp1252


[-- Attachment #2: DejaVuSansMono.png --]
[-- Type: image/png, Size: 5037 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-16 15:22 bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono Andy Moreton
@ 2016-02-22 18:17 ` Eli Zaretskii
  2016-02-23  0:54   ` Werner LEMBERG
  2016-02-23 23:22 ` Andy Moreton
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2016-02-22 18:17 UTC (permalink / raw)
  To: Andy Moreton; +Cc: 22699

> From: Andy Moreton <andrewjmoreton@gmail.com>
> Date: Tue, 16 Feb 2016 15:22:48 +0000
> 
> With DejaVu Sans Mono (version 2.35), accented characters are not
> displayed properly at some sizes, and appear truncated at the top (as if
> a pixel row is missing).
> 
> For example, LATIN SMALL LETTER A WITH RING ABOVE "å"
> 
> Displays properly
> -----------------
> In Windows font dialog, choose "Deja Vu Sans Mono", "Bold", "9"
> 
> `describe-char' shows the font as:
> uniscribe:-outline-DejaVu Sans 
> Mono-bold-normal-normal-mono-12-*-*-*-c-*-iso8859-1 (#xA7)
> 
> Top of ring is clipped
> ----------------------
> In Windows font dialog, choose "Deja Vu Sans Mono", "Book", "9"
> 
> `describe-char' shows the font as:
> uniscribe:-outline-DejaVu Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-=
> iso8859-1 (#xA7)
> 
> This only appears with DejaVu Sans Mono version 2.35 at this size, with the
> "Book" or "Oblique" font styles (larger or smaller sizes display
> properly).

Thanks.  I wonder how to make sure this is an Emacs problem and not
a problem with the font.  E.g., does some other version of Emacs
display this font at this size correctly?  Bonus points for stepping
through w32term.c:x_draw_glyph_string_foreground and looking for
what's going wrong with these characters of this font, as compared to
some others.  Maybe there's something unusual in the metrics of this
font, and we don't handle that situation correctly?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-22 18:17 ` Eli Zaretskii
@ 2016-02-23  0:54   ` Werner LEMBERG
  2016-02-23 17:26     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Werner LEMBERG @ 2016-02-23  0:54 UTC (permalink / raw)
  To: eliz; +Cc: 22699, andrewjmoreton


>> With DejaVu Sans Mono (version 2.35), accented characters are not
>> displayed properly at some sizes, and appear truncated at the top
>> (as if a pixel row is missing).
>> 
>> For example, LATIN SMALL LETTER A WITH RING ABOVE "å"
>> 
>> Displays properly
>> -----------------
>> In Windows font dialog, choose "Deja Vu Sans Mono", "Bold", "9"
>> 
>> `describe-char' shows the font as:
>> uniscribe:-outline-DejaVu Sans 
>> Mono-bold-normal-normal-mono-12-*-*-*-c-*-iso8859-1 (#xA7)
>> 
>> Top of ring is clipped
>> ----------------------
>> In Windows font dialog, choose "Deja Vu Sans Mono", "Book", "9"
>> 
>> `describe-char' shows the font as:
>> uniscribe:-outline-DejaVu Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-=
>> iso8859-1 (#xA7)
>> 
>> This only appears with DejaVu Sans Mono version 2.35 at this size,
>> with the "Book" or "Oblique" font styles (larger or smaller sizes
>> display properly).
> 
> Thanks.  I wonder how to make sure this is an Emacs problem and not
> a problem with the font.

Here's my educated guess as a font specialist, but without any clue
how Emacs font rendering is handled on MS Windows.

AFAICS, this is a problem with the Windows GDI library, which only
renders glyph data in the vertical range between `usWinAscent' and
`usWinDescent'.  These two parameters are set in a TrueType font's
`OS/2' table; they are used to define the default spacing between text
baselines for a particular font.

Even Microsoft core fonts are affected by this problem.  For example,
glyph U+01FA (Aringacute) in arial.ttf gets clipped.

The only solution to reliably avoid this issue is to use the
DirectWrite library, as far as I know.


    Werner

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-23  0:54   ` Werner LEMBERG
@ 2016-02-23 17:26     ` Eli Zaretskii
  2016-02-23 18:02       ` Werner LEMBERG
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2016-02-23 17:26 UTC (permalink / raw)
  To: Werner LEMBERG; +Cc: 22699, andrewjmoreton

> Date: Tue, 23 Feb 2016 01:54:19 +0100 (CET)
> Cc: andrewjmoreton@gmail.com, 22699@debbugs.gnu.org
> From: Werner LEMBERG <wl@gnu.org>
> 
> >> With DejaVu Sans Mono (version 2.35), accented characters are not
> >> displayed properly at some sizes, and appear truncated at the top
> >> (as if a pixel row is missing).
> >> 
> >> For example, LATIN SMALL LETTER A WITH RING ABOVE "å"
> >> 
> >> Displays properly
> >> -----------------
> >> In Windows font dialog, choose "Deja Vu Sans Mono", "Bold", "9"
> >> 
> >> `describe-char' shows the font as:
> >> uniscribe:-outline-DejaVu Sans 
> >> Mono-bold-normal-normal-mono-12-*-*-*-c-*-iso8859-1 (#xA7)
> >> 
> >> Top of ring is clipped
> >> ----------------------
> >> In Windows font dialog, choose "Deja Vu Sans Mono", "Book", "9"
> >> 
> >> `describe-char' shows the font as:
> >> uniscribe:-outline-DejaVu Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-=
> >> iso8859-1 (#xA7)
> >> 
> >> This only appears with DejaVu Sans Mono version 2.35 at this size,
> >> with the "Book" or "Oblique" font styles (larger or smaller sizes
> >> display properly).
> > 
> > Thanks.  I wonder how to make sure this is an Emacs problem and not
> > a problem with the font.
> 
> Here's my educated guess as a font specialist, but without any clue
> how Emacs font rendering is handled on MS Windows.
> 
> AFAICS, this is a problem with the Windows GDI library, which only
> renders glyph data in the vertical range between `usWinAscent' and
> `usWinDescent'.  These two parameters are set in a TrueType font's
> `OS/2' table; they are used to define the default spacing between text
> baselines for a particular font.

Emacs uses Uniscribe if possible (and it is in this case), not GDI
directly.

I indeed confirm that the problem exists in version 2.35 of the font,
but not in an earlier version I had before that (2.19?).  So perhaps a
bug report to the DejaVu fonts is in order.

> The only solution to reliably avoid this issue is to use the
> DirectWrite library, as far as I know.

Does MS-Word on Windows 8.1 use DirectWrite?  Because it, too, suffers
from the same problem with this font and size, when displaying that
character.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-23 17:26     ` Eli Zaretskii
@ 2016-02-23 18:02       ` Werner LEMBERG
  2016-02-23 18:18         ` Eli Zaretskii
  2016-02-23 18:44         ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Werner LEMBERG @ 2016-02-23 18:02 UTC (permalink / raw)
  To: eliz; +Cc: 22699, andrewjmoreton


> I indeed confirm that the problem exists in version 2.35 of the
> font, but not in an earlier version I had before that (2.19?).  So
> perhaps a bug report to the DejaVu fonts is in order.

Yes, probably – at least that the DejaVu maintainers can comment on
this problem.

>> The only solution to reliably avoid this issue is to use the
>> DirectWrite library, as far as I know.
> 
> Does MS-Word on Windows 8.1 use DirectWrite?  Because it, too,
> suffers from the same problem with this font and size, when
> displaying that character.

I have no idea, since I don't use Windows.  As mentioned earlier, you
might check the `Aringacute' glyph in arial.ttf – if it is cropped,
you probably have an old engine that suffers the usWin{Ascent,Descent}
limitations.


    Werner

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-23 18:02       ` Werner LEMBERG
@ 2016-02-23 18:18         ` Eli Zaretskii
  2016-02-23 18:44           ` Werner LEMBERG
  2016-02-23 18:44         ` Eli Zaretskii
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2016-02-23 18:18 UTC (permalink / raw)
  To: Werner LEMBERG; +Cc: 22699, andrewjmoreton

> Date: Tue, 23 Feb 2016 19:02:10 +0100 (CET)
> Cc: andrewjmoreton@gmail.com, 22699@debbugs.gnu.org
> From: Werner LEMBERG <wl@gnu.org>
> 
> As mentioned earlier, you might check the `Aringacute' glyph in
> arial.ttf – if it is cropped, you probably have an old engine that
> suffers the usWin{Ascent,Descent} limitations.

That one is not cropped in Emacs, at least AFAICS.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-23 18:18         ` Eli Zaretskii
@ 2016-02-23 18:44           ` Werner LEMBERG
  0 siblings, 0 replies; 10+ messages in thread
From: Werner LEMBERG @ 2016-02-23 18:44 UTC (permalink / raw)
  To: eliz; +Cc: 22699, andrewjmoreton


>> As mentioned earlier, you might check the `Aringacute' glyph in
>> arial.ttf – if it is cropped, you probably have an old engine that
>> suffers the usWin{Ascent,Descent} limitations.
> 
> That one is not cropped in Emacs, at least AFAICS.

OK, then maybe the MS people have fixed this meanwhile.

Anyways, I've now looked at the TrueType bytecode of the `aring' glyph
in DejaVuSansMono-Bold.ttf font (v2.34), and it confirms my guess: At
12ppem (this is 9pt at 96dpi), the bytecode moves the `ring' subglyph
up one pixel so that the top pixel row is outside the range spanned up
by usWin{Ascent,Descent}.

For the sake of compatibility with Windows, I recommend that the
DejaVu people slightly increase `usWinAscent'.

Please forward this to the DejaVu bug tracker :-)


    Werner

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-23 18:02       ` Werner LEMBERG
  2016-02-23 18:18         ` Eli Zaretskii
@ 2016-02-23 18:44         ` Eli Zaretskii
  2020-08-12  3:54           ` Stefan Kangas
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2016-02-23 18:44 UTC (permalink / raw)
  To: Werner LEMBERG; +Cc: 22699, andrewjmoreton

> Date: Tue, 23 Feb 2016 19:02:10 +0100 (CET)
> Cc: andrewjmoreton@gmail.com, 22699@debbugs.gnu.org
> From: Werner LEMBERG <wl@gnu.org>
> 
> > Does MS-Word on Windows 8.1 use DirectWrite?  Because it, too,
> > suffers from the same problem with this font and size, when
> > displaying that character.
> 
> I have no idea, since I don't use Windows.

Googling seems to indicate that Office 2013 on Windows 8.1 does use
DirectWrite.  Since I see the same problem there as well, I think this
is a bug in the font, and should be reported to the DejaVu Sans font
developers.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-16 15:22 bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono Andy Moreton
  2016-02-22 18:17 ` Eli Zaretskii
@ 2016-02-23 23:22 ` Andy Moreton
  1 sibling, 0 replies; 10+ messages in thread
From: Andy Moreton @ 2016-02-23 23:22 UTC (permalink / raw)
  To: 22699

On Tue 23 Feb 2016, Werner LEMBERG wrote:

>>> As mentioned earlier, you might check the `Aringacute' glyph in
>>> arial.ttf – if it is cropped, you probably have an old engine that
>>> suffers the usWin{Ascent,Descent} limitations.
>> 
>> That one is not cropped in Emacs, at least AFAICS.
>
> OK, then maybe the MS people have fixed this meanwhile.
>
> Anyways, I've now looked at the TrueType bytecode of the `aring' glyph
> in DejaVuSansMono-Bold.ttf font (v2.34), and it confirms my guess: At
> 12ppem (this is 9pt at 96dpi), the bytecode moves the `ring' subglyph
> up one pixel so that the top pixel row is outside the range spanned up
> by usWin{Ascent,Descent}.

The Bold style displays properly though - it is the Book style that clips
the top of the glyph.

> For the sake of compatibility with Windows, I recommend that the
> DejaVu people slightly increase `usWinAscent'.
>
> Please forward this to the DejaVu bug tracker :-)

Indeed. Thanks for looking at this.

    AndyM






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono
  2016-02-23 18:44         ` Eli Zaretskii
@ 2020-08-12  3:54           ` Stefan Kangas
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2020-08-12  3:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: andrewjmoreton, 22699

tags 22699 + notabug
close 22699
thanks

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Tue, 23 Feb 2016 19:02:10 +0100 (CET)
>> Cc: andrewjmoreton@gmail.com, 22699@debbugs.gnu.org
>> From: Werner LEMBERG <wl@gnu.org>
>>
>> > Does MS-Word on Windows 8.1 use DirectWrite?  Because it, too,
>> > suffers from the same problem with this font and size, when
>> > displaying that character.
>>
>> I have no idea, since I don't use Windows.
>
> Googling seems to indicate that Office 2013 on Windows 8.1 does use
> DirectWrite.  Since I see the same problem there as well, I think this
> is a bug in the font, and should be reported to the DejaVu Sans font
> developers.

The conclusion here seems to be that this is not a bug in Emacs, but in
the particular font.  I'm therefore closing this bug report.

If this is incorrect, please reply to this email (use "Reply to all" in
your email client) and we can reopen the bug report.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-12  3:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16 15:22 bug#22699: 25.0.91; Accented characters truncated with DejaVu Sans Mono Andy Moreton
2016-02-22 18:17 ` Eli Zaretskii
2016-02-23  0:54   ` Werner LEMBERG
2016-02-23 17:26     ` Eli Zaretskii
2016-02-23 18:02       ` Werner LEMBERG
2016-02-23 18:18         ` Eli Zaretskii
2016-02-23 18:44           ` Werner LEMBERG
2016-02-23 18:44         ` Eli Zaretskii
2020-08-12  3:54           ` Stefan Kangas
2016-02-23 23:22 ` Andy Moreton

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).