[Pharo-dev] [Moose-dev] Re: Re: Re: Fwd: Font problem is still there

Igor Stasenko siguctua at gmail.com
Fri Apr 4 04:41:33 EDT 2014


On 4 April 2014 08:33, Pharo4Stef <pharo4Stef at free.fr> wrote:

> Igor
>
> I was wondering the following: ? But TextStyle is not about strikefont?
>
>
TextStyle contains so many different things..


> Stef
>
> On 04 Apr 2014, at 02:55, Igor Stasenko <siguctua at gmail.com> wrote:
>
> > Okay, i think i got it..
> >
> > Here is what happens:
> > - the font size is usually specified in points, not x at y points, but
> typographical points,
> > which is
> > 1/72 inch
> >
> >
> > TextStyle pointsToPixels: 14
> >
> > TextStyle pointsToPixels: 14 => 18.666666666666668
> >
> > pointsToPixels: points
> >     ^points * self pixelsPerInch / 72.0
> >
> >
> > but in Athens, i , stupid idiot, completely forgot about that,
> > and use point size directly, to scale up font ..
> > but the point is that this scaling performed in font units (EMs).
> >
> > so, to actually scale font correctly, i must use same TextStyle
> pointsToPixels: ..
> > as Freetype package using..
> >
> > there is one caveat, that if you really want to see exactly , say 16
> points sized font on your screen,
> > it is not possible without knowing the display resolution - how many
> pixels in one inch (hence
> > #pixelsPerInch ).
> > Unfortunately, our VMs don't give us a way to determine DPI of display..
> > and so, it is always 96 :/
> >
> > pheww....
> >
> > fromFreetypeFont: aFont cairoFace: face
> > .....
> >
> >   -  fontMatrix scaleBy: aFont pointSize.
> >
> >  +  fontMatrix scaleBy: (TextStyle pointsToPixels: aFont pointSize).
> >
> > problem solved ... (i hope) :)
> >
> > --
> > Best regards,
> > Igor Stasenko.
>
>
>


-- 
Best regards,
Igor Stasenko.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20140404/dbc4d97a/attachment-0002.html>


More information about the Pharo-dev mailing list