Add QuartzFontListHandle::get_available_families() stub, and update CF, CT, and IoSurface submodules.

This commit is contained in:
Brian J. Burg 2012-11-08 09:44:05 -08:00
parent 8329d282d4
commit 0f85164d13
4 changed files with 33 additions and 8 deletions

@ -1 +1 @@
Subproject commit d316f05c0081e9b208429cd19d84169e497e6191 Subproject commit 22ff767266abfeeab508da705a4a75c23a77a291

@ -1 +1 @@
Subproject commit 9119482c91527526b7d9aeae562d4ff48844722b Subproject commit 03050d5d816462582c4506e1fb6f507b5c6653bc

@ -1 +1 @@
Subproject commit ccef0dd637c45879f3b4d9bb0464b399fe14bd02 Subproject commit 8602b259882444aa468a4b98d387cd9818940e14

View file

@ -1,12 +1,37 @@
pub struct QuartzFontListHandle { extern mod core_foundation;
ctx: (), extern mod core_text;
drop { } use cf = core_foundation;
use cf::array::CFArray;
use ct = core_text;
use ct::font_collection::CTFontCollection;
use ct::font_descriptor::{CTFontDescriptor, CTFontDescriptorRef};
use gfx::font::FontFamily;
use dvec::DVec;
pub struct QuartzFontListHandle {
collection: CTFontCollection,
} }
pub impl QuartzFontListHandle { pub impl QuartzFontListHandle {
// this is a placeholder until CTFontCollection is bound here.
static pub fn new() -> QuartzFontListHandle { static pub fn new() -> QuartzFontListHandle {
QuartzFontListHandle { ctx: () } QuartzFontListHandle { collection: CTFontCollection::new() }
}
fn get_available_families(_fctx: FontContext) -> ~[@FontFamily] {
// TODO: make a hashtable from family name to DVec<FontEntry>
let descriptors : CFArray<CTFontDescriptorRef, CTFontDescriptor>;
descriptors = self.collection.get_descriptors();
for descriptors.each |desc: &CTFontDescriptor| {
// TODO: for each descriptor, make a FontEntry.
// TODO: append FontEntry to hashtable value
}
let families: DVec<@FontFamily> = DVec();
// TODO: iterate over (key,val) pairs and create FontFamily instances
return move dvec::unwrap(move families);
} }
} }