freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] Fw: [ft-devel] fitting a text


From: folkert
Subject: Re: [ft] Fw: [ft-devel] fitting a text
Date: Fri, 12 Jun 2015 10:40:38 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

> >> My code prints out the computed bitmap dimensions (including
> >> fractions); do the numbers agree with what you calculate?
> > 
> > Totally different. Also your script emits different values from my
> > code. I converted your python script to c++:
> > 
> > your script:
> > 
> > char 95 wxh = 6x1 ascender -1 bearingx -1 kern 0
> > char 103 wxh = 6x7 ascender 5 bearingx 0 kern 0
> > char 113 wxh = 6x6 ascender 5 bearingx 0 kern 0
> > char 116 wxh = 3x6 ascender 6 bearingx 0 kern 0
> > char 101 wxh = 5x5 ascender 5 bearingx 0 kern 0
> > char 115 wxh = 5x5 ascender 5 bearingx 0 kern 0
> > char 116 wxh = 3x6 ascender 6 bearingx 0 kern 0
> > char 49 wxh = 6x7 ascender 7 bearingx 2 kern 0
> > char 50 wxh = 6x7 ascender 7 bearingx 1 kern 0
> > char 51 wxh = 6x7 ascender 7 bearingx 0 kern 0
> > bitmap dimensions wxh = 52x9
> > 
> > my c++ version:
> > 
> > char 95 wÃ???h = 64Ã???64 ascender 0 bearingx -64 kern 0
> > char 103 wÃ???h = 64Ã???128 ascender 64 bearingx 0 kern 0
> > char 113 wÃ???h = 64Ã???128 ascender 64 bearingx 0 kern 0
> > char 116 wÃ???h = 0Ã???128 ascender 64 bearingx 0 kern 0
> > char 101 wÃ???h = 64Ã???128 ascender 64 bearingx 0 kern 0
> > char 115 wÃ???h = 64Ã???128 ascender 64 bearingx 0 kern 0
> > char 116 wÃ???h = 0Ã???128 ascender 64 bearingx 0 kern 0
> > char 49 wÃ???h = 64Ã???64 ascender 64 bearingx 0 kern 0
> > char 50 wÃ???h = 64Ã???64 ascender 64 bearingx 0 kern 0
> > char 51 wÃ???h = 64Ã???128 ascender 64 bearingx 0 kern 0
> > bitmap dimensions wÃ???h = 512Ã???128
> 
> From your previous code posted,
> 
> > (void)FT_Set_Char_Size(face, target_height * 64, 0, 100, 0);
> 
> You are setting a resolution of 100dpi, whereas I am using 72dpi. That
> will cause some inconsistency in the numbers. Also you are passing 0 for

I had that for this version at 75 actually.

Just to be sure I tried 72 as well and...

> the vertical values, which I know the docs say is fine. But my
> Face.set_char_size routine always explicitly passes these; I wonder if
> that makes a difference?

...I've now set those to the appropriate values as well:

char 95 w×h = 64×64 ascender 0 bearingx -64 kern 0
char 103 w×h = 64×128 ascender 64 bearingx 0 kern 0
char 113 w×h = 64×128 ascender 64 bearingx 0 kern 0
char 116 w×h = 0×128 ascender 64 bearingx 0 kern 0
char 101 w×h = 64×128 ascender 64 bearingx 0 kern 0
char 115 w×h = 64×128 ascender 64 bearingx 0 kern 0
char 116 w×h = 0×128 ascender 64 bearingx 0 kern 0
char 49 w×h = 64×64 ascender 64 bearingx 0 kern 0
char 50 w×h = 64×64 ascender 64 bearingx 0 kern 0
char 51 w×h = 64×128 ascender 64 bearingx 0 kern 0
bitmap dimensions w×h = 512×128

It is totally different from the python version. Here the ascender is
always (but one) 64 while the python version it is 3 different values.
Same thing for the wxh for each character.


Folkert van Heusden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]