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

Issue 2479313005: Add font substituted metrics for OS other than Linux (Closed)

Created:
4 years, 1 month ago by npm
Modified:
4 years, 1 month ago
CC:
chromium-reviews, rkaplow
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add font substituted metrics for OS other than Linux Created a struct FPDF_SYSFONTINFO_WITHMETRICS to be able to call and override methods from the default system font infos, for OS's other than Linux. This was necessary because the function pointers in the struct contain pointers to the struct. FPDF_GetDefaultSystemFontInfo returns a pointer to a FPDF_SYSFONTINFO, but in reality it is a FPDF_SYSFONTINFO_DEFAULT. So the overriden methods need to receive as input the pointer given by FPDF_GetDefaultSystemFontInfo. BUG=448584 Committed: https://crrev.com/394c06613bf8080b922094a048567d93135521c0 Cr-Commit-Position: refs/heads/master@{#431103}

Patch Set 1 #

Patch Set 2 : Compile on Mac #

Patch Set 3 : Override all because struct pointer #

Total comments: 11

Patch Set 4 : Address comments #

Total comments: 2

Patch Set 5 : Use FPDF_FreeDefault #

Total comments: 2

Patch Set 6 : Move ifs inside methods #

Total comments: 6

Patch Set 7 : Nits #

Total comments: 1

Patch Set 8 : Fix Delete! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -14 lines) Patch
M pdf/out_of_process_instance.h View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M pdf/out_of_process_instance.cc View 1 2 3 4 3 chunks +0 lines, -6 lines 0 comments Download
M pdf/pdfium/pdfium_engine.cc View 1 2 3 4 5 6 7 8 chunks +134 lines, -6 lines 0 comments Download

Messages

Total messages: 36 (16 generated)
npm
PTAL
4 years, 1 month ago (2016-11-08 17:57:11 UTC) #4
Lei Zhang
https://codereview.chromium.org/2479313005/diff/40001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/40001/pdf/pdfium/pdfium_engine.cc#newcode311 pdf/pdfium/pdfium_engine.cc:311: FPDF_SYSFONTINFO_WITHMETRICS(FPDF_SYSFONTINFO* default_sysfontinfo) { explicit https://codereview.chromium.org/2479313005/diff/40001/pdf/pdfium/pdfium_engine.cc#newcode319 pdf/pdfium/pdfium_engine.cc:319: void* MapFontWithMetrics(struct _FPDF_SYSFONTINFO* ...
4 years, 1 month ago (2016-11-08 19:16:10 UTC) #5
Lei Zhang
Do you think we have enough font code that we can move it all to ...
4 years, 1 month ago (2016-11-08 19:16:34 UTC) #6
npm
I could move the font code, except the new file would need to know the ...
4 years, 1 month ago (2016-11-08 19:54:36 UTC) #7
Lei Zhang
On 2016/11/08 19:54:36, npm wrote: > I could move the font code, except the new ...
4 years, 1 month ago (2016-11-08 19:56:35 UTC) #8
Lei Zhang
https://codereview.chromium.org/2479313005/diff/40001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/40001/pdf/pdfium/pdfium_engine.cc#newcode605 pdf/pdfium/pdfium_engine.cc:605: FPDF_SYSFONTINFO_WITHMETRICS* g_font_info = On 2016/11/08 19:54:36, npm wrote: > ...
4 years, 1 month ago (2016-11-08 19:58:31 UTC) #9
npm
PTAL (+Tom in case I'm doing something silly with delete)
4 years, 1 month ago (2016-11-08 20:25:31 UTC) #11
Tom Sepez
https://codereview.chromium.org/2479313005/diff/60001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/60001/pdf/pdfium/pdfium_engine.cc#newcode323 pdf/pdfium/pdfium_engine.cc:323: ~FPDF_SYSFONTINFO_WITHMETRICS() { delete default_sysfontinfo_; } The public header says: ...
4 years, 1 month ago (2016-11-08 21:25:52 UTC) #12
npm
https://codereview.chromium.org/2479313005/diff/60001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/60001/pdf/pdfium/pdfium_engine.cc#newcode323 pdf/pdfium/pdfium_engine.cc:323: ~FPDF_SYSFONTINFO_WITHMETRICS() { delete default_sysfontinfo_; } On 2016/11/08 21:25:52, Tom ...
4 years, 1 month ago (2016-11-08 21:56:26 UTC) #13
Tom Sepez
> Otherwise I don't see a way to delete it, since FPDF_SYSFONTINFO_DEFAULT > is not ...
4 years, 1 month ago (2016-11-08 22:06:19 UTC) #14
npm
Rebased, and using FPDF_FreeDefaultSystemFontInfo in pdfium_engine.cc
4 years, 1 month ago (2016-11-09 16:02:21 UTC) #15
Tom Sepez
https://codereview.chromium.org/2479313005/diff/80001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/80001/pdf/pdfium/pdfium_engine.cc#newcode617 pdf/pdfium/pdfium_engine.cc:617: if (g_font_info->default_sysfontinfo_->Release) nit: this is OK, but I think ...
4 years, 1 month ago (2016-11-09 17:11:35 UTC) #20
Tom Sepez
LGTM otherwise
4 years, 1 month ago (2016-11-09 17:11:53 UTC) #21
npm
https://codereview.chromium.org/2479313005/diff/80001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/80001/pdf/pdfium/pdfium_engine.cc#newcode617 pdf/pdfium/pdfium_engine.cc:617: if (g_font_info->default_sysfontinfo_->Release) On 2016/11/09 17:11:35, Tom Sepez wrote: > ...
4 years, 1 month ago (2016-11-09 19:22:21 UTC) #22
Lei Zhang
lgtm https://codereview.chromium.org/2479313005/diff/100001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/100001/pdf/pdfium/pdfium_engine.cc#newcode325 pdf/pdfium/pdfium_engine.cc:325: FPDF_SYSFONTINFO* default_sysfontinfo_; nit: In structs, no trailing underscore. ...
4 years, 1 month ago (2016-11-09 19:42:56 UTC) #25
npm
https://codereview.chromium.org/2479313005/diff/100001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/100001/pdf/pdfium/pdfium_engine.cc#newcode325 pdf/pdfium/pdfium_engine.cc:325: FPDF_SYSFONTINFO* default_sysfontinfo_; On 2016/11/09 19:42:56, Lei Zhang (slow) wrote: ...
4 years, 1 month ago (2016-11-09 19:58:02 UTC) #26
npm
Fixing the delete and landing after testing in Mac https://codereview.chromium.org/2479313005/diff/120001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2479313005/diff/120001/pdf/pdfium/pdfium_engine.cc#newcode655 pdf/pdfium/pdfium_engine.cc:655: ...
4 years, 1 month ago (2016-11-09 20:58:08 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2479313005/140001
4 years, 1 month ago (2016-11-09 23:27:44 UTC) #32
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 1 month ago (2016-11-10 00:37:21 UTC) #34
commit-bot: I haz the power
4 years, 1 month ago (2016-11-10 00:41:36 UTC) #36
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/394c06613bf8080b922094a048567d93135521c0
Cr-Commit-Position: refs/heads/master@{#431103}

Powered by Google App Engine
This is Rietveld 408576698