MCPcopy Create free account
hub / github.com/Tencent/tgfx / nextFontSubsetTag

Method nextFontSubsetTag

src/pdf/PDFDocumentImpl.cpp:462–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462std::string PDFDocumentImpl::nextFontSubsetTag() {
463 // PDF 32000-1:2008 Section 9.6.4 FontSubsets "The tag shall consist of six uppercase letters"
464 // "followed by a plus sign" "different subsets in the same PDF file shall have different tags."
465 // There are 26^6 or 308,915,776 possible values. So start in range then increment and mod.
466 uint32_t thisFontSubsetTag = nextFontSubsetTag_;
467 nextFontSubsetTag_ = (nextFontSubsetTag_ + 1u) % 308915776u;
468
469 std::string subsetTag(7, ' ');
470 char* subsetTagData = subsetTag.data();
471 for (size_t i = 0; i < 6; ++i) {
472 subsetTagData[i] = 'A' + (thisFontSubsetTag % 26);
473 thisFontSubsetTag /= 26;
474 }
475 subsetTagData[6] = '+';
476 return subsetTag;
477}
478
479PDFIndirectReference PDFDocumentImpl::emit(const PDFObject& object, PDFIndirectReference ref) {
480 object.emitObject(this->beginObject(ref));

Callers 1

GetAdvancedInfoMethod · 0.80

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected