Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upwebrender fails to build with --default-features=false + features = "pathfinder" #2617
Comments
|
Well, it seems that freetype is still needed on Linux. The pathfinder feature really only works on macOS. So, I'd rather just update the version of freetype in the pathfinder repository. |
|
Even with https://github.com/pcwalton/pathfinder/pull/78 merged, I still can't get rid of the "no method named XXX" errors. But at least I don't get version conflicts anymore. |
|
I'll look into this. |
|
I know what the issue is. servo expects a |
|
Next, the signature for pub fn add_native_font(&mut self, font_key: &FK, handle: NativeFontHandle) -> Result<(), ()> { }instead of: pub fn add_native_font(&mut self, font_key: &FK, handle: CGFont) -> Result<(), ()> { }... because CgFont is only available on macOS. If you look closely, NativeFontHandle is defined (in webrender) as: // every other OS, except for windows
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NativeFontHandle {
pub pathname: String,
pub index: u32,
}
// macOS special case
#[cfg(target_os = "macos")]
#[derive(Clone)]
pub struct NativeFontHandle(pub CGFont);.. which means that NativeFontHandle is just a wrapper around |
|
The fix for this is pretty involved and required changes to both Pathfinder
and WebRender. I have work-in-progress branches that fix this pushed and
will be porting the changes to macOS before submitting.
…On Sun, Apr 8, 2018 at 3:58 AM, fschutt ***@***.***> wrote:
https://github.com/pcwalton/pathfinder/blob/fcfd157c702d5ca6cabb30c0239af2
d7308f3eb4/font-renderer/src/core_graphics.rs#L71-L79
Next, the signature for add_native_font should look like this:
pub fn add_native_font(&mut self, font_key: &FK, handle: NativeFontHandle) -> Result<(), ()> { }
instead of:
pub fn add_native_font(&mut self, font_key: &FK, handle: CGFont) -> Result<(), ()> { }
... because CgFont is only available on macOS. If you look closely,
NativeFontHandle is defined (in webrender) as:
// every other OS, except for windows
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NativeFontHandle {
pub pathname: String,
pub index: u32,
}
// macOS special case
#[cfg(target_os = "macos")]
#[derive(Clone)]
pub struct NativeFontHandle(pub CGFont);
.. which means that NativeFontHandle is just a wrapper around CGFont on
macOS. So, instead of accepting a CGFont, it's better to accept a
NativeFontHandle to keep the function signature consistent with the other
OS.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#2617 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJoyVlKpy-NeRTZUCkAruiDMo0tNVxxks5tme1SgaJpZM4TH2Pi>
.
|
Closes servo#2617.
Closes servo#2617.
Closes servo#2617.
Port the Pathfinder branch to Linux (FreeType). Closes #2617. r? @glennw <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2636) <!-- Reviewable:end -->
Since now both pathfinder and webrender link to freetype, this fails to build with:
So, my next course of action was to disable the default freetype feature (also note that with the migration to pathfinder, it shouldn't be a default feature anymore IMO):
Which fails to build with a few compile errors:
rustc 1.25 stable
Debian 9.4 (note: in the pathfinder repo, the
add_native_fontuses macOS Quartz fonts?)