From: Stephan A. <sup...@gm...> - 2019-01-10 16:00:58
|
Hi guys, it's been a while that I worked with AGG code, and I feel a bit rusty. I want to change some code that renders cached glyph bitmaps one by one using agg::render_scanlines() to transfer the bitmap contents instead to the rasterizer cells, and then agg::render_scanlines() the complete string in just one call. Perhaps some background: The text rendering code I have here uses different code-paths for when the glyphs are cached bitmaps (originating from FreeType), or when they are vector paths. In case of bitmaps, each glyph is rendered by itself, in case of vector paths, each glyph is rasterized into the same rasterizer, and then after processing the last glyph, there is a final render pass. I need to make it so the processing is the same for the bitmap path as it is for the vector path. The reason being that there is a difference in output when a glyph touches the same pixels as the previous glyph (overlap). That's due to some strange way in which some drawing modes render the glyphs. It would not matter if it were normal alpha blending the foreground color with the existing background, but that's not always the case. So is there an easy way to do something equivalent to rasterizer.add_path() with the glyph bitmap that's already rasterized, to have it end up as the rasterizer contents? Basically, I need to copy it into the rasterizer cells at the correct location. Thanks a lot & best regards, -Stephan |