How to use freetype?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use freetype?

Igor Stasenko
I feel a bit confused.

I want to do something as easy as:

font := Something fontByName: 'Arial'.

but the problem is that i cannot find anything like that in freetype.

There is
FreeTypeFontProvider fontFor: aLogicalFont familyName: familyName

but i puzzled, why it needs a logical font and why i should create it?

Is there a general way to programmatically say: give me font 'Arial' pt size 9,
or nil, if font cannot be found?

--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: How to use freetype?

Gary Chambers-4
Try

 LogicalFont
  familyName: 'Arial'
  pointSize: 24

Regards, Gary

----- Original Message -----
From: "Igor Stasenko" <[hidden email]>
To: "Pharo Development" <[hidden email]>
Sent: Monday, October 17, 2011 1:19 PM
Subject: [Pharo-project] How to use freetype?


>I feel a bit confused.
>
> I want to do something as easy as:
>
> font := Something fontByName: 'Arial'.
>
> but the problem is that i cannot find anything like that in freetype.
>
> There is
> FreeTypeFontProvider fontFor: aLogicalFont familyName: familyName
>
> but i puzzled, why it needs a logical font and why i should create it?
>
> Is there a general way to programmatically say: give me font 'Arial' pt
> size 9,
> or nil, if font cannot be found?
>
> --
> Best regards,
> Igor Stasenko.
>


Reply | Threaded
Open this post in threaded view
|

Re: How to use freetype?

Igor Stasenko
On 17 October 2011 15:14, Gary Chambers <[hidden email]> wrote:
> Try
>
> LogicalFont
>  familyName: 'Arial'
>  pointSize: 24
>

Thanks. This is what i was looking for.

> Regards, Gary
>
> ----- Original Message ----- From: "Igor Stasenko" <[hidden email]>
> To: "Pharo Development" <[hidden email]>
> Sent: Monday, October 17, 2011 1:19 PM
> Subject: [Pharo-project] How to use freetype?
>
>
>> I feel a bit confused.
>>
>> I want to do something as easy as:
>>
>> font := Something fontByName: 'Arial'.
>>
>> but the problem is that i cannot find anything like that in freetype.
>>
>> There is
>> FreeTypeFontProvider fontFor: aLogicalFont familyName: familyName
>>
>> but i puzzled, why it needs a logical font and why i should create it?
>>
>> Is there a general way to programmatically say: give me font 'Arial' pt
>> size 9,
>> or nil, if font cannot be found?
>>
>> --
>> Best regards,
>> Igor Stasenko.
>>
>
>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: How to use freetype?

Schwab,Wilhelm K
Sig,

It sounds like you are on your way to typographic bliss, but just in case (or for others who might run across this later), I found it necessary (at least on Linux) to load the fonts using something like

        FreeTypeFontProvider current families isEmpty ifTrue:[
                FreeTypeFontProvider current updateFromSystem.
        ].


Bill

________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Igor Stasenko [[hidden email]]
Sent: Monday, October 17, 2011 11:17 AM
To: [hidden email]
Subject: Re: [Pharo-project] How to use freetype?

On 17 October 2011 15:14, Gary Chambers <[hidden email]> wrote:
> Try
>
> LogicalFont
>  familyName: 'Arial'
>  pointSize: 24
>

Thanks. This is what i was looking for.

> Regards, Gary
>
> ----- Original Message ----- From: "Igor Stasenko" <[hidden email]>
> To: "Pharo Development" <[hidden email]>
> Sent: Monday, October 17, 2011 1:19 PM
> Subject: [Pharo-project] How to use freetype?
>
>
>> I feel a bit confused.
>>
>> I want to do something as easy as:
>>
>> font := Something fontByName: 'Arial'.
>>
>> but the problem is that i cannot find anything like that in freetype.
>>
>> There is
>> FreeTypeFontProvider fontFor: aLogicalFont familyName: familyName
>>
>> but i puzzled, why it needs a logical font and why i should create it?
>>
>> Is there a general way to programmatically say: give me font 'Arial' pt
>> size 9,
>> or nil, if font cannot be found?
>>
>> --
>> Best regards,
>> Igor Stasenko.
>>
>
>
>



--
Best regards,
Igor Stasenko.