Update some TODO comments and other cleanup.

This commit is contained in:
Brian J. Burg 2012-11-12 14:57:39 -08:00
parent b62537883a
commit ad353c3161
3 changed files with 13 additions and 31 deletions

View file

@ -35,10 +35,10 @@ pub trait FontHandleMethods {
fn get_table_for_tag(FontTableTag) -> Option<~[u8]>; fn get_table_for_tag(FontTableTag) -> Option<~[u8]>;
} }
// TODO: `new` should be part of trait FontHandleMethods
// TODO(Issue #163): this is a workaround for static methods and // TODO(Issue #163): this is a workaround for static methods and
// typedefs not working well together. It should be removed. // typedefs not working well together. It should be removed.
//
// `new` should be part of trait FontHandleMethods.
impl FontHandle { impl FontHandle {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
@ -82,7 +82,7 @@ struct FontMetrics {
max_advance: Au max_advance: Au
} }
// TODO: use enum from CSS bindings // TODO(Issue #200): use enum from CSS bindings for 'font-weight'
enum CSSFontWeight { enum CSSFontWeight {
FontWeight100, FontWeight100,
FontWeight200, FontWeight200,
@ -105,10 +105,10 @@ pub impl CSSFontWeight {
} }
} }
// TODO: eventually this will be split into the specified and used // TODO(Issue #179): eventually this will be split into the specified
// font styles. specified contains uninterpreted CSS font property // and used font styles. specified contains uninterpreted CSS font
// values, while 'used' is attached to gfx::Font to descript the // property values, while 'used' is attached to gfx::Font to descript
// instance's properties. // the instance's properties.
// //
// For now, the cases are differentiated with a typedef // For now, the cases are differentiated with a typedef
pub struct FontStyle { pub struct FontStyle {
@ -117,7 +117,7 @@ pub struct FontStyle {
italic: bool, italic: bool,
oblique: bool, oblique: bool,
families: ~str, families: ~str,
// TODO: font-stretch, text-decoration, font-variant, size-adjust // TODO(Issue #198): font-stretch, text-decoration, font-variant, size-adjust
} }
// TODO(Issue #181): use deriving for trivial cmp::Eq implementations // TODO(Issue #181): use deriving for trivial cmp::Eq implementations
@ -137,7 +137,7 @@ pub impl FontStyle : cmp::Eq {
pub type SpecifiedFontStyle = FontStyle; pub type SpecifiedFontStyle = FontStyle;
pub type UsedFontStyle = FontStyle; pub type UsedFontStyle = FontStyle;
// TODO: move me to layout // FIXME: move me to layout
struct ResolvedFont { struct ResolvedFont {
group: @FontGroup, group: @FontGroup,
style: SpecifiedFontStyle, style: SpecifiedFontStyle,
@ -339,20 +339,6 @@ impl Font {
self.azure_font = Some(azure_scaled_font); self.azure_font = Some(azure_scaled_font);
azure_scaled_font azure_scaled_font
/*
// TODO: these cairo-related things should be in rust-cairo.
// creating a cairo font/face from a native font resource
// should be part of the NativeFont API, not exposed here.
#[cfg(target_os = "linux")]
fn get_cairo_face(font: &Font) -> *cairo_font_face_t {
use cairo::cairo_ft::bindgen::{cairo_ft_font_face_create_for_ft_face};
let ftface = font.handle.face;
let cface = cairo_ft_font_face_create_for_ft_face(ftface, 0 as c_int);
// FIXME: error handling
return cface;
}
*/
} }
} }
@ -425,7 +411,7 @@ pub impl Font : FontMethods {
mNumGlyphs: azglyph_buf_len as uint32_t mNumGlyphs: azglyph_buf_len as uint32_t
}}; }};
// TODO: this call needs to move into azure_hl.rs // TODO(Issue #64): this call needs to move into azure_hl.rs
AzDrawTargetFillGlyphs(target.azure_draw_target, AzDrawTargetFillGlyphs(target.azure_draw_target,
azfont, azfont,
ptr::to_unsafe_ptr(&glyphbuf), ptr::to_unsafe_ptr(&glyphbuf),
@ -438,7 +424,7 @@ pub impl Font : FontMethods {
//assert range.is_valid_for_string(run.text); //assert range.is_valid_for_string(run.text);
//debug!("measuring text range '%s'", run.text.substr(range.begin(), range.length())); //debug!("measuring text range '%s'", run.text.substr(range.begin(), range.length()));
// TODO: alter advance direction for RTL // TODO(Issue #199): alter advance direction for RTL
// TODO(Issue #98): using inter-char and inter-word spacing settings when measuring text // TODO(Issue #98): using inter-char and inter-word spacing settings when measuring text
let mut advance = Au(0); let mut advance = Au(0);
for run.glyphs.iter_glyphs_for_range(range) |_i, glyph| { for run.glyphs.iter_glyphs_for_range(range) |_i, glyph| {

View file

@ -166,7 +166,7 @@ pub impl QuartzFontHandle : FontHandleMethods {
let metrics = FontMetrics { let metrics = FontMetrics {
underline_size: Au::from_pt(self.ctfont.underline_thickness() as float), underline_size: Au::from_pt(self.ctfont.underline_thickness() as float),
// TODO: underline metrics are not reliable. Have to pull out of font table directly. // TODO(Issue #201): underline metrics are not reliable. Have to pull out of font table directly.
// see also: https://bugs.webkit.org/show_bug.cgi?id=16768 // see also: https://bugs.webkit.org/show_bug.cgi?id=16768
// see also: https://bugreports.qt-project.org/browse/QTBUG-13364 // see also: https://bugreports.qt-project.org/browse/QTBUG-13364
underline_offset: Au::from_pt(self.ctfont.underline_position() as float), underline_offset: Au::from_pt(self.ctfont.underline_position() as float),

View file

@ -102,10 +102,6 @@ pub impl HarfbuzzShaper {
*/ */
pub fn shape_text(text: &str, glyphs: &GlyphStore) { pub fn shape_text(text: &str, glyphs: &GlyphStore) {
debug!("shaping text '%s'", text); debug!("shaping text '%s'", text);
// TODO(Issue #94): harfbuzz fonts and faces should be cached on the
// Shaper object, which is owned by the Font instance.
let hb_buffer: *hb_buffer_t = hb_buffer_create(); let hb_buffer: *hb_buffer_t = hb_buffer_create();
hb_buffer_set_direction(hb_buffer, HB_DIRECTION_LTR); hb_buffer_set_direction(hb_buffer, HB_DIRECTION_LTR);
@ -140,7 +136,7 @@ pub impl HarfbuzzShaper {
Au::from_frac_px(HarfbuzzShaper::fixed_to_float(y)))) Au::from_frac_px(HarfbuzzShaper::fixed_to_float(y))))
}; };
// TODO: convert pos.y_advance into offset adjustment // TODO: convert pos.y_advance into offset adjustment
// TODO: handle multiple glyphs per char, ligatures, etc. // TODO(Issue #93, #95): handle multiple glyphs per char, ligatures, etc.
// NB. this debug statement is commented out, as it must be checked for every shaped char. // NB. this debug statement is commented out, as it must be checked for every shaped char.
//debug!("glyph %?: index %?, advance %?, offset %?", i, codepoint, advance, offset); //debug!("glyph %?: index %?, advance %?, offset %?", i, codepoint, advance, offset);