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

Use byte indices instead of char indices for text runs #10895

Merged
merged 4 commits into from Apr 29, 2016

Commits on Apr 28, 2016

  1. Don't assume the first glyph is part of the first char

    Shaper::save_glyph_results incorrectly starts its loop by setting glyph_span
    to a length of 1.  This means that the `if glyph_span.len() == 0` test in the
    inner loop will never succeed.
    
    Instead the glyph span should start out empty, and a glyph should be added only
    as the corresponding char is found.  For comparison, see the Gecko code this
    was ported from:
    
    https://hg.mozilla.org/mozilla-central/file/ab0044bf/gfx/thebes/gfxHarfBuzzShaper.cpp#l1682
    mbrubeck committed Apr 28, 2016
  2. Remove unneeded add_nonglyph_for_char_index

    This is a no-op, since a "non-glyph" is simply `GlyphEntry(0)`. This is the
    same as `GlyphEntry::initial()`, which all the entries are already initialized
    to.
    mbrubeck committed Apr 28, 2016
  3. Use byte indices instead of char indices for text runs

    Replace character indices with UTF-8 byte offsets throughout the code dealing
    with text shaping and breaking.  This eliminates a lot of complexity when
    converting from one to the other, and interoperates better with the rest of
    the Rust ecosystem.
    mbrubeck committed Apr 28, 2016
  4. Replace range::Range with std::ops::Range in script

    mbrubeck committed Apr 28, 2016
You can’t perform that action at this time.