Minimal Win32 font platform implementation.

This uses a (very simple) Win32 API call to enumerate font
families available, and load them as byte buffers.

The font rasterization itself is done by freetype.

This gets Servo + WR + Windows working, but should be improved
by adding a proper implementation that matches fonts correctly
and also uses DirectWrite (or GDI) to handle font rasterization.
This commit is contained in:
Glenn Watson 2016-10-04 16:49:56 +10:00
parent 19a5a30113
commit 0849607239
7 changed files with 195 additions and 13 deletions

View file

@ -33,14 +33,18 @@ extern crate bitflags;
#[cfg(target_os = "macos")] extern crate core_graphics;
#[cfg(target_os = "macos")] extern crate core_text;
// Windows-specific library dependencies
#[cfg(target_os = "windows")] extern crate gdi32;
#[cfg(target_os = "windows")] extern crate winapi;
extern crate euclid;
extern crate fnv;
// Platforms that use Freetype/Fontconfig library dependencies
#[cfg(any(target_os = "linux", target_os = "android", all(target_os = "windows", target_env = "gnu")))]
#[cfg(any(target_os = "linux", target_os = "android"))]
extern crate fontconfig;
extern crate fontsan;
#[cfg(any(target_os = "linux", target_os = "android", all(target_os = "windows", target_env = "gnu")))]
#[cfg(any(target_os = "linux", target_os = "android", target_os = "windows"))]
extern crate freetype;
extern crate gfx_traits;