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

Issue 1874433002: Record all fonts, not just one per charset. (Closed)

Created:
4 years, 8 months ago by dsinclair
Modified:
4 years, 8 months ago
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Record all fonts, not just one per charset. Attempting to open bug_434.pdf on my Linux box would fail with: ../../xfa/fxfa/app/xfa_fwltheme.cpp:96: virtual FWL_ERR CXFA_FWLTheme::Initialize(): Assertion `__null != m_pCalendarFont' failed. I tracked the regression back to [1]. The issue seems to be in CFX_FontManager::AddInstalledFont we will only add one font for a given Charset. In my case I end up loading 6 charsets, but the fonts are all strange ones. When I open the PDF, it fails to find 'Arial' because I've registered these other fonts. To fix this I changed the m_FaceArray into a struct of {name, chraset}. Then we record all fonts into this list and search over that list for the charset when needed. This allows bug_434.pdf to open and the test to pass successfully. 1- https://pdfium.googlesource.com/pdfium/+/fe73e7849b8b4ce49408d2f52f3fc29b370b82b5 Committed: https://pdfium.googlesource.com/pdfium/+/ea98238666e33cd16b69cb23dcaca047c21c9998

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rebase to master #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -143 lines) Patch
M core/fxge/ge/fx_ge_fontmap.cpp View 1 2 6 chunks +45 lines, -47 lines 0 comments Download
M core/fxge/include/fx_font.h View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M xfa/fgas/font/fgas_stdfontmgr.cpp View 1 15 chunks +115 lines, -93 lines 0 comments Download

Messages

Total messages: 15 (6 generated)
dsinclair
PTAL. This is working, although I don't know if there are unintended consequences..... https://codereview.chromium.org/1874433002/diff/1/core/fxge/ge/fx_ge_fontmap.cpp File ...
4 years, 8 months ago (2016-04-07 19:03:22 UTC) #2
Tom Sepez
Adding Hong, who is taking over for Jun. Can you run this by the FX ...
4 years, 8 months ago (2016-04-08 15:36:54 UTC) #5
hong_zhang
line 1160 to 1165 are int index = m_CharsetArray.Find(Charset); if (index < 0) return UseInternalSubst(pSubstFont, ...
4 years, 8 months ago (2016-04-11 07:06:04 UTC) #6
dsinclair
PTAL. I removed m_CharSet array, and turned m_FaceArray into a struct which has the charset ...
4 years, 8 months ago (2016-04-11 13:52:11 UTC) #7
dsinclair
On 2016/04/11 13:52:11, dsinclair wrote: > PTAL. > > I removed m_CharSet array, and turned ...
4 years, 8 months ago (2016-04-12 13:01:56 UTC) #9
Tom Sepez
LGTM, but get sign-off from Hong
4 years, 8 months ago (2016-04-12 16:39:41 UTC) #10
hong_zhang
It is good. I confirmed with my team. Feel free to close this review. https://codereview.chromium.org/1874433002/diff/1/core/fxge/ge/fx_ge_fontmap.cpp ...
4 years, 8 months ago (2016-04-12 17:19:21 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1874433002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1874433002/40001
4 years, 8 months ago (2016-04-12 17:26:06 UTC) #13
commit-bot: I haz the power
4 years, 8 months ago (2016-04-12 17:51:08 UTC) #15
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://pdfium.googlesource.com/pdfium/+/ea98238666e33cd16b69cb23dcaca047c21c...

Powered by Google App Engine
This is Rietveld 408576698