Woohoo! Works for me. You made my day.

In regards to determining the DPI of the display, can't we just set that as
a preference with a default value of 96? That would satisfy 98% of cases.
We could also add a primitive that would allow the VM to have its say
(e.g., retina display on MacOS). When that primitive fails, it would
default to the preference.

Cheers,

Jeff


On Fri, Apr 4, 2014 at 2:55 AM, Igor Stasenko <siguc...@gmail.com> wrote:

> Okay, i think i got it..
>
> Here is what happens:
> - the font size is usually specified in points, not x@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.
>



-- 
Jochen "Jeff" Rick, Ph.D.
http://www.je77.com/
Skype ID: jochenrick

Reply via email to