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

SetSrc only makes sense if it's image.Uniform #6

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 1 comment
Open

SetSrc only makes sense if it's image.Uniform #6

GoogleCodeExporter opened this issue Mar 16, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Use a non-image.Uniform image in SetSrc.
2. Call freetype.DrawString

What is the expected output? What do you see instead?
I'd expect that the src passed to c.SetSrc gets composited with the destination 
with the two images aligned.

Instead, for each glyph, a region (0, 0) to (w, h) gets used from src, where w, 
h are the dimensions of the glyph, with the result that the actual colors taken 
from src depending on the height of the rendered glyph and adjacent glyphs are 
inconsistently colored.

What version of the product are you using? On what operating system?
Lion on mac, but I'm sure that's irrelevant.


Please provide any additional information below.

In: http://code.google.com/p/freetype-go/source/browse/freetype/freetype.go#212
I think image.ZP should be dr.Min, or possibly adjusted to align src.Min and 
dst.Min.
The comment would need fixing too to specify the meaning of the SetSrc value.

Attached is a variant of one of the example files that exhibits the problem. 
I've tried to make the colors as nasty as possible to make the problem visible. 
I've also attached a png with the output.

Original issue reported on code.google.com by paul.han...@gmail.com on 1 Aug 2012 at 7:56

Attachments:

@GoogleCodeExporter
Copy link
Author

You're right. SetSrc isn't useful with a non-Uniform image.

A long time ago, there was talk of re-doing the DrawString API to look more 
like the image/draw package, instead of e.g. separate Context.SetSrc methods. 
See the discussion (not the code) at http://codereview.appspot.com/2208041/

Unfortunately, that talk didn't go anywhere. Thanks for the bug report, though. 
The data point will be useful when I finally have some time to re-think the API.

Original comment by nigel...@golang.org on 2 Aug 2012 at 1:31

  • Changed state: Accepted

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