Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential MSIRP implementation issue in hint.go #12

Closed
GoogleCodeExporter opened this issue Apr 8, 2015 · 3 comments
Closed

Potential MSIRP implementation issue in hint.go #12

GoogleCodeExporter opened this issue Apr 8, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

in hint.go line 671:

curDist := dotProduct(f26dot6(p.X-ref.X), f26dot6(p.Y-ref.Y), h.gs.dv)

as per the specifications:
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html#IP

I think the distance should be computed using the projection vector and not the 
dual vector.  (h.gs.pv instead of h.gs.dv)

correct line:
curDist := dotProduct(f26dot6(p.X-ref.X), f26dot6(p.Y-ref.Y), h.gs.pv)

The equivalent code in Freetype is:
distance = CUR_Func_project( CUR.zp1.cur + point,
                                 CUR.zp0.cur + CUR.GS.rp0 );

Where CUR_Func_project use the projection vector:
return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
                        CUR.GS.projVector.x,
                        CUR.GS.projVector.y );

Original issue reported on code.google.com by jeremie....@gmail.com on 4 Nov 2014 at 1:38

@GoogleCodeExporter
Copy link
Author

Thanks for the report. I think you're right.

Is there a particular font that there's a difference on, or were you simply 
reading both the C code and the Go code?

Original comment by nigel...@golang.org on 6 Nov 2014 at 8:47

@GoogleCodeExporter
Copy link
Author

unfortunately, I'm just reading both code :/
It would be awesome to have full unit test coverage for hinting instructions 
but this doesn't seems to exist (or is hard to find).

Original comment by jeremie....@gmail.com on 6 Nov 2014 at 10:09

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision a123d4416a3c.

Original comment by nigel...@golang.org on 6 Nov 2014 at 10:37

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant