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

DWriteCore returns shifted glyph indices in a glyph run #5024

Open
timeester3648 opened this issue Jan 13, 2025 · 0 comments
Open

DWriteCore returns shifted glyph indices in a glyph run #5024

timeester3648 opened this issue Jan 13, 2025 · 0 comments

Comments

@timeester3648
Copy link

Describe the bug

I have noticed that some fonts (not all) just give wrong glyph indices when passed to DrawGlyphRun in the DWRITE_GLYPH_RUN. For example when i use FreeType to check the index for space in the AppleStorm font I get the glyph index 1. When i check on FontDrop I also get the index as 1 as shown in the screenshot.

Image

Even when I ask DWriteCore itself to give me the glyph indices using GetGlyphIndices, it tells me space is glyph index 1. But when layed out it gives me 3. This results in situations like this, where with Open Sans it gives the correct result:

Image

but when I switch to the offending font, it shifts it 2 indices to the right:

Image

Steps to reproduce the bug

  1. Since i cannot attach font files, 1 font that definitely does not work is the AppleStorm font.
  2. Use that file to the retrieve some glyph indices using GetGlyphIndices, like space with codepoint 32.
  3. See that it returns glyph index 1 for space.
  4. Then layout text and see that the glyph index it has given (in this font) is 3.

Expected behavior

DWriteCore returns the correct glyph indices for the given codepoints. The same it also returns in GetGlyphIndices.

Screenshots

No response

NuGet package version

None

Packaging type

Unpackaged

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants