[Pharo-dev] setting fonts in pharo 3.0

Tudor Girba tudor at tudorgirba.com
Fri Nov 1 17:52:10 EDT 2013


Oh, I see.

The previous code relied on the assumption that the free types are not
enabled:
    FreeTypeSystemSettings loadFt2Library: true.

This implicitly triggered the fonts update. So, now I am doing:
    FreeTypeFontProvider current updateFromSystem.

and it works just fine.

Thanks.

Doru


On Fri, Nov 1, 2013 at 10:40 PM, Sven Van Caekenberghe <sven at stfx.eu> wrote:

>
> On 01 Nov 2013, at 21:51, Tudor Girba <tudor at tudorgirba.com> wrote:
>
> > Hi,
> >
> > I am porting Moose to Pharo 3.0. I could get the image code to load
> rather painlessly, and that is great.
> >
> > The first thing I notice is that something changed in the font
> management: I cannot seem to be able to set non-bitmap fonts anymore. I
> also noticed that the base Pharo image does not come with the advertised
> non-bitmap fonts either.
> >
> > I am trying this:
> >
> > #('SourceCodeProRegular' 'SourceCodeProBold' 'SourceSansProRegular'
> 'SourceSansProBold') do: [ :each |
> >               Gofer new
> >                       smalltalkhubUser: 'girba' project: 'FreeFonts';
> >                       package: each;
> >                       load.
> >               (Smalltalk at: each asSymbol) new install ].
> >       FreeTypeSystemSettings loadFt2Library: true.
> >       StandardFonts
> >               setAllStandardFontsTo: (LogicalFont familyName: 'Source
> Sans Pro' pointSize: 10);
> >               haloFont: (LogicalFont familyName: 'Source Sans Pro'
> pointSize: 10);
> >               windowTitleFont: (LogicalFont familyName: 'Source Sans
> Pro' pointSize: 14);
> >               balloonFont: (LogicalFont familyName: 'Source Sans Pro'
> pointSize: 10);
> >               codeFont: (LogicalFont familyName: 'Source Code Pro'
> pointSize: 10)
> >
> > Could anyone point me in the right direction?
>
> This is how I customise newly downloaded 3.0 images (filing in this code):
>
> ===
> Author fullName: 'SvenVanCaekenberghe'.
>
> TaskbarMorph showWindowPreview: false.
>
> SourceCodeProRegular new install.
> OpenSansRegular new install.
> FreeTypeFontProvider current updateFromSystem.
>
> #(
>         #(#defaultFont: 'Open Sans' 12)
>         #(#listFont: 'Open Sans' 12)
>         #(#menuFont: 'Open Sans' 12)
>         #(#windowTitleFont: 'Open Sans' 12)
>         #(#balloonFont: 'Open Sans' 10)
>         #(#codeFont: 'Source Code Pro' 11)
>         #(#buttonFont: 'Open Sans' 12)
>         #(#haloFont: 'Open Sans' 10)) do: [ :spec |
>                 | font |
>                 font := LogicalFont familyName: spec second pointSize:
> spec third.
>                 StandardFonts perform: spec first with: font ]
> ===
>
> I did not manage to make the window title font bold though ;-)
>
> Sven
>
> > Cheers,
> > Doru
> >
> >
> > --
> > www.tudorgirba.com
> >
> > "Every thing has its own flow"
>
>
>


-- 
www.tudorgirba.com

"Every thing has its own flow"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131101/900b30eb/attachment-0002.html>


More information about the Pharo-dev mailing list