LocaleTest >> #testIsFontAvailable failing

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

LocaleTest >> #testIsFontAvailable failing

Philippe Marschall-2-3
Hi

LocaleTest >> #testIsFontAvailable is raising an exception in my
image. The problem is that LanguageEnvironment >> #isFontAvailable
sends #fallbackFont to a LocigalFont which does not understand this
message. The #realFont of the logical font is a FreeTypeFont which
doesn't understand #fallbackFont as well.

Cheers
Philippe


_______________________________________________
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: LocaleTest >> #testIsFontAvailable failing

Adrian Lienhard
Thanks. I think this simplest thing to do is to change the  
isFontAvailable as follows:

isFontAvailable
        | encoding f |
        encoding := self leadingChar + 1.
        f := TextStyle defaultFont.
        f isFontSet ifTrue: [
                f fontArray
                        at: encoding
                        ifAbsent: [^ false].
                ^ true
        ].
        ^ encoding = 1

I.e., to not check with a fallback font as this concept does not seem  
implemented for all fonts.

Adrian

On Jul 18, 2009, at 11:29 , Philippe Marschall wrote:

> Hi
>
> LocaleTest >> #testIsFontAvailable is raising an exception in my
> image. The problem is that LanguageEnvironment >> #isFontAvailable
> sends #fallbackFont to a LocigalFont which does not understand this
> message. The #realFont of the logical font is a FreeTypeFont which
> doesn't understand #fallbackFont as well.
>
> Cheers
> Philippe
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


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