Use Core Text on macOS, remove runtime dependencies for linux release binary #18
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.