"Fixed" Fonts ...

Kris Gybels kris.gybels at vub.ac.be
Mon Feb 4 20:24:15 UTC 2002


Hi all,

It seems my initial guess was right on why my converted truetype fonts 
look horrible. As I said in my earlier mail the letters are there but 
they are composed of alternating black and white pixels and the color of 
the text in those fonts can't be changed. Between parentheses I also 
suggested that the fonts may be represented in the wrong depth.

I took a quick look at the default TextStyles and my converted truetype 
font, the thing that immediately caught my eye was that indeed the 
default fonts had all 1 bit depth forms in them and my converted 
truetype font had 8 bit forms ...

I  then went for a bit of bug hunting and changed the first lines of 
this method ...

TTGlyph>>asFormWithScale: scale ascender: ascender descender: descender 
fgColor: fgColor bgColor: bgColor
	| form canvas |
	form _ Form extent: (advanceWidth @ (ascender - descender) * scale) 
rounded depth: 8.

to ...


TTGlyph>>asFormWithScale: scale ascender: ascender descender: descender 
fgColor: fgColor bgColor: bgColor
	| form canvas |
	form _ Form extent: (advanceWidth @ (ascender - descender) * scale) 
rounded depth: 1.

My font looks ok now!! :)

Well not really ok, but at least it's no longer composed of black and 
white pixels and I can change the color of the text!

Any ideas as to why this method was at was in the first place?? I'm 
guessing the 8 bit depth was intended to be used to support 
anti-aliasing (the font now really looks like anti-aliased text that was 
then converted to 1 bit depth :) ) ...

Anyone have any idea on what changes would be necessary to keep the 
fonts as 8 bit depth anti-aliased forms but correct the rendering of the 
fonts on screen??

S!




More information about the Squeak-dev mailing list