目前阅读稳定版本,需要修改图片阅读方式
This commit is contained in:
@@ -77,18 +77,27 @@ public struct RDEPUBDTCoreTextRenderer: RDEPUBTextRenderer {
|
||||
options: dtOptions(request: request),
|
||||
documentAttributes: nil
|
||||
)
|
||||
builder?.willFlushCallback = { element in
|
||||
guard let element else { return }
|
||||
RDEPUBTextRendererSupport.prepareHTMLElementForReaderRendering(
|
||||
element,
|
||||
style: request.style
|
||||
)
|
||||
}
|
||||
return builder?.generatedAttributedString()
|
||||
}
|
||||
|
||||
private func dtOptions(request: RDEPUBTextChapterRenderRequest) -> [AnyHashable: Any] {
|
||||
let style = request.style
|
||||
let screenBounds = UIScreen.main.bounds.insetBy(dx: 20, dy: 28)
|
||||
var options: [AnyHashable: Any] = [
|
||||
NSTextSizeMultiplierDocumentOption: 1.0,
|
||||
DTDefaultFontFamily: style.font.familyName,
|
||||
DTDefaultFontName: style.font.fontName,
|
||||
DTDefaultFontSize: style.font.pointSize,
|
||||
DTDefaultLineHeightMultiplier: max((style.font.lineHeight + style.lineSpacing) / max(style.font.lineHeight, 1), 1),
|
||||
DTUseiOS6Attributes: true
|
||||
DTUseiOS6Attributes: true,
|
||||
DTMaxImageSize: NSValue(cgSize: screenBounds.size)
|
||||
]
|
||||
|
||||
if let baseURL = request.context.baseURL {
|
||||
|
||||
Reference in New Issue
Block a user