I have referred this official document of skia, and the demo run well. /
I got a pdf document, and the texts in it stayed sharp after scale.
sharp texts
but when I tried to draw SkPicture on the Canvas Created by SkPDF, it seems the whole pdf is a BitMap? after scaling, the text became blurry looks like below.
auto pdfDocument = SkPDF::MakeDocument(outputStream, metadata);
SkCanvas* pageCanvas = pdfDocument->beginPage(pageSize.width(),
pageSize.height());
Blurry texts
the SkPicture is flatten by my rendertree using PictureRecorder. the text is showed normally in devices(android,ios...)
the painting of texts is much complext than the demo.
void Text::DrawTextBlob(TDFCanvas& canvas, SkPaint& paint, std::shared_ptr<TextRenderData> data, float y,
std::shared_ptr<MultiChildRenderObjWithData>& layout) {
for (int i = 0; i < data->text_blobs.size(); ++i) {
TextEffectElement effect_element(canvas, paint, data->text_blobs[i], data->x_offsets[i], y);
DrawOrApplyEffects(effect_element, data, layout);
canvas.drawTextBlob(data->text_blobs[i], data->x_offsets[i], y, paint);
if (data->effect_lst && data->effect_lst->text_outline) {
ApplyOutline(effect_element);
}
}
}
I want the texts not to be the bitmap and stay sharp after scale. what could be the problem?