MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / resolveFirstLineIndent

Method resolveFirstLineIndent

lib/Epub/Epub/ParsedText.cpp:450–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450int ParsedText::resolveFirstLineIndent(const bool isFirstLine, const GfxRenderer& renderer, const int fontId) const {
451 if (!isFirstLine || !isNaturalAlign) {
452 return 0;
453 }
454 if (blockStyle.textIndentDefined) {
455 if (blockStyle.textIndent < 0 || !extraParagraphSpacing) {
456 return blockStyle.textIndent;
457 }
458 return 0;
459 }
460 if (!extraParagraphSpacing) {
461 return renderer.getSpaceWidth(fontId, EpdFontFamily::REGULAR) * 3;
462 }
463 return 0;
464}
465// Consumes data to minimize memory usage
466void ParsedText::layoutAndExtractLines(const GfxRenderer& renderer, const int fontId, const uint16_t viewportWidth,
467 const std::function<void(std::shared_ptr<TextBlock>)>& processLine,

Callers

nothing calls this directly

Calls 1

getSpaceWidthMethod · 0.80

Tested by

no test coverage detected