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 fallout from SimpleGraphic upgrade with wider Unicode support #7586

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Commits on Jul 8, 2024

  1. fix: enable Unicode separators and caret motions

    As the runtime is going to support Unicode installation locations and
    build directories, some UTF-8 text is going to reach the Lua side of
    the project. This includes the script path, the user path, any paths
    yielded from file searches and also imported character names from
    accounts.
    
    Care needs to be taken in many places where string operations are
    performed as no longer does a byte necessarily correspond to a single
    character and anything that truncates, reverses or otherwise slices
    strings could need an audit.
    
    This change fixes cursor movement in `EditControl`s with the arrow keys
    as those historically used string matching and byte offsets. It also
    ensures that the use of arbitrary Unicode codepoints as decimal and
    thousands separators works correctly as the previous code used unaware
    reversing and slicing.
    zao committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    ad29ac0 View commit details
    Browse the repository at this point in the history
  2. fix: avoid using zero-height font size in trade UI

    Historical UI code uses empty text controls with invalid font sizes as anchors for other UI as that used to be benign with older font technology. While the runtime should be hardened against such use, this replaces the controls with more appropriate base types to better communicate intent.
    zao committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    0f8a922 View commit details
    Browse the repository at this point in the history
  3. fix: turn update paths relative for wide installs

    The updater is a fixed piece of older code that uses a Lua runtime that
    only handles paths that are representable in the user's text codepage.
    
    As the software may be installed in a location that cannot be expressed
    in that way, to mitigate the problem we turn all the paths in the
    update op-files into relative paths. That way as long as we never use
    exotic codepoints in our own paths it should be able to apply them
    cleanly and restart Path of Building afterward with a relative path.
    
    The updater executable can ironically enough not be updated at all with
    the related type of runtime hacks we introduced in SimpleGraphic as the
    updater deadlocks in updating itself. We have to work around its
    shortcomings in how we produce the op-files and possibly the update
    application script that runs under that limited runtime.
    zao committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    ed92e96 View commit details
    Browse the repository at this point in the history
  4. fix: convert GIFs masquerading as PNG to PNG

    Upon removing support for several file formats like GIF and BLP from the
    SimpleGraphic runtime, we noticed that there were some assets that had
    incorrect file extensions and loaded only thanks to file format
    detection ignoring extensions.
    
    As the actual file format loader for GIF was removed, these stealth GIFs
    are now losslessly converted to PNG.
    zao committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    7ab6a81 View commit details
    Browse the repository at this point in the history
  5. feat: replace bitmap fonts with vector fonts

    As all code to use bitmaps fonts is gone from the runtime, this
    introduces a basic set of main and fallback fonts to render text once
    again, this time with the ability to show Unicode.
    zao committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    94c8b69 View commit details
    Browse the repository at this point in the history