Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Installing a TrueType font as a StrikeFont
Last updated at 4:38 pm UTC on 16 January 2006
TTFontReader installTTF: aPathAndFileNameOfaTTFfile asTextStyle: #FontName sizes: #(12 14 16 18 20 24)
will install a truetype font from your hard-drive converted to StrikeFont.



Under 3.6g (VM and image) the problem described by Kris below still exists... at least for the Bitstream Vera fonts. The functionality of the class-side methods in TTFontReader seem to have been replaced by class-side methods in TTCFont which works fine for these fonts. Also TTCFont acts as a service to the FileList so you can simply select a TrueTypeFont (.ttf file) and the buttons (and menu?) will have an option to install the font. Maybe TTFontReader needs to go away? Is anyone maintaining it? 10/1/2003 David Shaffer



Subject: "Fixed" Fonts ...
From: Kris Gybels
Date: Mon, 4 Feb 2002 21:24:15 +0100

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??



A WINDOWS only solution which gives better results see email by Andreas Raab
http://groups.yahoo.com/group/squeak/message/39510. The solution described there uses a DLL.

http://aspn.activestate.com/ASPN/Mail/Message/squeak/1014124