How get font instance programmatically?

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

How get font instance programmatically?

Denis Kudriashov
Hello,

My task very simple. I need set some font for TextMorph instance programmatically.

I found TextStyle>>named: familyName . But it search font in TextConstants that not include my font.
By my font exists in visual font chooser from halo menu in text morph.

How I can get font instance that I see in FontChooser (that appears by halo menu)?

P.S. I try set for my text morph default Pharo 1.0 DejavuSans font


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: How get font instance programmatically?

Schwab,Wilhelm K
Below are some fonts that I set as part of my image build process; the comment above them is "Shamelessly stolen from Lukas."  They might need to be changed to take advantage of bitmap fonts??


        tinyFont := LogicalFont familyName:'DejaVu Sans' fallbackFamilyNames:nil pointSize:8 stretchValue:0 weightValue:400 slantValue:0.
        codeFont := LogicalFont familyName:'DejaVu Sans Mono' fallbackFamilyNames:nil pointSize:9 stretchValue:0 weightValue:400 slantValue:0.
        baseFont := LogicalFont familyName:'DejaVu Sans' fallbackFamilyNames:nil pointSize:10 stretchValue:0 weightValue:400 slantValue:0.
        boldFont := LogicalFont familyName:'DejaVu Sans' fallbackFamilyNames:nil pointSize:11 stretchValue:0 weightValue:600 slantValue:0.

You might try

   http://code.google.com/p/pharo/wiki/ImageBuildScripts


________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Denis Kudriashov [[hidden email]]
Sent: Thursday, June 03, 2010 11:49 AM
To: Pharo-project
Subject: [Pharo-project] How get font instance programmatically?

Hello,

My task very simple. I need set some font for TextMorph instance programmatically.

I found TextStyle>>named: familyName . But it search font in TextConstants that not include my font.
By my font exists in visual font chooser from halo menu in text morph.

How I can get font instance that I see in FontChooser (that appears by halo menu)?

P.S. I try set for my text morph default Pharo 1.0 DejavuSans font


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: How get font instance programmatically?

Denis Kudriashov
Thank you very much

2010/6/3 Schwab,Wilhelm K <[hidden email]>
LogicalFont familyName:'DejaVu Sans' fallbackFamilyNames:nil pointSize:8 stretchValue:0 weightValue:400 slantValue:0.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project