Tuesday, October 30, 2007

Camino Build (part 3)

Got a Camino Build now. Needed to look here and talk to a couple of guys on the #camino IRC channel.

Camino Build (part 2)

Nuff Said

/Users/coren/mozilla/OBJ_DIRS/debug/cam/camino/IBPalette/src/CaminoViewsPalette_Prefix.pch:7:50: error: InterfaceBuilder/InterfaceBuilder.h: No such file or directory
make[5]: *** [libs] Error 1
make[4]: *** [libs] Error 2
make[3]: *** [libs_tier_app] Error 2
make[2]: *** [tier_app] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2

real 31m28.681s
user 23m43.170s
sys 4m26.792s

Camino Build (part 1)

I followed devmo to build camino to see what its like...

NOTE: ac_add_options --enable-default-toolkit=cairo-cocoa

Because I am masochistic I decided to build and optimized version and a debug version at the same time.

See part 2 for results.

Saturday, October 27, 2007

Friday, October 26, 2007

Grrr, Im a Leopard (A Review) : I met Ed

This is the first thing I do with Leopard... Be good kitty.

After the Free and Open Source Symposium, I headed over to Data Integrity and reserved a copy of Mac OS X.5. I walked back to the school, talked with a fellow Ed.

Ed had made a claim during one of the talks, that certain Canadian Schoolboards have decided never to install any non-ms software on the computers. Im no longer a linux junkie... after all I put down my $130 for my happy new kitten ... but I felt truly scared that SCHOOLS ban a hugely useful teaching tool.

Thats one of my views on Linux... its a terrific teaching tool. Linux is also great for running as a server, but I digress.

Ed and I talked for 30 minutes or so, he made me aware of certain tactics of politicians to carve deals with Microsoft. Thanks Ed, you made me more aware today.

After our chat, I run over and wait in the huge lineup of 7 ppl for X.5. I ran home (or rather took the bus)... and cleaned up my external drives, 1 Media Drive, 1 portable drive containing my old schoolwork and music for tradesies. Ok lets being

remembers as if it ware 3 hours ago, warning stream of consciousness (SOC)

Pop in the disk, click the "Install Mac OSX" reboot.....
Ok, lets go... ok boot up, great. Ok a screen asking me if I speak english, yes I do... next... ok eula, I read a bit I grep for "soul" "all worldly possessions" and "Agreeing to this document ensures that you and the Lord of Darkness have entered into an unholy pact"... None of those show up... so I guess the eula is safe ... ok accept ... Choose your drive to install ... wait, my drives aren't listed.... WTF... oh no my os X is defective.... lets reboot and try again... ok boot, language, drivers, NONE.... oh no oh no... wait whats this... stuff in the upper lefthand corner .. ok disk utility, hey look, there is my old macintosh HD... lets verify it, ok verified, hey look, now it says "mounted" ... I used to be a linux nerd, it means that now I can use the drive. ok back to the install window, right on my drive is there... ok click continue.... omg its gonna take 3.5h... oh well.... do do do do de de de de lalalalala, ok 2 hours later its done... OH GOODIE. oh, fancy new background... maybe I want to keep this... no there is my claude lorrain background...

Ok enough SOC.

End result to here, everything is kinda the same, the top bar is now transparent, and UI for applications is a wee bit darker, but its mostly the same. All my settings have remained, terminal.app has the same fonts, and transparency, Minefield.app even remembered all my open web pages.

All my settings have remained: 1
I can ssh into my server : 1
I can run Minefield: 1
I can update my mozilla source code: 1
I can build the mozilla source code: _0_

configure: error: installation or configuration problem: C compiler cannot create executables.
oh *$#@

I should install Xcode now...

... a little while later

Ok lets try to compile again... running... running ... success pffew

Nicer things
Finder looks like iTunes now... its actually impressive, the new view option.
I can sort in the normal details view for finder... much more usable. Finder is much improved
Spaces is very much a needed improvement.
I love that iCal shows the right date instead of July 17 now.
the limited time I played with safari let me know its really fast and has some sort of 'cut' feature, where I can add things to my dashboard.... it did my gcal!
vertical external monitor now works (tiger would system halt)

had trouble connecting to my samba share.

Gonna try time machine soon.

FSOSS is over

FSOSS is done for another year. Talks today focused more on the social aspects of open source. There was a fun but ultimately pointless BOF discussion on what peoples views of open source are as they relate to democracy... along with a very good talk about how history relates to open source.

Now its time to install Leopard.

Thursday, October 25, 2007

What Mozilla Does to me Mommy!

Its poetry time

What Mozilla Does to me, a Haiku

I cannot sleep now
paths through code I must tread deep
too much fun for me

And for my Macbook Pro

Be bloody, bold, and resolute;
laugh,to scorn The power of Win.
for none of woman born shall harm Macbook.

Be lion-mettled, proud; and take no care
Who alts, who shifts, or where conspirers delete:
Macbook shall never vanquish'd be
until Great Linux Usability to high quality hill
Shall come against he.

More Texty Thoughts: Soused at FSOSS

Today was FSOSS, and yes, I got a little soused at the end (thanks Zad). Dave introduced me to Stuart in the flesh, and he had some ideas for me towards my bug. I wanna get them down before I go to sleep.

1. he confirmed my visualization of mozilla text being something like a 16th century printing press. Mozilla arranges all the little blocks so its just right (I think of this as the layout stage)... and then slathers ink all over it and "presses" onto the screen.

2. he told me that mozilla/cairo for mac is already using atsui for all the layout stages, and that drawing ATSUI might not take that much of a performance hit.

3. he guessed that ATSUI just does synthesizing anyway, so synthesizing isn't as dirty a method as I think.

4. cairo was chosen and used as the gecko rendering backend because it supplies the opportunity to do cool things like full image scaling, rotation. AND it abstracts most of the multi-platform features (eg mac does one thing, bug windows doesn't do that thing... cairo allows both windows and mac to do a thing).

5. CoreText would be nice, but not necessarily worth the effort right now.

It was good to meet him. I got to get some good insight on the italics/bold bug, and I got to meet a Sharks fan (I didn't know they actually existed, aren't there only 3 teams in the NHL anyone likes... habs, leafs, sens).

What else happened at FSOSS you ask?

1. A talk by a Xen virtualization guy... made me understand why businesses would want to run vms.
2. Ben Smedberg from Mozilla who talked about reading code, why and how.
3. Fluid Project guy who talked about how his group was working with Blackboard like portal sites to make user interfaces more accessable/standard.
4. Bob Young from Lulu who talked about the eternal battle between good and evil.

More from the scene tomorrow.

Tuesday, October 23, 2007

Options for Text Processing

Prerequisite Knowledge:
ATSUI - Apple Type Services for Unicode Imaging.

Gecko 1.8 (used in ff2) uses Quickdraw for all it's text rendering needs.

Quickdraw is now deprecated.

Gecko 1.9 uses Cairo for it's text rendering needs... Cairo uses Quartz to draw, and has ATSUI to run/store all the measurements. Gecko itself uses ATSUI to store font information.

I hear rumours that CoreText will replace ATSUI in leopard, thus making ATSUI deprecated (or soon to be deprecated).


So the question is, what road should I take towards fixing the problem that:
"when a css style demands italic/bold etc. and no predefined font exists (thus we need to take an existing 'normal' font and make it italic/bold) the browser doesn't render the style properly"

Option 1: Fake it, synthesize the style.
Option 2: See if Quickdraw can be used for mac os <>= 10.5
Fix up cairo to do this (gulp! thats a lot of work)
Option 3: Work with Cairo so that it draws with ATSUI rather than quartz. From documentation I have read, ATSUI can play with quartz (performance issues?). Cairo already keeps the font information in ATSUI... so i expect that the difficulty will be < option 2.

Here is a comment inside the cairo of gecko 1.8 (gecko didn't use cairo... but I guess it included it for some reason)
// TODO - bold and italic text
// We could draw the text using ATSUI and get bold, italics
// etc. for free, but ATSUI does a lot of text layout work
// that we don't really need...

Wednesday, October 17, 2007

A Dirty Italics Hack

This patch will make fonts already acting properly for italics go to "SUPER ITALICS"

So if you have been following along, you'll know that italics aren't working for certain fonts. I have created a really dirty (like roll around in the mud dirty) hack... a little description as given on IRC

xrayon: just give me the dirtiest part
mullin: the dirty part is reading whether a font should be italic or not
mullin: so I do some casting where I shouldn't
mullin: so during init time I read whether the font should be italic, and I set a variable that is kept around until draw time
mullin: at draw time I retrieve that variable, if the variable is true
mullin: I shear all text glyphs a little bit
mullin: making them look italics

The Patch

Project Page

Wait. Oh My ! What have you done. I'm backwards you filthy furball

Hahaha... a patch which writes the fonts as if the top left corner is the bottom right, and vice versa. Run it, you'll find it funny too.

Learn about here

Its not All Italic

More evidence gathering. New patch to check out

Learn Here

Tuesday, October 16, 2007

The Akbar Attack!

Alright, so I've created a patch to mess with your browsers fonts... ALL of em.

This is part of the debugging process to see how fonts are made & displayed.

Left is a screeny

Apply Me Here

Holy *bleep* this is deeper than I thought

In my debugging I thought to myself. "mike, lets print the font names as they are rendered"... I print them off and I see "Times-Italic" and all the other fonts I am using. So I says to myself, why is the _Name_ of Times-Italic ? Shouldn't Italic just be a style applied to Times?

I open up Font Book.app, and I start looking through the fonts... Times-Italic is an actual font name... so I play around with my test cases and change Times to Lucida Grand and Helvetica, which do not have an entire font associated with italics...

Lo and behold, they do not render as italic in Minefield.... hmmm deeper... why are the fonts not applying style to a font rather than just picking up a premade style.

Notepad Entry

Just to be used by me as a notepad entry. I am testing out how I like using a blog instead of a pad of paper beside my computer.... (aka I dont expect you to read this, its not for your benefit its for me to noodle)

CompressedGlyph: gfxFont.h
* This class records the information associated with a character in the
* input string. It's optimized for the case where there is one glyph
* representing that character alone.

a gfxTextRun has an array of these things... hmmm maybe important

textRun->AddGlyphRun(font, 0); in gfxTextRunWordCache looks impressive.

wtf is this ?
static inline PRUint32
HashMix(PRUint32 aHash, PRUnichar aCh)
return (aHash >> 28) ^ (aHash << 4) ^ aCh;

To draw a string, (or rather a nsThebesFontMetrics) Make a gfxTextRun which has a GlyphRun. The gfxTextRun does other fun things with glyphs like SetCharacterGlyph which fills up the glyph array with a 'CompressedGlyph'

Ok like, So where am I?

Ok so what is the state of my project:

My task is to understand why certain fonts do not apply bold/italics properly to their glyphs on Mac OSX. My previous work has been about trying to understand what happens in rendering process and thus the initialization of gfxFonts. I've walked down to the cairo level of the initialization process attempting to follow how the style value of italics.

I am unsure on what ForEachFont(FindATSUFont, this); does, and is a Fallback something used when the precisely intended font is not available for some reason (donno why that would be though??)

"there may be situations in which ATSUI cannot draw a glyph with the assigned font because the font does not have the glyph in its repertoire." -

// Create the fallback structure
OSStatus status = ::ATSUCreateFontFallbacks(aFallbacks);

Tonights marathon task is to go through the glyph drawing process... I have a fishy feeling I am going to have to take notes on ATSUIFontID values that are going on during init and seeing how this value applys to drawing.

Monday, October 15, 2007

My first Extension

So I went in for surgery this morning, and got an extension to my ..... ohhh you want to know about my FIREFOX extension. Ok then

Click here

Saturday, October 13, 2007

Bugzilla Watching

I officially dislike the watching feature of bugzilla. Here is why

What I did is started watching two people on bugzilla; My friend from school Andrew, and the GFX guy Pavlov (Stuart). I setup a gmail filter so that all bugzilla email would go into it's own area. And then I let bugzilla do its thing.

A week and a half later I have 81 conversations in my inbox. Although I can see the subject of the email, I don't know who wrote the comments that spawned the bugzilla-daemon email, and when I open up the email, there is rarely any useful information.

I'd like the bugzilla subject line to show who caused the email to be sent to me (andrew, pavlov, or my selected bug). And I would like to have the option of setting rules that would state that only actual comments are to send emails (rather than status changes, or reports of bug duplicates).

Thursday, October 11, 2007

Patch Match Dash

The challenge of the first patch was on.  Here is my complete hack.

lsblakk describeds the task best here

Wednesday, October 10, 2007

More Fontyness

I've been looking through the cairo-atsui-font.c code. When I next pick up I need to find out what the ATSUFontID values for the different fonts are.

Thursday, October 4, 2007

A whirlwind font tour

So I started trying to understand how fonts work in firefox 3, I used MXR and xcode/breakpoints to determine that I may want to compare the code paths starting from nsThebesFontMetrics::DrawString.  Its a starting point.

Tuesday, October 2, 2007

Windows Debugging

I followed the instructions here


A few hickups but I finally got things going, and hit the breakpoint every time I scrolled the wheel.

Linked to: http://mikemoz.blogspot.com/2007/09/setting-up-debugging-with-xcode.html

Reproduction (no, not that you dirty!)

Ok, so its time to reproduce 365713. Just a test on Windows vs OS X. My Linux box is down for maintenance.

Step 0: Get an optimized build on both windows and OSX

Step 1: On windows box open up https://bugzilla.mozilla.org/attachment.cgi?id=249494 in IE7... starts the japanese font process.

Step 2: Reopen https://bugzilla.mozilla.org/attachment.cgi?id=249494 in IE7. Open in the windows trunk build. Open in the OSX trunk build.



Safari Mac


1. Get Linux build going
2. Learn debuging on Windows
3. Learn debugging on Linux
4. Compare the step-through traces of the three operating system builds.