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

(Do not merge) Use Piston's freetype-sys #307

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -25,7 +25,7 @@ time = "0.1"
webrender_traits = {git = "https://github.com/servo/webrender_traits", default-features = false}

[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "windows"))'.dependencies]
freetype = {git = "https://github.com/servo/rust-freetype"}
freetype-sys = "0.4.0"

[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = ">=0.2, <0.4"
@@ -54,8 +54,8 @@ extern crate core_graphics;
#[cfg(target_os="macos")]
extern crate core_text;

#[cfg(not(target_os="macos"))]
extern crate freetype;
#[cfg(any(target_os = "android", target_os = "linux", target_os = "windows"))]
extern crate freetype_sys;

extern crate app_units;
extern crate euclid;
@@ -5,12 +5,11 @@
use app_units::Au;
use webrender_traits::{FontKey, NativeFontHandle};

use freetype::freetype::{FTErrorMethods, FT_PIXEL_MODE_GRAY, FT_PIXEL_MODE_MONO};
use freetype::freetype::{FT_Done_FreeType, FT_LOAD_RENDER, FT_LOAD_MONOCHROME};
use freetype::freetype::{FT_Library, FT_Set_Char_Size};
use freetype::freetype::{FT_Face, FT_Long, FT_UInt, FT_F26Dot6};
use freetype::freetype::{FT_Init_FreeType, FT_Load_Glyph};
use freetype::freetype::{FT_New_Memory_Face, FT_GlyphSlot};
use freetype_sys::{FT_Done_FreeType, FT_F26Dot6, FT_Face, FT_GlyphSlot};
use freetype_sys::{FT_Init_FreeType, FT_Library, FT_Load_Glyph};
use freetype_sys::{FT_LOAD_MONOCHROME, FT_LOAD_RENDER, FT_Long};
use freetype_sys::{FT_New_Memory_Face, FT_PIXEL_MODE_GRAY, FT_PIXEL_MODE_MONO};
use freetype_sys::{FT_Set_Char_Size, FT_UInt, FTErrorMethods};

use std::{mem, ptr, slice};
use std::collections::HashMap;
@@ -237,7 +237,7 @@ impl RenderBackend {
ApiMsg::TranslatePointToLayerSpace(point, tx) => {
// First, find the specific layer that contains the point.
let point = point / self.device_pixel_ratio;
if let (Some(root_pipeline_id), Some(root_scroll_layer_id)) =
if let (Some(_), Some(root_scroll_layer_id)) =
(self.scene.root_pipeline_id,
self.frame.root_scroll_layer_id) {
if let Some(scroll_layer_id) =
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.