RetainPtr<const CPDF_Dictionary> root_font;Can multiple RootFonts, CIDFonts, and FontDescriptors point to one font file?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
RetainPtr<const CPDF_Dictionary> root_font;Can multiple RootFonts, CIDFonts, and FontDescriptors point to one font file?
Probably yes. You can try creating a PDF like that and see if it works.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#include <random>Can this use core/fxcrt/fx_random.h instead?
static constexpr auto kCharset = std::to_array<char>(Just generate some random numbers in the range [0, 25], and then add 'A'?
if (base_font_name.GetLength() > kTagLength &&BTW, CPDF_SimpleFont::LoadCommon() has similar but not quite the same logic. There's also RemoveSubsettedFontPrefix() living inside core/fxge/cfx_fontmapper.cpp.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
RetainPtr<const CPDF_Dictionary> root_font;Lei ZhangCan multiple RootFonts, CIDFonts, and FontDescriptors point to one font file?
Probably yes. You can try creating a PDF like that and see if it works.
I haven't manually created a PDF yet, but FPDFText_LoadFont() creates another font file stream when given the exact same font data. With FPDF_SUBSET_NEW_FONTS only, the mapping is probably always 1:1.
If we implement subsetting all fonts, that will likely change.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Can this use core/fxcrt/fx_random.h instead?
Done
Just generate some random numbers in the range [0, 25], and then add 'A'?
Done
BTW, CPDF_SimpleFont::LoadCommon() has similar but not quite the same logic. There's also RemoveSubsettedFontPrefix() living inside core/fxge/cfx_fontmapper.cpp.
Using MaybeRemoveSubsettedFontPrefix() after moving in https://pdfium-review.googlesource.com/c/pdfium/+/143592.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ByteString GenerateFontSubsetName(ByteString base_font_name);Can this live in the anonymous namespace now? Or be a const method?
// prefixes if necessary. 9.6.4 Font Subsets: the font name must begin with aWrite the ISO standard number here, as the paragraphs/sections are not always the same across different PDF spec versions.
RetainPtr<const CPDF_Stream> font_stream;Put the new entries above this one, since if one starts traversing the objects from `root_font` at the top, the font file is one of the bottom leaf nodes.
RetainPtr<const CPDF_Dictionary> root_font;Lei ZhangCan multiple RootFonts, CIDFonts, and FontDescriptors point to one font file?
Andy PhanProbably yes. You can try creating a PDF like that and see if it works.
I haven't manually created a PDF yet, but FPDFText_LoadFont() creates another font file stream when given the exact same font data. With FPDF_SUBSET_NEW_FONTS only, the mapping is probably always 1:1.
If we implement subsetting all fonts, that will likely change.
OK. Maybe leave a comment in the code as a reminder?
ByteString tag;Call `tag.Reserve(kTagLength.+ base_font_name.GetLength() + 1);` since the final string length is known. Then keep appending to `tag` and return `tag`.
// Chooses a random seed for the caller.Just use Fill() to generate some random numbers?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |