diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-06-07 10:37:01 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-07-29 08:18:08 +0100 |
commit | 7409743d98cab135da537bce11103a8416d77f60 (patch) | |
tree | 9ea8b44dda1dac0e04d5a94aec1d46f51454a091 /pdf/ghostpdf.h | |
parent | b0075e3f398cbfe97e70a9ed9c0c6754f2bae738 (diff) | |
download | ghostpdl-7409743d98cab135da537bce11103a8416d77f60.tar.gz |
Copy existing font objects for substitutions
Previously we'd create a new font from the font file for every substitution.
This changes it so we create a "base" font object from the font file, then
substitutes are created by copying that font object.
This also addresses bug 705199
Constitutes the following:
Add a pdf_buffer object
Since the pdf_string/pdf_name rework, we can't use pdf_strings as a convenient
type for abitrary byte arrays which either might be more than 4k (static
analysis tools complain), or where the data buffer already exists, and isn't
being allocated as part of the pdf_string object.
So add a pdf_buffer for such situations. Also includes a function to (re)set the
data pointer and length in a pdf_buffer object. It's important to note that
once referenced by a pdf_buffer object, the data buffer is owned by the
pdf_buffer, and its lifetime is tied to the pdf_buffer object lifetime.
Revise pdf_font_truetype/pdf_cidfont_type2 to use pdf_buffer for their sfnt
data.
Have Type 1 Subr strings stored in a pdf array object
Expunge the old glyph "fake_names"...
...since we now have a "real" name table.
Clean up the CFF pdfi font objects
Move ToUnicode into pdf_font_base...
... rather than pdf_font_common - so it's in both CIDFonts and fonts.
Split out code for First/LastChar, MissingWidth and Widths array
so all font types use common code.
Add font object copying functions
For Type 1, CFF, and TTF fonts (NOT CIDFonts)
Cache substituted fonts
rather recreated on every substitution
Fix font copying to handle object num/generation
Handle multiple levels of lookup in fontmap
Fixes and tweaks in font copying/substituting changes
Don't pass font dict object for substitute font loading
Fix reference counting for file name string in font objects.
A few more font copying tweaks and fixes
Act on stoponerror for broken embedded fonts
Consolidate very similar functions
Diffstat (limited to 'pdf/ghostpdf.h')
-rw-r--r-- | pdf/ghostpdf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pdf/ghostpdf.h b/pdf/ghostpdf.h index 6e8906726..a2ca382f0 100644 --- a/pdf/ghostpdf.h +++ b/pdf/ghostpdf.h @@ -452,6 +452,7 @@ typedef struct pdf_context_s search_paths_t search_paths; pdf_dict *pdffontmap; pdf_dict *pdfnativefontmap; /* Explicit mappings take precedence, hence we need separate dictionaries */ + pdf_dict *pdf_substitute_fonts; pdf_dict *pdfcidfmap; /* These function pointers can be replaced by ones intended to replicate |