Re: [ft-devel] Fw: details on iPhone exploit caused by FreeType?

2011-07-15 Thread Алексей Подтележников
To look from the machine POV: There are logical and arithmetical shift instructions.  The logical ones to the right thing for unsigned numbers, the arithmetical for signed ones.  If shifting to the left, both are identical.  If shifting right, the difference is whether the new bits shifted in

Re: [ft-devel] details on iPhone exploit caused by FreeType?

2011-07-14 Thread Алексей Подтележников
Werner, Three questions regarding recent psaux commits: 1) Fix2Int does shift before conversion. How does it solve the undefined behavior with negative numbers? 2) Why not (FT_Int)(FT_UInt)? 3) Is Fix2Int conversion shared with other parts of freetype? Thanks, Alexei

Re: [ft-devel] details on iPhone exploit caused by FreeType?

2011-07-14 Thread Алексей Подтележников
On Thu, Jul 14, 2011 at 12:00 PM, Werner LEMBERG w...@gnu.org wrote: Here's the answer from Matthias. 1) Fix2Int does shift before conversion.  How does it solve the    undefined behavior with negative numbers? After the shift, the upper half is undefined. This is wrong. Undefined means

Re: [ft-devel] details on iPhone exploit caused by FreeType?

2011-07-09 Thread Алексей Подтележников
On Sat, Jul 9, 2011 at 12:53 AM, Werner LEMBERG w...@gnu.org wrote: I would have this check under default: on line 1013 because other cases have good checks already. But the `default' label continues, while `Unexpected_OtherSubr' aborts... Again, good cases do not need this check because

Re: [ft-devel] details on iPhone exploit caused by FreeType?

2011-07-09 Thread Алексей Подтележников
Moving error check down to default, where it belongs diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index a60ec38..f015e47 100644 --- a/src/psaux/t1decode.c +++ b/src/psaux/t1decode.c @@ -686,9 +686,6 @@ subr_no = (FT_Int)( top[1] 16 ); arg_cnt = (FT_Int)( top[0] 16

Re: [ft-devel] details on iPhone exploit caused by FreeType?

2011-07-08 Thread Алексей Подтележников
I would have this check under default: on line 1013 because other cases have good checks already. That default is rather strange : wish me luck. Really? ___ Freetype-devel mailing list Freetype-devel@nongnu.org

Re: [ft-devel] [Patch] Compensate blue zone rounding after scale

2011-05-13 Thread Алексей Подтележников
Why do you even create and calculate temporary shoot_delta? You can explicitly increment/decrement blue-shoot.fit the same way you do blue-ref.fit. Like this: +AF_CJKBlue blue; + +if ( delta_t = delta_b ) +{ + blue = axis-blues[AF_CJK_BLUE_TOP]; +

Re: [ft-devel] [Patch] Compensate blue zone rounding after scale

2011-05-13 Thread Алексей Подтележников
+ if ( delta_t 0 delta_b 0 /* rounded to floor. */ + delta_sum = 32 delta_sum = 64 + delta_t = 32 delta_b = 32 ) Here, delta_sum = 64 condition is superfluous, given that delta_sum = delta_t + delta_b.

Re: [ft-devel] [Patch] Compensate blue zone rounding after scale

2011-05-13 Thread Алексей Подтележников
In the following code, you should have reused 'blue_t' and 'blue_b' + blue_t = axis-blues[AF_CJK_BLUE_TOP]; + blue_b = axis-blues[AF_CJK_BLUE_BOTTOM]; skip + { +AF_CJKBlue blue; + skip + blue = axis-blues[AF_CJK_BLUE_TOP]; skip + blue =

Re: [ft-devel] [PATCH] Always check the checksum to identify tricky fonts

2011-04-25 Thread Алексей Подтележников
On Mon, Apr 25, 2011 at 10:34 AM, mpsuz...@hiroshima-u.ac.jp wrote: so I will apply your patch. You wrapped two nested if-conditions into one with . It could be wrapped with the preceding if-condition further. /* Type42 fonts may lack `name' tables, we thus try to identify */ /*

Re: [ft-devel] [PATCH] Improve FT_MulFix

2011-04-07 Thread Алексей Подтележников
On Wed, Apr 6, 2011 at 12:46 AM, Werner LEMBERG w...@gnu.org wrote: In most circumstances, I fully agree.  However, the new code looks like voodoo to me If it was a Freetype-specific core piece to be cherished as a mural, I'd side with Werner.  But is it so special? If I've understood James

Re: [ft-devel] rendering differences between 2.4.2 and 2.4.4

2011-03-12 Thread Алексей Подтележников
Werner, A more complete fix should include this patch. It removes a spurious shortcut. Because it is spurious, I overlooked ONE_PIXEL / 4 there. It also switches to a more natural do-while and removes unnecessary return; My planned harmonization with the cubic is postponed indefinitely or by a

Re: [ft-devel] rendering differences between 2.4.2 and 2.4.4

2011-03-05 Thread Алексей Подтележников
Werner, All arches seem to have lost weight. It is possible that the conic Bezier flattener is not splitting enough. You may want to fiddle with line 900 in ftgrays.c while ( dx ONE_PIXEL / 4 ) make it while ( dx ONE_PIXEL / 6 ) But again, this is not the solution I like. I still think that

Re: [ft-devel] cubic clean up

2010-11-12 Thread Алексей Подтележников
I am really annoyed by run-arounds and overzealous protection of code by authors. I was proposing a minor benign improvement. I am touching the water so to speak. What's the big deal? Way to attract developers, freetypers! You go! ___ Freetype-devel

Re: [ft-devel] cubic clean up

2010-11-12 Thread Алексей Подтележников
I think I can get though to this guy... 2010/11/12 David Bevan david.be...@pb.com: I've just had a brief chance to look at your proposal, and I now understand why it makes no difference to the output. The chances of your relaxed condition causing a split when the current (theoretically

Re: [ft-devel] cubic clean up

2010-11-12 Thread Алексей Подтележников
by remarks like I think I can get though to this guy... and It's only you and me who understand these conditions. which are at best patronising and at worst impolite. Best regards, Graham - Original Message From: Алексей Подтележников apodt...@gmail.com To: freetype-devel

Re: [ft-devel] cubic clean up

2010-11-11 Thread Алексей Подтележников
Shaded areas Before and After in the attached figures show where control points have should be to permit flattening. Is this a risky change? If anything, it is slightly more conservative, yet the conditional is quite a bit simpler. attachment:

[ft-devel] Re: FT_MAX_CURVE_DEVIATION vs ONE_PIXEL cont'd

2010-11-01 Thread Алексей Подтележников
On Mon, Nov 1, 2010 at 2:44 PM, Werner LEMBERG w...@gnu.org wrote: Ok. I'm resending the non-intrusive patch as an attachment. The intrusive harmonization of the conic and cubic splines is to follow in a separate thread. I'm going to apply your patch.  However, you are changing ONE_PIXEL/8

[ft-devel] Re: FT_MAX_CURVE_DEVIATION vs ONE_PIXEL cont'd

2010-10-20 Thread Алексей Подтележников
Алексей Подтележников apodt...@gmail.com: On Sun, Oct 17, 2010 at 4:53 AM, Werner LEMBERG w...@gnu.org wrote: It turns out that since 2.4.3 the cubic deviations have been estimated *after* UPSCALE, whereas conic ones have been evaluated *before* UPSCALE.  This was probably the original sin

Re: [ft-devel] harmonize conic and cubic splines

2010-10-18 Thread Алексей Подтележников
curve; that can be adjusted using the existing algorithm, in any case. The aim of code improvement in this area is to improve speed while preserving quality. Graham - Original Message From: Алексей Подтележников apodt...@gmail.com To: freetype-devel freetype-devel@nongnu.org

Re: [ft-devel] harmonize conic and cubic splines

2010-10-18 Thread Алексей Подтележников
On Mon, Oct 18, 2010 at 10:47 AM, Werner LEMBERG w...@gnu.org wrote: Is it?  I can imagine that two completely different algorithms are best.  Cubic and conic curves *are* different beasts... .. but I managed to quite successfully use essentially the same algorithm for both. Regardless of our

[ft-devel] FT_MAX_CURVE_DEVIATION vs ONE_PIXEL cont'd

2010-10-16 Thread Алексей Подтележников
Werner, Graham It turns out that since 2.4.3 the cubic deviations have been estimated *after* UPSCALE, whereas conic ones have been evaluated *before* UPSCALE. This was probably the original sin that led to the misuse of FT_MAX_CURVE_DEVIATION that we've just fixed in cubic. Let's fix the

Re: [ft-devel] FT_MAX_CURVE_DEVIATION vs ONE_PIXEL

2010-10-14 Thread Алексей Подтележников
2010/10/14 David Bevan david.be...@pb.com: Since there are two changes, (the value of FT_MAX_CURVE_DEVIATION and the algorithm), each must be tested independently. David, Focus please. This thread is about fixing deviations only by using ONE_PIXEL. diff --git a/src/smooth/ftgrays.c

Re: [ft-devel] FT_MAX_CURVE_DEVIATION vs ONE_PIXEL

2010-10-13 Thread Алексей Подтележников
of 1/64 of a pixel. Best regards, Graham - Original Message From: Алексей Подтележников apodt...@gmail.com To: freetype-devel freetype-devel@nongnu.org Sent: Wednesday, 13 October, 2010 2:25:40 Subject: [ft-devel] FT_MAX_CURVE_DEVIATION vs ONE_PIXEL Guys, Currently smooth

[ft-devel] [patch] simplify and speed up smooth cubic splines

2010-10-08 Thread Алексей Подтележников
Graham, David, The patch below does away with cute (as in octagon) but complex estimate of Euclidean length in favour of straightforward Manhattan distance. Who says that we have to religiously use Euclidean metrics? As a bonus, the code runs faster The speed up of course comes from fewer splits

Re: [ft-devel] [patch] on the subject of better splines

2010-10-03 Thread Алексей Подтележников
Graham, 2010/10/3 Graham Asher graham.as...@btinternet.com: there's a chance it might help at high resolutions where more than one band is needed. True, I have nothing to show for it besides correctness. The speed up is barely visible. Is 72 enough to cross bands? BEFORE: ftbench -b c -s 72

[ft-devel] [patch] on the subject of better splines

2010-10-01 Thread Алексей Подтележников
Hello, While you guys are on the subject of better splines. I propose to fix grey_render_conic too. I think that interpreting the control point as a corner is a simplistic overestimation. A little algebra gives the exact boundary position. Nothing breaks at the firsts glance in my testing.