Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Issue 1157163007: SkPDF: fall back on paths for unembeddable fonts. (Closed)

Created:
5 years, 6 months ago by hal.canary
Modified:
5 years, 2 months ago
Reviewers:
bungeman-skia, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

SkPDF: fall back on paths for unembeddable fonts. Add GM, SkPDFFont::CanEmbedTypeface BUG=skia:3866

Patch Set 1 : 2015-06-08 (Monday) 13:28:00 EDT #

Total comments: 2

Patch Set 2 : SkToInt #

Total comments: 2

Patch Set 3 : 2015-06-09 (Tuesday) 13:55:26 EDT #

Patch Set 4 : 2015-07-08 (Wednesday) 12:18:29 EDT #

Patch Set 5 : 2015-07-08 (Wednesday) 13:59:14 EDT #

Patch Set 6 : 2015-07-14 (Tuesday) 17:56:35 EDT #

Patch Set 7 : 2015-07-15 (Wednesday) 10:05:55 EDT #

Patch Set 8 : 2015-07-15 (Wednesday) 10:13:03 EDT #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -2 lines) Patch
A gm/pdf_never_embed.cpp View 1 2 3 4 5 6 7 1 chunk +55 lines, -0 lines 0 comments Download
M include/core/SkTypeface.h View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
A resources/Roboto2-Regular_NoEmbed.ttf View Binary file 0 comments Download
M src/core/SkTypeface.cpp View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 2 3 4 5 2 chunks +69 lines, -0 lines 0 comments Download
M src/pdf/SkPDFFont.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M src/pdf/SkPDFFont.cpp View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M src/ports/SkFontHost_FreeType.cpp View 1 2 3 4 5 3 chunks +8 lines, -2 lines 0 comments Download
M src/ports/SkFontHost_FreeType_common.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M src/ports/SkFontHost_win.cpp View 1 2 3 4 5 6 2 chunks +33 lines, -0 lines 1 comment Download
M tests/PDFPrimitivesTest.cpp View 1 2 3 4 4 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (15 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/20001
5 years, 6 months ago (2015-06-08 17:26:00 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/40001
5 years, 6 months ago (2015-06-08 17:28:41 UTC) #7
hal.canary
PTAL
5 years, 6 months ago (2015-06-08 17:28:42 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/1426)
5 years, 6 months ago (2015-06-08 17:32:55 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/60001
5 years, 6 months ago (2015-06-08 17:44:19 UTC) #12
bungeman-skia
https://codereview.chromium.org/1157163007/diff/40001/gm/pdf_never_embed.cpp File gm/pdf_never_embed.cpp (right): https://codereview.chromium.org/1157163007/diff/40001/gm/pdf_never_embed.cpp#newcode13 gm/pdf_never_embed.cpp:13: SkString font = GetResourcePath("Roboto2-Regular_NoEmbed.ttf"); I think you want SkAutoTUnref<SkTypeface> ...
5 years, 6 months ago (2015-06-08 17:46:47 UTC) #13
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-06-08 17:49:57 UTC) #15
hal.canary
https://codereview.chromium.org/1157163007/diff/60001/src/pdf/SkPDFFont.cpp File src/pdf/SkPDFFont.cpp (right): https://codereview.chromium.org/1157163007/diff/60001/src/pdf/SkPDFFont.cpp#newcode1435 src/pdf/SkPDFFont.cpp:1435: face->getAdvancedTypefaceMetrics(info, NULL)); On 2015/06/08 17:46:47, bungeman1 wrote: > This ...
5 years, 6 months ago (2015-06-08 17:54:36 UTC) #16
hal.canary
On 2015/06/08 17:54:36, Hal Canary wrote: > https://codereview.chromium.org/1157163007/diff/60001/src/pdf/SkPDFFont.cpp > File src/pdf/SkPDFFont.cpp (right): > > https://codereview.chromium.org/1157163007/diff/60001/src/pdf/SkPDFFont.cpp#newcode1435 ...
5 years, 5 months ago (2015-07-08 20:19:56 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/120001
5 years, 5 months ago (2015-07-14 21:56:19 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/140001
5 years, 5 months ago (2015-07-15 13:39:54 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/2094)
5 years, 5 months ago (2015-07-15 13:43:26 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/160001
5 years, 5 months ago (2015-07-15 14:06:18 UTC) #25
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/2098)
5 years, 5 months ago (2015-07-15 14:09:56 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1157163007/180001
5 years, 5 months ago (2015-07-15 14:13:34 UTC) #29
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 5 months ago (2015-07-15 14:28:55 UTC) #31
hal.canary
On 2015/07/15 14:28:55, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
5 years, 5 months ago (2015-07-15 14:59:08 UTC) #32
bungeman-skia
5 years, 5 months ago (2015-07-15 18:09:01 UTC) #33
https://codereview.chromium.org/1157163007/diff/180001/src/ports/SkFontHost_w...
File src/ports/SkFontHost_win.cpp (right):

https://codereview.chromium.org/1157163007/diff/180001/src/ports/SkFontHost_w...
src/ports/SkFontHost_win.cpp:1764: 
I think onGetFamilyName above is a little more sane:

bool LogFontTypeface::onCanEmbed() const {
    HFONT font = CreateFontIndirect(&fLogFont);

    HDC hdc = CreateCompatibleDC(NULL);
    HFONT savefont = (HFONT)SelectObject(hdc, font);

    OUTLINETEXTMETRIC otm;
    UINT otmIsValid = GetOutlineTextMetrics(hdc, sizeof(otm), &otm);
    if (!otmIsValid) {
        call_ensure_accessible(lf);
        otmIsValid = GetOutlineTextMetrics(hdc, sizeof(otm), &otm);
    }
    bool canEmbed = false;
    if (otmIsValid) {
        // If bit 1 is set, the font may not be embedded in a document.
        canEmbed = (0 == (otm.otmfsType & 0x1));
    }

    if (hdc) {
        ::SelectObject(hdc, savefont);
        ::DeleteDC(deviceContext);
    }
    if (font) {
        ::DeleteObject(font);
    }

    return canEmbed;
}

Powered by Google App Engine
This is Rietveld 408576698