[Cuis-dev] Fix for VectorCanvas>>#image:at:

Luciano Notarfrancesco luchiano at gmail.com
Fri Jun 2 16:00:17 PDT 2023


Hi Andres,
Yes, as you know in Cuis the printOn: can print Text, and Text can include
Forms and arbitrary Morphs that are then embedded in the Workspace or
wherever you printIt and draw themselves and can move with stepping, etc.
This is already quite general, at least for my needs so far. I could have
made a MatrixMorph instead of drawing matrices on Forms but I didn’t really
need it at this point.

On Sat, 3 Jun 2023 at 00:29 Andres Valloud via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> At some point, "print it" doesn't make sense.  So, objects other than
> strings are needed.  They might happen to know how to displays
> themselves in some sort of "document", but how that happens should be up
> to them.
>
> On 6/2/23 2:59 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> > I’ve been thinking how to prevent the printIt output to be syntax
> > highlighted. I think it’s best to do that because the output is not
> > Smalltalk code, so the syntax highlighter gets it almost always wrong.
> > It could be a preference, or it could be specified in the printOn:
> > methods that know that the output is not Smalltalk code. What do you
> > think? How would you implement it? A new text attribute makes sense to
> > you or do you have any other idea?
> >
> > On Thu, 1 Jun 2023 at 20:53 Luciano Notarfrancesco <luchiano at gmail.com
> > <mailto:luchiano at gmail.com>> wrote:
> >
> >     Oh, that’s great, using subpixel antialiasing just solved the
> >     problem! Thanks!
> >
> >     I’ll try NeoEuler. It would be nice to have fallback fonts too… some
> >     math glyphs are missing in DejaVu… but it’s not a big deal. Another
> >     minor aesthetic problem is that the syntax highlighter sometimes
> >     gets confused with the output of printIt, perhaps would be better to
> >     not apply syntax highlighting to the output, or to have the option
> >     to “lock” the output text in some printOn: methods so that the
> >     syntax highlighter doesn’t change it (perhaps a new attribute? not
> >     sure if this makes sense). Also sometimes the underscores are not
> >     converted to arrows in a workspace, perhaps this is related to the
> >     syntax highlighter getting confused.
> >
> >     Thanks!
> >     Luciano
> >
> >     On Thu, 1 Jun 2023 at 17:42 Juan Vuletich <juan at cuis.st
> >     <mailto:juan at cuis.st>> wrote:
> >
> >         __
> >         Hi Luciano,
> >
> >         On 5/30/2023 9:06 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> >>         BTW, in case anyone is curious, here is how matrices look when
> >>         printing them on a workspace with cmd-p. I draw matrices over
> >>         the binary field in a special way (first screenshot), and I
> >>         scale them down if they are too big.
> >>         I did this because it was hard to make matrices look good when
> >>         printing them as text, so instead I draw them on a form and
> >>         embed the form when printing them. I only do this with
> >>         matrices, they are especially problematic when printing
> >>         because they print with more than one line, they are the only
> >>         objects in my system that need more than one line for
> >>         printing. When I printed them as text with more than one line,
> >>         printing a list of matrices (for example an array of matrices,
> >>         as in the example where I print a basis of a vector space in
> >>         the screenshots) they would look horrible. Now a list of
> >>         matrices is printed in a single line as expected, and the
> >>         point size of the enclosing parentheses is adjusted
> >>         automatically (I have messages Stream>>#withParentheses:,
> >>         #withBrackets:, #withAngleBrackets:, etc, that do this
> >>         automatically).
> >
> >         It looks beautiful!
> >
> >>         I still have two little problems that I might want to tweak:
> >>         1) the parentheses are too thick, setting the point size is
> >>         not the right thing to do, maybe we need a new text attribute
> >>         for scaling text without changing the point size?;
> >
> >         The easiest solution is to use a different font, just for the
> >         parentheses. For example, NeoEuler parentheses are much lighter
> >         at large point sizes.
> >
> >>         2) matrices inside matrices loose the transparent background,
> >>         the background becomes black, as you see in the example in the
> >>         second screenshot.
> >
> >         I guess this should be fixable. If you can prepare an image with
> >         such example for me to play with, I'll give it a try. For
> >         example (not sure if related) VectorEngine can do blending over
> >         translucent backgrounds, but only if subpixel sampling is used.
> >         I know, there is no relation between these two features... But I
> >         wanted to keep options to a small number, and usually we only
> >         use cheaper whole pixel AA and cheaper alpha blending that can't
> >         blend over translucent backgrounds. So, maybe just using the
> >         SubPixel engine solves this problem, or I'll be happy to take a
> >         look.
> >
> >>
> >>         On Tue, May 30, 2023 at 7:27 PM Luciano Notarfrancesco
> >>         <luchiano at gmail.com <mailto:luchiano at gmail.com>> wrote:
> >>
> >>             This change set fixes a little bug in VectorCanvas that
> >>             cames up when using the canvas to draw text with images on
> >>             a form (outside morphic). I do this to draw matrices, and
> >>             when drawing a matrix whose coefficients are also matrices
> >>             this came up. The fix is simply checking that the world is
> >>             not nil.
> >>
> >
> >         Integrated and at GitHub. Thanks!
> >
> >         Cheers,
> >
> >         --
> >         Juan Vuletich
> >         cuis.st  <http://cuis.st>
> >         github.com/jvuletich  <http://github.com/jvuletich>
> >         researchgate.net/profile/Juan-Vuletich  <
> http://researchgate.net/profile/Juan-Vuletich>
> >         independent.academia.edu/JuanVuletich  <
> http://independent.academia.edu/JuanVuletich>
> >         patents.justia.com/inventor/juan-manuel-vuletich  <
> http://patents.justia.com/inventor/juan-manuel-vuletich>
> >         linkedin.com/in/juan-vuletich-75611b3  <
> http://linkedin.com/in/juan-vuletich-75611b3>
> >         twitter.com/JuanVuletich  <http://twitter.com/JuanVuletich>
> >
> >
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230603/fcfcb421/attachment.htm>


More information about the Cuis-dev mailing list