forked from servo/font-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sync all changes from servo/font-kit up to version 0.12.0 #13
Merged
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
The code here just trusted the value to always to be valid, but since this may be an arbitrary font, the value may not always be valid. In my case the `usWidthClass` I'm seeing has the value 500, probably the `usWeightClass` accidentally being assigned to the `usWidthClass`.
Fix panic when parsing invalid `usWidthClass` The code here just trusted the value to always to be valid, but since this may be an arbitrary font, the value may not always be valid. In my case the `usWidthClass` I'm seeing has the value 500, probably the `usWeightClass` accidentally being assigned to the `usWidthClass`.
Created new struct `BlitRgb24ToRgba32` implementing `Blit` to facilitate the conversion. Fixes servo#190.
To get rid of a compiler warning
Fix panic when converting from Rgb24 to Rgba32 Created new struct `BlitRgb24ToRgba32` implementing `Blit` to facilitate the conversion. Fixes servo#190.
instead of servo-fontconfig servo-fontconfig statically links a vendored fontconfig library if fontconfig is not found by pkgconfig. Using a vendored fontconfig library instead of the system fontconfig library doesn't actually work well though: slint-ui/slint#88 Building a vendored copy of fontconfig is also problematic because fontconfig has a lot of C dependencies, which makes it difficult to cross compile the vendored copy of fontconfig: $ pkg-config fontconfig --static --libs -lfontconfig -lfreetype -lz -lbz2 -lpng16 -lm -lm -lz -lharfbuzz -lm -lglib-2.0 -lm -lpcre -lsysprof-capture-4 -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lxml2 -lz -llzma -lm Instead of using a vendored copy, with yeslogic/fontconfig-rs#12 yeslogic-fontconfig-sys will have a Cargo feature to dlopen fontconfig at runtime instead of linking it at build time. This is exposed in font-kit with the new source-fontconfig-dlopen feature, which is disabled by default. The feature can be enabled by setting the RUST_FONTCONFIG_DLOPEN environment variable to avoid needing to propagate the Cargo feature all the way through downstream Cargo.toml's. This feature makes it considerably easier to cross compile by avoiding the need to cross compile fontconfig and all its dependencies.
switch to yeslogic-fontconfig-sys instead of servo-fontconfig servo-fontconfig statically links a vendored fontconfig library if fontconfig is not found by pkgconfig. Using a vendored fontconfig library instead of the system fontconfig library doesn't actually work well though: slint-ui/slint#88 Building a vendored copy of fontconfig is also problematic because fontconfig has a lot of C dependencies, which makes it difficult to cross compile the vendored copy of fontconfig: ``` $ pkg-config fontconfig --static --libs -lfontconfig -lfreetype -lz -lbz2 -lpng16 -lm -lm -lz -lharfbuzz -lm -lglib-2.0 -lm -lpcre -lsysprof-capture-4 -pthread -lgraphite2 -lbrotlidec -lbrotlicommon -lxml2 -lz -llzma -lm ``` Instead of using a vendored copy, with yeslogic/fontconfig-rs#12 yeslogic-fontconfig-sys will have a Cargo feature to dlopen fontconfig at runtime instead of linking it at build time. This is exposed in font-kit with the new source-fontconfig-dlopen feature, which is disabled by default. This feature makes it considerably easier to cross compile by avoiding the need to cross compile fontconfig and all its dependencies.
…ts, r=jdm fix compilation errors in tests With this command line: ``` cargo test --features="source,loader-freetype-default" ``` Then these errors are produced: ``` error[E0428]: the name `get_vertically_hinted_glyph_outline` is defined multiple times --> tests/tests.rs:270:1 | 226 | pub fn get_vertically_hinted_glyph_outline() { | -------------------------------------------- previous definition of the value `get_vertically_hinted_glyph_outline` here ... 270 | pub fn get_vertically_hinted_glyph_outline() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `get_vertically_hinted_glyph_outline` redefined here | = note: `get_vertically_hinted_glyph_outline` must be defined only once in the value namespace of this module error[E0428]: the name `get_fully_hinted_glyph_outline` is defined multiple times --> tests/tests.rs:360:1 | 316 | pub fn get_fully_hinted_glyph_outline() { | --------------------------------------- previous definition of the value `get_fully_hinted_glyph_outline` here ... 360 | pub fn get_fully_hinted_glyph_outline() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `get_fully_hinted_glyph_outline` redefined here | = note: `get_fully_hinted_glyph_outline` must be defined only once in the value namespace of this module ``` This PR fixes those by adding a conditional config, so that the two compiles are exclusive to each other.
Add FsSource::in_path Related to: servo#198
Derive Hash for `FamilyName` and `Style` I needed this for caching implementation and felt it easier to use font-kit's types instead of converting them into my own.
Switch to GitHub Actions badge and use SPDX license format None
Bump prettytable to 0.10 Fixes some nightly builds and gets rid of unsafe API
Bail out from rendering when bitmap_buffer is null
* Enable the GitHub merge queue * Only run the push workflow on master * Fix the Mac runner selection
According to https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library > Library objects are normally created by `FT_Init_FreeType`, and destroyed with `FT_Done_FreeType`.
vorporeal
approved these changes
Dec 15, 2023
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.
Mainly doing this for:
servo-fontconfig-sys
toyeslogic-fontconfig-sys
[email protected]
I made this diff that syncs all the other changes rather than cherry-picking the ones we want b/c I wanted to avoid us messing up the history in case we wanted future changes. That said, if we need to, we could probably sync just the changes in those two commits.