Age | Commit message (Collapse) | Author |
|
BUG=pdfium:603
Review-Url: https://codereview.chromium.org/2392773003
|
|
BUG=pdfium:603
Review-Url: https://codereview.chromium.org/2391013002
|
|
m_Map maps to unsigned integer, but m_MultiCharBuf.GetLength() returns
an integer. There will be integer overflow if the length is big, and
UBSAN will complain. Thus, using FX_SAFE_UINT32. Replacing with uint32
would work as well: the point is to consider the length as uint instead
of int.
BUG=chromium:652232
Review-Url: https://codereview.chromium.org/2393573002
|
|
Review-Url: https://codereview.chromium.org/2386273004
|
|
The original way of detecting loops was passing a level parameter
through various functions. This missed some cases which also lead
to load type3 font char, for example, FindFont() may call
CheckType3FontMetrics() which may eventually lead to LoadChar().
The new way is to store the char loading depth, and abort when the depth
exceeds the max.
BUG=chromium:651304
Review-Url: https://codereview.chromium.org/2384853002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2377393002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2382723003
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2376153004
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2383543002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2379033002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2375283003
|
|
It is not necessary. For some methods, bool can be used instead. For
some other methods, the returned boolean is never used, so they can be
void.
Review-Url: https://codereview.chromium.org/2382803002
|
|
BUG=pdfium:597
Review-Url: https://codereview.chromium.org/2345063002
|
|
found by libfuzzer
Review-Url: https://codereview.chromium.org/2366143002
|
|
In all cases, bool can be used instead without problems.
Review-Url: https://codereview.chromium.org/2368693002
|
|
Remove C-casts, nits.
Review-Url: https://codereview.chromium.org/2367743003
|
|
Review-Url: https://codereview.chromium.org/2364643003
|
|
Given a large enough value for the character code it's possible to overflow
the conversion to an int. This Cl updates the code to guard against overflow.
BUG=chromium:648739
Review-Url: https://codereview.chromium.org/2358023002
|
|
Review-Url: https://codereview.chromium.org/2356603003
|
|
and in CPDF_CMapParser
Review-Url: https://codereview.chromium.org/2353963003
|
|
This Cl makes the Get and Set methods consistenly use {G|S}et<Type>For.
BUG=pdfium:596
Review-Url: https://codereview.chromium.org/2334323005
|
|
Review-Url: https://codereview.chromium.org/2340513002
|
|
UnicodeFromCharCode should be tried even if the font is flagged as
PDFFONT_SYMBOLIC. The result should be checked in case it's empty. This
fixes some corpus tests that were being incorrectly rendered, as well as
the bug below.
A deps change will be required before landing this CL.
BUG=chromium:591303
Review-Url: https://codereview.chromium.org/2300893003
|
|
- Removed unused methods
- Friendship with CPDF_PathManager is not needed
- Protected may be changed to private
Review-Url: https://codereview.chromium.org/2292023003
|
|
This CL uses the safe math libraries when calculating the font weight from
the StemV value as very large values for StemV can cause the signed int to
overflow.
BUG=chromium:641418
Review-Url: https://codereview.chromium.org/2293633002
|
|
Added a vector of pointers to CFX_Fonts in the class CPDF_Font, so that
fallback fonts may be used. In CPDF_CharPosList::Load, the glyphs for each
character are calculated. When m_Font does not support a character, a fallback
font is selected and the character is rendered using that font. This meant
adding an attribute to FXTEXT_CHARPOS so it knows which font renders it.
Also, methods in fpdf_render_text.cpp now may need to call device drawing
methods multiple times because these only support one font at a time. In
CPDF_TextRenderer::DrawNormalText and in CPDF_TextRenderer::DrawTextPath, the
device drawing method is called as few times as possible by grouping contiguous
characters rendered by the same font. In
CPDF_RenderStatus::DrawTextPathWithPattern, drawing was already done one
character at a time, but precalculating CFX_FaceCache. Now, the face cache is
precalculated for all of the fallback fonts.
The list of fallback fonts does not include tha main font. Otherwise the list
would be of raw pointers to avoid double free problems. For now, the font
Arial is used as fallback. This should fix the issue of not seeing Latin
characters displayed when bad fonts are used. However, this should be improved.
Tested manually using the file in the bug, plus a font directory containing a
font that supports Hangul but not Latin. This font is chosen as the substitute
font, but Latin characters are now being rendered.
Design proposal: go/pdfium_fallbackfonts
BUG=pdfium:358
Review-Url: https://codereview.chromium.org/2276653002
|
|
It was intended to be unsigned in the first place, and we're
perfectly happy with the overflow as long as it is no longer
undefined behaviour.
BUG=638489
Review-Url: https://codereview.chromium.org/2258053003
|
|
BUG=635438
Review-Url: https://codereview.chromium.org/2248473002
|
|
Review-Url: https://codereview.chromium.org/2248463002
|
|
Review-Url: https://codereview.chromium.org/2248453002
|
|
files.
This is the third CL to separate fx_ge into classes, one per file.
All fx_ge.h includes had to be replaced with new includes
The method definitions for CFX_FxgeDevice were not moved to a single file.
These methods are defined in two folders different from fxge/ge, so they were left untouched for now.
Review-Url: https://codereview.chromium.org/2223213002
|
|
Review-Url: https://codereview.chromium.org/2226003003
|
|
And use it where appropriate.
Review-Url: https://codereview.chromium.org/2224623002
|
|
This is the first CL in an attempt to split up the classes in fxge/include/fx_ge.h into their own files.
Review-Url: https://codereview.chromium.org/2217663002
|
|
Review-Url: https://codereview.chromium.org/2194853002
|
|
For the class owned member variables, use std::unique_ptr or
std::vector for memory management.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2169793002
|
|
Also did some cleanups such as removing an unused member variables and some unused structs.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2119013002
|
|
Also remove some if statements that are always true/false.
Review-Url: https://codereview.chromium.org/2094073002
|
|
Review-Url: https://codereview.chromium.org/2093313002
|
|
This Cl removes FPDFAPI_LoadCID2UnicodeMap() and inlines the code into the one
caller.
Review-Url: https://codereview.chromium.org/2097513002
|
|
Move ifx_renderdevicedriver class to its own file to share with
multiple devices to reduce code duplication.
Review-Url: https://codereview.chromium.org/2078783002
|
|
Since PDFium is compiled as C++ code, the void keyword is not needed.
BUG=pdfium:519
Review-Url: https://codereview.chromium.org/2084603003
|
|
- Clean up CFX_GEModule.
- Remove duplicate #defines in fx_ge.h
- Remove IsFontStyleFromCharCode() that always returns true.
- Mark a FXTEXT_CHARPOS field as Mac only.
Review-Url: https://codereview.chromium.org/2075333002
|
|
This change contains files in core/fpdfapi directory. This is part
of the efforts to make PDFium code compilable by Clang chromium
style plugins.
The changes are mainly the following:
-- move inline constructor/destructor of complex class/struct out-of-line;
-- add constructor/destructor of complex class/struct if not
explicitly defined;
-- add explicit out-of-line copy constructor when needed;
-- move inline virtual functions out-of-line;
-- Properly mark virtual functions with 'override';
-- some minor cleanups;
BUG=pdfium:469
Review-Url: https://codereview.chromium.org/2060973002
|
|
Make the return types/arguments match reality.
Review-Url: https://codereview.chromium.org/2053483002
|
|
Introduce a logically const initialization (via mutable
members) so that this can happen lazily under const methods.
Review-Url: https://codereview.chromium.org/2045033002
|
|
Also sort the static table to be compatible with bsearch().
Review-Url: https://codereview.chromium.org/2047813002
|
|
Review-Url: https://codereview.chromium.org/2032613003
|
|
When there are duplicate variable declarations, the inner names shadow the
outter ones. This is error prone and harder to read. Remove all the
instances found by /analyze.
BUG=chromium:613623, chromium:427616
Review-Url: https://codereview.chromium.org/2027273002
|
|
So everyone can avoid doing Byte to WideString conversions.
Also remove CFX_GEFont::GetPsName() and deduplicate a couple of
GetPsName() calls.
Review-Url: https://codereview.chromium.org/2019173002
|