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

Eliminate ICU for OSX #6949

Merged
merged 4 commits into from Dec 8, 2018
Merged

Eliminate ICU for OSX #6949

merged 4 commits into from Dec 8, 2018

Conversation

@michicc
Copy link
Member

michicc commented Oct 28, 2018

This PR provides native OSX implementations for string sorting, caret handling, and text layout. While it is still possible to use ICU for these on OSX, the default build will not depend on it anymore.

src/fontcache.cpp Outdated Show resolved Hide resolved
@michicc michicc force-pushed the michicc:pr/osx_icu branch 2 times, most recently from 339aa77 to ab9d28c Oct 28, 2018
src/fontcache.cpp Outdated Show resolved Hide resolved
src/gfx_layout.cpp Outdated Show resolved Hide resolved
src/os/macosx/string_osx.cpp Outdated Show resolved Hide resolved
config.lib Outdated Show resolved Hide resolved
@nielsmh nielsmh added this to Wanted features in Release 1.9.0 Oct 31, 2018
@michicc michicc force-pushed the michicc:pr/osx_icu branch from ab9d28c to e60baae Nov 3, 2018
@michicc michicc requested a review from andythenorth Nov 17, 2018
src/os/macosx/string_osx.cpp Outdated Show resolved Hide resolved
CFRelease(cf1);
CFRelease(cf2);

return (int)res + 2;

This comment has been minimized.

Copy link
@LordAro

LordAro Nov 25, 2018

Member

given the only usage of this is to just do -2 on the result again, why not make the actual return value consistent with what people expect from a sorting function (-1, 0, 1)? Seems to me like the supported check should be done elsewhere

This comment has been minimized.

Copy link
@LordAro

LordAro Nov 25, 2018

Member

Oh, OTTDStringCompare does the same. bleh.

This comment has been minimized.

Copy link
@michicc

michicc Nov 25, 2018

Author Member

The supported check is platform-specific, the call site is not. As such, we need a value for failed as well.

@michicc michicc force-pushed the michicc:pr/osx_icu branch from e60baae to 9fdad55 Nov 25, 2018
By default, the native API will be used instead of ICU, but if ICU is
forced in using configure, it will take precedence.
@michicc michicc force-pushed the michicc:pr/osx_icu branch from 9fdad55 to 6691b03 Nov 25, 2018
Copy link
Contributor

andythenorth left a comment

Tested on macOS 10.13.6. Can't see any issues.

  • tested font display, list sorting and text caret behaviour
  • tested roman (original sprite font), left-to-right

Also tested

  • Arabic (Egypt) right-to-left with a system font
  • Korean, left-to-right with a system font
    No obvious issues, but I don't know what's expected behaviour there.
@michicc michicc merged commit 32ce1ce into OpenTTD:master Dec 8, 2018
6 checks passed
6 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
openttd/commit-checker The commit looks good
Details
openttd/linux-amd64-clang-3.8 The commit looks good
Details
openttd/linux-amd64-gcc-6 The commit looks good
Details
openttd/linux-i386-gcc-6 The commit looks good
Details
openttd/osx-10.9 The commit looks good
Details
Release 1.9.0 automation moved this from Wanted features to Done Dec 8, 2018
@michicc michicc deleted the michicc:pr/osx_icu branch Dec 8, 2018
@LordAro LordAro removed this from Done in Release 1.9.0 Jan 23, 2019
@LordAro LordAro added this to the 1.9.0 milestone Jan 23, 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.

None yet

4 participants
You can’t perform that action at this time.