[Cuis-dev] VectorGraphics and Morph

Juan Vuletich juan at jvuletich.org
Mon Jun 29 12:29:56 PDT 2020


Hi Hilaire,

On 6/28/2020 9:51 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> I find some time to test it.
>
> To do so I only need to change the parent of the DrGDrawable class to 
> VectorGraphicsPasteUpMorph. Easy. I read your hack, it adds one 
> message send per rendered morphs. I don't have strong opinion on that.
>

Ok.

> You can observe the lines  are blurred and the colour is not right. 
> The lines should be black and they are too thick for a one pixel width 
> line. Some lines are black because there are several segments in top 
> of each other.
>

This is because of the anti aliasing. See 
https://en.wikipedia.org/wiki/Spatial_anti-aliasing#Signal_processing_approach_to_anti-aliasing 
. According with signal processing theory, you can not do 1-pixel 
features without aliasing. The VectorGraphics engines follow the theory. 
So, if you ask for a line that is narrower than what the engine can 
draw, it draws it at the minimum possible width (i.e. slightly wider), 
but using translucency to compensate (otherways it would become too 
"heavy" due to being wider than asked).

Following signal processing theory is the reason why the results are 
less pixelated than, for example, Cairo.

> Adding a StringMorph will set Cuis in an infinite loop scenario 
> without way to escape (Alt+[.] did not work):
>
> | c |
> c _ VectorGraphicsPasteUpMorph new openInWorld.
> c addMorph: (StringMorph new contents: 'Hello')

You need to set a TrueType font. VectorGraphicsEngine can not use 
StrikeFonts.

> Thanks!
>
> Hilaire
>
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> https://pouet.chapril.org/@hilaire

Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200629/48375568/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 29805 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200629/48375568/attachment-0001.png>


More information about the Cuis-dev mailing list