-
Notifications
You must be signed in to change notification settings - Fork 7
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 Core Text on macOS, remove runtime dependencies for linux release binary #18
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7sDream
force-pushed
the
feature/use-core-text-on-macOS
branch
from
July 26, 2020 09:14
c154018
to
b2d966b
Compare
Close due to I decide to use pure Rust, multi-platform crates to deal with font loading and renderering, not stick in platform-native solution. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hope issue #10 will disappear after finish this.
This PR need two part of work:
1. For macOS: Use Core Text API to match and render font
Due to servo-fontconfig-sys do not compile static library itselfs on macOS.(servo/libfontconfig#53)
TODO List for this goal:
Cow
to support owned string typefigure out how to get font face index(opend question in Apple Developer Forum)Now the list font and preview in browser should works fine in macOS without fontconfig installed.
freetype-sys support static link, so manual install from brew is not required too.
The only missing part is: freetype needs index to load font from file, but Core Text API seems do not provide this attribute, So tui preview not work for now.
Maybe we need adjust render logic to support Core Text Glyph Renderer too...... I'm not sure for now. I will pause work on this part before I figure out how to get index or have enough time to do a renderer refactor.
2020/05/31: I decide to use Core Text as Render Engine in macOS.
I just recently made a abstract layer to support different engines and adapted FreeType to this layer, it works well. I think I will implement Core Text Render logic in next weekends.
2. For Linux: Static link to fontconfig and freetype
TODO List for this goal:
Now this goal works well by using
deps' git master version andmy patched fork.But I think we need to wait for upstream merge/publish those change and upgrade deps to that official version to make a stable release.