NanoMichael / MicroTeX

A dynamic, cross-platform, and embeddable LaTeX rendering library
MIT License
399 stars 66 forks source link

"openmath" rendering quality worse than "master" branch #159

Closed LiuPeiqiCN closed 10 months ago

LiuPeiqiCN commented 10 months ago

image image The rendering quality on the right side is noticeably worse, with significantly more font aliasing.

NanoMichael commented 10 months ago

It seems that the scaling ratio is set incorrectly. Please try changing it here: https://github.com/NanoMichael/MicroTeX/blob/c846d9c8d0e0772b9bcea4092c3cbcebdf3ee92c/example/qt/qt_skiatexwidget.cpp#L92

I currently don't have much time to maintain this project.

LiuPeiqiCN commented 10 months ago

Must set microtex::MicroTeX::setRenderGlyphUsePath(true)

sp1ritCS commented 10 months ago

@LiuPeiqiCN calling setRenderGlyphUsePath seems more like a workaround than actually fixing the issue. When this is set to false, skia is responsible for rendering the proper glyph based on it's unicode number, otherwise skia will just receive vector instructions on how to draw the glyph.

This might imply that skia attempts to cache glyphs in some sort of texture atlas that isn't using the proper resolution on HiDPI. When you draw latin text to a skia surface (using skia::textlayout::ParagraphBuilder), is that text then also blurry?