NBHelp in Squeak (Re: [squeak-dev] Re: Why FFI is not included
with latest squeak ?)
Igor Stasenko
siguctua at gmail.com
Wed Aug 22 01:07:49 UTC 2012
On 22 August 2012 02:11, Levente Uzonyi <leves at elte.hu> wrote:
> On Wed, 22 Aug 2012, Igor Stasenko wrote:
>
>> On 22 August 2012 00:04, Levente Uzonyi <leves at elte.hu> wrote:
>>>
>>> On Tue, 21 Aug 2012, Igor Stasenko wrote:
>>>
>>>> On 21 August 2012 23:20, dimitris chloupis <thekilon at yahoo.co.uk> wrote:
>>>>>
>>>>>
>>>>> Ah thank you , I had version 1 and now version 4 is installed together
>>>>> with
>>>>> all dependencies. Any idea how I use NB-help ?
>>>>>
>>>>
>>>> i don't know how you can do it in squeak image, in pharo image just
>>>> open help browser
>>>
>>>
>>>
>>> It uses too many "pharoisms", so it won't work in Squeak out of the box:
>>> - Gofer
>>> - LogicalFont
>>> - StandardFonts
>>> - pragma-based "registration" for HelpSystem
>>>
>>> The first can be loaded, the lines containing the next two can be
>>> replaced
>>> with "TextStyle defaultFont" and then you can open the HelpBrowser with:
>>> HelpBrowser openOn: NBHelp asHelpTopic.
>>>
>>> Btw, green text for source code doesn't look very nice and it would be
>>> better to use the Metacello API to load PP.
>>>
>>
>> I never tried it on squeak, so sure thing it may not work.
>
>
> Sure.
>
>
>> I have two questions:
>> - why LogicalFont considered pharoism?
>> (StandardFonts is, but LogicalFont?)
>
>
> Because it doesn't exist in Squeak.
>
Ah, ok i checked.. it is part of freetype.
This is strange, i always assumed LogicalFont was always in base fonts
package :)
I was using
TextStyle defaultFont before logical font:
headingStyle: level
| size |
size := self defaultFont height.
size := size *
( #(
2.0
1.5
1.4
1.25
1.0
) at: level ).
^ TextFontReference toFont: (
TextStyle default fontOfSize: size
)
The problem is that #fontOfSize using stupid fontArray which works
well for strike fonts (since you have limited set of sizes for font),
while for truetype fonts its size is always =1
and it always answers the font of very same size, depite that truetype
fonts can be sized to any size almost effortlessly.. so this makes
headings look like regular text :(
Maybe it is pharo bug needs to be fixed..
But the font API is very obscure and unfriendly..
--
Best regards,
Igor Stasenko.
More information about the Squeak-dev
mailing list
|