New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 617168 link

Starred by 8 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Ligatures cause baseline shift with Roboto Slab

Project Member Reported by drott@chromium.org, Jun 3 2016

Issue description

Use a contenteditable with Robot Slab on Linux, type in a ligature, such as "fi".

Expected:
Ligature should have same baseline as surrounding text.

Actual:
Ligature shifts slightly below.


 

Comment 1 by drott@chromium.org, Jun 3 2016

Cc: kojii@chromium.org e...@chromium.org behdad@chromium.org
Labels: OS-All
Status: Available (was: Untriaged)
Screenshot?
Might be that the FreeType in use is not built with HarfBuzz, so does not detect ligatures for the purpose of autohinting.

Comment 4 by drott@chromium.org, Jun 6 2016

Screenshot and video attached.
roboto_baseline.png
8.7 KB View Download
fi_baseline.mp4
71.0 KB Download

Comment 5 by drott@chromium.org, Jun 10 2016

Cc: roozbeh@chromium.org rsheeter@google.com
Perhaps related to issue 550523 where the crossbars of T's do not line up?

Comment 6 by behdad@chromium.org, Jun 10 2016

Yeah, looks like what I said: FreeType compiled without HarfBuzz support enabled.

Comment 7 by drott@chromium.org, Jun 13 2016

Labels: -OS-All OS-Linux
Not reproducible on Mac. So this probably means that we should statically link Freetype, in that sense related to  issue 555855  (Freetype linkage issues). 

What is the interface that Freetype provides and which is affecting this positioning issue? Could you explain a bit more? Thanks.

Comment 8 by behdad@chromium.org, Jun 13 2016

Cc: bunge...@chromium.org
Dominik:

FreeType's autohinter adjusts glyph outlines to be pixel-aligned, to achieve higher contrast.  When compiled without harfbuzz support, freetype will only detect the default glyphs for Latin characters as belonging to the Latin writing system, and it will only autohint those according to the Latin rules.

When compiled *with* harfbuzz, FreeType will also detect ligatures made from Latin glyphs as being Latin themselves, and as such will adjust those glyphs as well.

Now, a question I cannot seem to answer is why is the baseline not pixel-aligned to begin with.  Is Skia trying to do subpixel-positioning in the y direction?  If yes, we probably should turn that off.
Components: Blink>Fonts

Comment 10 by drott@chromium.org, Dec 20 2016

Owner: drott@chromium.org
Status: Assigned (was: Available)

Comment 11 by drott@chromium.org, Jan 27 2017

Status: Started (was: Assigned)
I believe I have found a way to fix our linking dependencies so that I can activate "FT_CONFIG_OPTION_USE_HARFBUZZ" and solve this. Work in progress together with  issue 274030 .

Comment 12 by drott@chromium.org, Jan 27 2017

b/29167895

Comment 13 by e...@chromium.org, May 8 2017

Cc: mar...@sokrates.com.pl rnimmagadda@chromium.org drott@chromium.org ajha@chromium.org
Issue 550523 has been merged into this issue.

Comment 14 by drott@chromium.org, May 10 2017

Fix proposal up in https://codereview.chromium.org/2872333002
Project Member

Comment 15 by bugdroid1@chromium.org, May 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a377e3e1fa4f44a58f70abb2402e6cc79e210945

commit a377e3e1fa4f44a58f70abb2402e6cc79e210945
Author: drott <drott@chromium.org>
Date: Fri May 12 11:51:13 2017

Build FreeType with HarfBuzz support

FreeType's autohinter uses HarfBuzz API to collect additional GSUB and
GPOS mappings to detect ligatures that should be aligned by the
autohinter. Previously we were not able to build FreeType with HarfBuzz
support because of the cyclic dependency. This CL resolves the cyclic
dependency by building a bootstrap FreeType in order to build HarfBuzz'
hb_ft_* functions as a static library called harfbuzz-ng-ft. Then we
build harfbuzz-ng separately (which does not depend on FreeType), then
we build FreeType depending on harfbuzz-ng and harfbuzz-ng-ft.

This resolves issues with fi and ffi ligatures in Roboto looking like
they were shifted to a different baseline.

I tried developing a pixel test for this, which works if I force usage
of the FreeType autohinter through SkPaint::kSlight_Hinting, however we
are currently unable to automatically test this since our Linux layout
tests do not exercise the autohinting code and do not set this hinting
mode, probably due to the special fontconfig settings that we are using
for the layout tests. Manually verifying the Roboto ligatures however
confirms that this works.

BUG= 617168 

Review-Url: https://codereview.chromium.org/2871133004
Cr-Commit-Position: refs/heads/master@{#471277}

[modify] https://crrev.com/a377e3e1fa4f44a58f70abb2402e6cc79e210945/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/a377e3e1fa4f44a58f70abb2402e6cc79e210945/third_party/freetype/BUILD.gn
[modify] https://crrev.com/a377e3e1fa4f44a58f70abb2402e6cc79e210945/third_party/freetype/include/freetype-custom-config/ftoption.h
[modify] https://crrev.com/a377e3e1fa4f44a58f70abb2402e6cc79e210945/third_party/harfbuzz-ng/BUILD.gn
[add] https://crrev.com/a377e3e1fa4f44a58f70abb2402e6cc79e210945/third_party/harfbuzz-ng/harfbuzz.gni

Comment 17 by drott@chromium.org, May 12 2017

Status: Fixed (was: Started)
For Linux, this is now fixed, and as the bug report was about Linux, I'll close it. There is probably a remaining issue on ChromeOS on low resolution displays, filed that as  issue 721750 . But this would need to be fixed on the ChromeOS side as it has its own system for building FreeType and HarfBuzz as system libraries through emerge.
Project Member

Comment 18 by bugdroid1@chromium.org, May 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/149eb6a66fc6ff7d67627cf8305f833ae50b9b66

commit 149eb6a66fc6ff7d67627cf8305f833ae50b9b66
Author: drott <drott@chromium.org>
Date: Fri May 12 14:50:51 2017

Revert of Build FreeType with HarfBuzz support (patchset #7 id:110001 of https://codereview.chromium.org/2871133004/ )

Reason for revert:
Speculative revert for possibly fixing Linux builder compile failure which lead to tree closure https://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Linux%20x64/builds/17727

Original issue's description:
> Build FreeType with HarfBuzz support
>
> FreeType's autohinter uses HarfBuzz API to collect additional GSUB and
> GPOS mappings to detect ligatures that should be aligned by the
> autohinter. Previously we were not able to build FreeType with HarfBuzz
> support because of the cyclic dependency. This CL resolves the cyclic
> dependency by building a bootstrap FreeType in order to build HarfBuzz'
> hb_ft_* functions as a static library called harfbuzz-ng-ft. Then we
> build harfbuzz-ng separately (which does not depend on FreeType), then
> we build FreeType depending on harfbuzz-ng and harfbuzz-ng-ft.
>
> This resolves issues with fi and ffi ligatures in Roboto looking like
> they were shifted to a different baseline.
>
> I tried developing a pixel test for this, which works if I force usage
> of the FreeType autohinter through SkPaint::kSlight_Hinting, however we
> are currently unable to automatically test this since our Linux layout
> tests do not exercise the autohinting code and do not set this hinting
> mode, probably due to the special fontconfig settings that we are using
> for the layout tests. Manually verifying the Roboto ligatures however
> confirms that this works.
>
> BUG= 617168 
>
> Review-Url: https://codereview.chromium.org/2871133004
> Cr-Commit-Position: refs/heads/master@{#471277}
> Committed: https://chromium.googlesource.com/chromium/src/+/a377e3e1fa4f44a58f70abb2402e6cc79e210945

TBR=behdad@chromium.org,dpranke@chromium.org,peter@chromium.org,machenbach@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 617168 

Review-Url: https://codereview.chromium.org/2879843003
Cr-Commit-Position: refs/heads/master@{#471298}

[modify] https://crrev.com/149eb6a66fc6ff7d67627cf8305f833ae50b9b66/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/149eb6a66fc6ff7d67627cf8305f833ae50b9b66/third_party/freetype/BUILD.gn
[modify] https://crrev.com/149eb6a66fc6ff7d67627cf8305f833ae50b9b66/third_party/freetype/include/freetype-custom-config/ftoption.h
[modify] https://crrev.com/149eb6a66fc6ff7d67627cf8305f833ae50b9b66/third_party/harfbuzz-ng/BUILD.gn
[delete] https://crrev.com/a66d812aa78debb856c1938f439e98feabeaeada/third_party/harfbuzz-ng/harfbuzz.gni

Comment 20 by drott@chromium.org, May 16 2017

Status: Started (was: Fixed)
Reopening due to the revert, new CL up for review in https://codereview.chromium.org/2880223002
Project Member

Comment 21 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fbec38011870753cffb3cb2ff98aa0c00c63b25c

commit fbec38011870753cffb3cb2ff98aa0c00c63b25c
Author: drott <drott@chromium.org>
Date: Wed May 17 10:49:03 2017

Reland: Compile FreeType with HarfBuzz support

FreeType's autohinter uses HarfBuzz API to collect additional GSUB and
GPOS mappings to detect ligatures that should be aligned by the
autohinter. Previously we were not able to build FreeType with HarfBuzz
support because of the cyclic dependency. This CL resolves the cyclic
dependency by building a bootstrap FreeType in order to build HarfBuzz'
hb_ft_* functions as a static library called harfbuzz-ng-ft. Then we
build harfbuzz-ng separately (which does not depend on FreeType), then
we build FreeType depending on harfbuzz-ng and harfbuzz-ng-ft.

This CL also removes the previous pangoft2 link hack since the
:harfbuzz-ng target now brings all symbols required by pangoft2.

This resolves issues with fi and ffi ligatures in Roboto looking like
they were shifted to a different baseline.

I tried developing a pixel test for this, which works if I force usage
of the FreeType autohinter through SkPaint::kSlight_Hinting, however we
are currently unable to automatically test this since our Linux layout
tests do not exercise the autohinting code and do not set this hinting
mode, probably due to the special fontconfig settings that we are using
for the layout tests. Manually verifying the Roboto ligatures however
confirms that this works.

Reland after revert in https://codereview.chromium.org/2879843003/

BUG= 617168 

Review-Url: https://codereview.chromium.org/2880223002
Cr-Commit-Position: refs/heads/master@{#472413}

[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/build/config/freetype/BUILD.gn
[add] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/build/config/freetype/freetype.gni
[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/chrome/browser/ui/libgtkui/BUILD.gn
[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/remoting/host/it2me/BUILD.gn
[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/third_party/freetype/BUILD.gn
[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/third_party/freetype/include/freetype-custom-config/ftoption.h
[modify] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/third_party/harfbuzz-ng/BUILD.gn
[add] https://crrev.com/fbec38011870753cffb3cb2ff98aa0c00c63b25c/third_party/harfbuzz-ng/harfbuzz.gni

Comment 22 by drott@chromium.org, May 17 2017

Status: Fixed (was: Started)

Sign in to add a comment