[DOC][3.8g][Morphic][m17n] Unicode True Type font example (was Re: internationalisation of squeak: Bitmap font SofijaUC)

Hannes Hirzel hirzel at spw.unizh.ch
Fri Dec 17 20:17:52 UTC 2004


Yoshiki,


Thank you for your answer which shed additional light on the issue.

>>>------------------------
>>>First, this wasn't the problem I introduced^^;
>>>
>   The argument:
> 
> #(12, 18, 24, 36, 60)
> 
> is in wrong syntax.  You don't need $, in a literal array.

Sorry, Yes the correct syntax is
#(12 18 24 36 60)


> 
>>But I would like to have as well the point sizes 48, 60, 72 and 90. What
>>do I have to do?
> 
> 
>   There are two different ways to bring a TrueType font into the
> system.  The one you used in the bug report is the older one, but I
> don't know if it is tested in these days.  At least, the line:
> 
> TTCFontReader encodingTag: Latin1Environment leadingChar.

OK, this is not necessary for loading fonts.


>>>Third, if you define #pixelSize: at StrikeFont that is identical to the TTCFont one,
>>>
>>>pixelSize: aNumber
>>>    "Make sure that we don't return a Fraction"
>>>    self pointSize: (TextStyle pixelsToPoints: aNumber) rounded.
>>>
>>>it runs.
Yes, this prevents the walkback when evalutating, however it does not 
give the right point sizes in the font menu.

Which is the new (recommended way) to bring in TTF fonts into 3.8gamma?
Code snippet 1 (see below) works fine; but what would you recommend 
instead of (2), where I want specific font sizes to be calculated.
(1) give a bunch of default font sizes.

The attached screenshot shows the result so far.


Regards
Hannes





" -- 1 --"
TTCFontSet newTextStyleFromTTFile: 'C:\WINDOWS\Fonts\Verdana.TTF'.

" -- 2 -- does not yet fully work; gives wrong point sizes in font 
selection menu"
TTFontReader
		installTTF: 'C:\WINDOWS\Fonts\Verdana.TTF'
		asTextStyle: #MultiVerdana
		sizes: #(12 18 24 36 60 72 90)

" -- 3 -- necessary method addition for 2 to work"
StrikeFont   "<m-b>"
"accessing"
pixelSize: aNumber
     "Make sure that we don't return a Fraction"
     self pointSize: (TextStyle pixelsToPoints: aNumber) rounded.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TTF-UnicodeCharacterExamples.PNG
Type: image/png
Size: 59036 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20041217/d2345b88/TTF-UnicodeCharacterExamples.png


More information about the Squeak-dev mailing list