New issue
Advanced search Search tips

Issue 697916 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 669453



Sign in to add a comment

Printing page with variable font instance fails to reproduce correct glyph shapes in printed result

Project Member Reported by drott@chromium.org, Mar 2 2017

Issue description

(Initially reported by Niklas Borson and Laurentiu Iancu at Microsoft, thanks for the report.)

Chrome Version: (copy from chrome://version)
OS: Windows 10 Redstone 2, Windows Insider Fast build of RS2

What steps will reproduce the problem?
(1) Install Avenir from the attached zip file on the system
(2) Open attached html test file in Chrome
(3) Print page

What is the expected result?
Glyph outlines and weights should look same as on screen.

What happens instead?
Glyph advance widths are correct for the variable font instances, however, their glyph outline weights are incorrect.

Font also available from https://github.com/Monotype/Monotype_prototype_variable_fonts/blob/master/AvenirNext/AvenirNext_Variable.ttf

 
PrintingIssue.zip
50.7 KB Download

Comment 1 by drott@chromium.org, Mar 2 2017

Ben, would you know who's the best person to investigate this, at the intersection of PDF generation and printing?

Comment 2 by drott@chromium.org, Mar 2 2017

Blocking: 669453
Cc: halcanary@chromium.org
So PDF doesn't really have support for variation fonts, so when a variation font is used the pdf generator is told this is a "multiple master" type of thing and it will snap off a minimal type3 font with only the glyphs used using the outlines provided by the typeface. However, the SkTypeface isn't currently telling PDF that the font is a "multiple master" like font, so it just things its a regular old font. Since it doesn't appear that DirectWrite currently has an API for telling if a given IDWriteFont is a non-default variation, we'll have to hack something in to make that work.
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 2 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/c66390560ed845dbaf8656615f6a9524da643fa4

commit c66390560ed845dbaf8656615f6a9524da643fa4
Author: Ben Wagner <bungeman@google.com>
Date: Thu Mar 02 20:08:20 2017

Tell PDF on Mac when a font is a variation font.

PDF needs to know when a font is a variation font so that it knows
it cannot just embed the typeface.

BUG= chromium:697916 

Change-Id: I85091e444a235545f0f63fe131729c107bb664a0
Reviewed-on: https://skia-review.googlesource.com/9158
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

[modify] https://crrev.com/c66390560ed845dbaf8656615f6a9524da643fa4/src/ports/SkFontHost_mac.cpp

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 3 2017

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

commit ce3b4f57b7f385757e6e3e50ffc902613e793b1f
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Fri Mar 03 22:48:01 2017

Roll src/third_party/skia/ 9c10df3b6..651cbe9af (54 commits)

https://skia.googlesource.com/skia.git/+log/9c10df3b60f4..651cbe9af67b

$ git log 9c10df3b6..651cbe9af --date=short --no-merges --format='%ad %ae %s'
2017-03-03 senorblanco GrTessellator: Implement a fast path in poly emission.
2017-03-03 benjaminwagner Add Braswell bots.
2017-03-03 herb Use an exponential growth strategy for extra blocks.
2017-03-03 caryclark Revert "Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping."""
2017-03-03 mtklein SkJumper: store_f32
2017-03-03 jcgregorio Upgrade Go in CIPD to 1.7.5
2017-03-03 reed Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping.""
2017-03-03 jcgregorio Remove extract_comments in housekeeper bot.
2017-03-03 robertphillips Switch SkImageGenerator over to generating GrTextureProxies
2017-03-03 caryclark Revert "Upgrade Go in CIPD to 1.7.5"
2017-03-03 jcgregorio Upgrade Go in CIPD to 1.7.5
2017-03-03 mtklein Put is_skia_standalone back a bit.
2017-03-03 mtklein Strengthen is_official_build, update docs.
2017-03-02 msarett Use non-fatal errors for WIC decoding failures
2017-03-03 halcanary Documentation: detailed iOS
2017-03-02 robertphillips Make GrSurface::MakeDeferred return sk_sp<GrTextureProxy>
2017-03-02 reed update cliptype test to exercise clipstack backend
2017-03-02 senorblanco GrTessellator: add a null-check for a clusterfuzz test case.
2017-03-02 bungeman Release resources if SkMallocPixelRef::NewWithProc fails.
2017-03-02 mtklein Revert "Use inline storage for SkEdgeBuilder."
2017-03-02 reed Don't mark the matrix-type as dirty just be cause we translate it.
2017-03-02 mtklein Remove SkLiteDL::makeThreadsafe().
2017-03-02 halcanary FuzzCanvas: fix drawVertices BUG=skia:6314
2017-03-02 reed add unittests for clip-state queries
2017-03-02 brianosman Use GrSemaphore rather than GrFence for external texture data
2017-03-02 herb Use the auto blitter alloc to build linear pipelines with.
2017-03-02 mtklein SkJumper: use AVX2 mask loads and stores for U32
2017-03-02 ethannicholas fixed duplicate interface variable in SPIR-V output
2017-03-02 reed Revert "Remove SkDraw from device-draw methods, and enable device-centric clipping."
2017-03-01 djsollen Refactor SkLiteDL to no longer extend SkDrawable.
2017-03-02 bungeman Tell PDF on Mac when a font is a variation font.
2017-03-02 benjaminwagner Add MotoG4 bot.
2017-03-02 herb Use inline storage for SkEdgeBuilder.
2017-03-02 reed pass storage directly to allocator for blitters
2017-03-02 herb Use proxy canvas size.
2017-03-02 reed Remove SkDraw from device-draw methods, and enable device-centric clipping.
2017-03-02 mtklein SkJumper: skip null contexts
2017-03-02 halcanary SkPDF: empty shader boxes bad
2017-03-02 brianosman Revert "Revert "Revert "Revert "Move GrTextureProvider to src""""
2017-03-02 jvanverth Use fast path for circular shadows.
2017-03-02 bungeman Check that the FT_Face actually exists in SkTypeface_FreeType::onGetVariationDesignPosition.
2017-03-02 mtklein SkJumper: be more precise by rejecting data sections.
2017-03-02 senorblanco GrTessellator (AA): restore rounding in Line::intersect().
2017-03-01 mtklein SkJumper: handle the <kStride tail in AVX+ mode.
2017-03-02 robertphillips Use GrTextureProvider's uniqueKey setting method rather than directly setting it
2017-03-02 bsalomon Determine whether any fp uses local coords in FragmentProcessorAnalysis rather than GrPipeline creation
2017-03-02 rmistry Fix flutter compile bot
2017-03-02 mtklein SkJumper: allow the compiler to generate FMAs
2017-03-02 hcm Update Skia milestone to 59
2017-03-02 msarett Test sRGB with non-linear blending using new "srgbnl" sink
2017-03-01 ethannicholas fix leak in SPIRV code generator
2017-03-02 kjlubick Symbolize all Ubuntu dm/nanobench runs
2017-03-01 mtklein Add some thread safety notes.
2017-03-01 robertphillips Remove atlas creation from GrResourceProvider

Created with:
  roll-dep src/third_party/skia
BUG=695696, 697916 , 697878 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=caryclark@chromium.org

Change-Id: I599776ba54b054924201133c698bd39853e475bd
Reviewed-on: https://chromium-review.googlesource.com/449974
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#454694}
[modify] https://crrev.com/ce3b4f57b7f385757e6e3e50ffc902613e793b1f/DEPS

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 7 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/f1bc5e8b78376e3b6509c8626623d3aae871daec

commit f1bc5e8b78376e3b6509c8626623d3aae871daec
Author: Ben Wagner <bungeman@google.com>
Date: Fri Apr 07 23:07:08 2017

Set the kMultiMaster_FontFlag in DirectWrite.

DirectWrite can now produce system font typefaces which are variations,
so mark these as multiple masters so printing knows what to do.

BUG= chromium:697916 

Change-Id: Idf09ebba3c7002a09ff2e4a2dbae13dbce4e79d4
Reviewed-on: https://skia-review.googlesource.com/12101
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>

[add] https://crrev.com/f1bc5e8b78376e3b6509c8626623d3aae871daec/src/sfnt/SkOTTable_fvar.h
[modify] https://crrev.com/f1bc5e8b78376e3b6509c8626623d3aae871daec/src/ports/SkTypeface_win_dw.cpp

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 8 2017

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

commit 47406dde406cf921a87a6759de91ff18bb79ec34
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Sat Apr 08 01:31:22 2017

Roll src/third_party/skia/ 868d52be4..f1bc5e8b7 (1 commit)

https://skia.googlesource.com/skia.git/+log/868d52be4e78..f1bc5e8b7837

$ git log 868d52be4..f1bc5e8b7 --date=short --no-merges --format='%ad %ae %s'
2017-04-07 bungeman Set the kMultiMaster_FontFlag in DirectWrite.

Created with:
  roll-dep src/third_party/skia
BUG= 697916 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=jvanverth@chromium.org

Change-Id: Ie0dd7be76aab0b5b2dc475b0a6589a312add90e4
Reviewed-on: https://chromium-review.googlesource.com/471852
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#463098}
[modify] https://crrev.com/47406dde406cf921a87a6759de91ff18bb79ec34/DEPS

Status: Fixed (was: Available)
I believe this has been fixed on all platforms now.

Comment 10 by drott@chromium.org, Apr 19 2017

I believe this is fixed for the original reported description, which revolved around named instances - which is great! 

However, I think we still have the more general problem of losing axis values of font-variation-settings CSS when printing, since we don't have a way of telling DirectWrite about those, or instantiating/subsetting a non-variable-font on the printing code paths so that glyphs will be spaced according to variation parameters, but glyph shapes are selected from the default instance.
Not sure what you mean, currently all printing goes through PDF and we are already creating a sub-setted non-variable Type3 font in the PDF for variation fonts. Indeed this is how we work on all platforms at the moment and is what the above change enables (the PDF generation wasn't being notified when a font was variable). I actually tested with axis-praxis web fonts on "anniversary", I'm not even sure I've actually tested with resolved named instances in "creator's". If you have an example of variation web fonts not working, please provide an example and re-open this issue.
Good to know!  So there's no dire need for a instancer/subsetter for printing...
At least not immediately. As I stated above the PDF generator will instance/subset manually by creating a Type3 font as it goes. However, we may need something more flexible if we move to XPS. However, that will be an issue for the XPS generator. I opened an issue for that at https://bugs.skia.org/6502 .

Comment 14 by drott@chromium.org, Apr 20 2017

Re #11, thank you for the clarification. Indeed good to know that we have this already, good work!

Sign in to add a comment