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

Fix DirectWrite typographic bounds calculation #91

Closed
wants to merge 1 commit into from

Conversation

@idursun
Copy link
Contributor

idursun commented Jul 25, 2019

Fixes #85

  • Reverted back to raster_bounds calculation to use Loader::raster_bounds calculation. This aligns raster_bounds with the rest of the loaders.
  • Fixed miscalculation of width and height in the DirectWrite::typographic_bounds. Bearings were being subtracted instead of being added.
$ cargo run --example render-glyph ArialMT { 32
glyph 94:

            ▓▓██████
          ██████████
        ▒▒████▒▒
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ████▓▓
        ████▒▒
      ▒▒████▒▒
    ▒▒████▓▓
░░████████
░░████▒▒
░░████████
    ▒▒████▓▓
      ▒▒████▒▒
      ░░████▒▒
        ████▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▓▓██▓▓
        ▒▒████▒▒
          ██████████
            ▓▓██████
@idursun idursun changed the title Fix DriectWrite typographic bounds calculation Fix DirectWrite typographic bounds calculation Jul 25, 2019
@idursun
Copy link
Contributor Author

idursun commented Jul 25, 2019

Test failed. Working on it.

@idursun idursun closed this Jul 25, 2019
@idursun idursun deleted the idursun:fix-dwrite-typographic-bounds branch Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant
You can’t perform that action at this time.