Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight Misalignmnet in Rendering #52

Open
Danielku15 opened this issue Mar 6, 2025 · 0 comments
Open

Slight Misalignmnet in Rendering #52

Danielku15 opened this issue Mar 6, 2025 · 0 comments
Assignees

Comments

@Danielku15
Copy link
Member

When rendering multiple alphaTab symbol glyphs as one string, there happens to be some slight sub-pixel misalignment compared to chrome. It happens both on FreeType and OS mode, but looks different every time.

Likely a problem on the harfbuzz shaping.

width = 0.0f;
for (uint32_t i = 0; i < infosLength; i++)
{
glyphSpan[i] = (SkGlyphID)infos[i].codepoint;
auto xOffset = width + HarfBuzzToSkiaFontSize * positions[i].x_offset;
auto yOffset = HarfBuzzToSkiaFontSize * -positions[i].y_offset;
positionSpan[i] = {xOffset, yOffset};
width += HarfBuzzToSkiaFontSize * positions[i].x_advance;
}

OS Mode (windows):

Image

Image

FreeType:

Image

Chrome (SVG):

Image

Chrome (HTML5):

Image

@Danielku15 Danielku15 self-assigned this Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant