Return fontInfo for readAnnotAP

This commit is contained in:
Svetlana Kulikova
2025-02-14 11:51:33 +03:00
parent 600d2a6ac5
commit 8bc887142c
8 changed files with 99 additions and 2 deletions

View File

@ -682,6 +682,7 @@ HEADERS += \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/DropCap.h \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/Paragraph.h \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/Shape.h \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/Table.h \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/TextLine.h \
$$DOCX_RENDERER_ROOT_DIR/src/logic/managers/ExternalImageStorage.h \
$$DOCX_RENDERER_ROOT_DIR/src/logic/managers/FontStyleManager.h \
@ -706,6 +707,7 @@ SOURCES += \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/ContText.cpp \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/Paragraph.cpp \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/Shape.cpp \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/Table.cpp \
$$DOCX_RENDERER_ROOT_DIR/src/logic/elements/TextLine.cpp \
$$DOCX_RENDERER_ROOT_DIR/src/logic/managers/FontManager.cpp \
$$DOCX_RENDERER_ROOT_DIR/src/logic/managers/FontStyleManager.cpp \

View File

@ -519,6 +519,17 @@ function readAnnotAP(reader, AP)
// 0 - Normal, 1 - Multiply, 2 - Screen, 3 - Overlay, 4 - Darken, 5 - Lighten, 6 - ColorDodge, 7 - ColorBurn, 8 - HardLight,
// 9 - SoftLight, 10 - Difference, 11 - Exclusion, 12 - Hue, 13 - Saturation, 14 - Color, 15 - Luminosity
APi["BlendMode"] = reader.readByte();
let k = reader.readInt();
if (k != 0)
APi["fontInfo"] = [];
for (let j = 0; j < k; ++j)
{
let fontInfo = {};
fontInfo["text"] = reader.readString();
fontInfo["fontName"] = reader.readString();
fontInfo["fontSize"] = reader.readDouble();
APi["fontInfo"].push(fontInfo);
}
}
}

View File

@ -807,6 +807,25 @@ void ReadAnnotAP(BYTE* pWidgetsAP, int& i)
std::string arrBlendMode[] = { "Normal", "Multiply", "Screen", "Overlay", "Darken", "Lighten", "ColorDodge", "ColorBurn", "HardLight",
"SoftLight", "Difference", "Exclusion", "Hue", "Saturation", "Color", "Luminosity" };
std::cout << "Type " << arrBlendMode[nPathLength] << ", ";
int nTextSize = READ_INT(pWidgetsAP + i);
i += 4;
for (int k = 0; k < nTextSize; ++k)
{
nPathLength = READ_INT(pWidgetsAP + i);
i += 4;
std::cout << k << " Text " << std::string((char*)(pWidgetsAP + i), nPathLength) << ", ";
i += nPathLength;
nPathLength = READ_INT(pWidgetsAP + i);
i += 4;
std::cout << "Font " << std::string((char*)(pWidgetsAP + i), nPathLength) << ", ";
i += nPathLength;
nPathLength = READ_INT(pWidgetsAP + i);
i += 4;
std::cout << "Size " << (double)nPathLength / 100.0 << ", ";
}
}
std::cout << std::endl;
}
@ -1090,7 +1109,7 @@ int main(int argc, char* argv[])
}
// GLYPHS
if (true && nPagesCount > 0)
if (false && nPagesCount > 0)
{
BYTE* pGlyphs = GetGlyphs(pGrFile, nTestPage);
nLength = READ_INT(pGlyphs);
@ -1165,7 +1184,7 @@ int main(int argc, char* argv[])
}
// INTERACTIVE FORMS
if (false)
if (true)
{
ReadInteractiveFormsFonts(pGrFile, 1);
ReadInteractiveFormsFonts(pGrFile, 2);