[Cuis-dev] VectorEnginePlugin (was Re: UK Smalltalk User Group meeting - Wednesday March 31st)
Juan Vuletich
juan at jvuletich.org
Mon Mar 22 16:48:07 PDT 2021
On 3/22/2021 5:55 PM, David T. Lewis via Cuis-dev wrote:
> Hello Juan,
>
> I recall from previous presentations that development of a VM plugin
> was on the to-do list for your vector graphics package. Could you
> please say a few words about what is needed? If it is something that
> I could help with, I would be happy to assist.
>
> Dave
>
Hello David, Eliot,
I've been working on it for a couple of weeks, and it is starting to
take off! So, David, you just triggered an announcement.
I have just pushed the relevant files to GitHub. There are several ways
to explore this.
A - You want to see it running. Experimental. I only buit it for MacOS.
1) Grab VM including the plugin from
https://www.dropbox.com/sh/rhkt4ayq24t2xbf/AACDb3mrjMUDB8Mptd-Bi6Zsa?dl=0
2) Pull Cuis repo.
3) Start Cuis with the VM above
4) Evaluate: Feature require: 'VectorGraphics'.
5) Set a TT Font (Stuff will break with StrikeFonts and you'll need to
kill the image)
6) Evaluate: M3Exp01Morph new openInWorld.
7) Play with the halo. Very slow! Still running the Smalltalk code for
VectorEngine
8) Evaluate: (self runningWorld canvas instVarNamed: 'vectorCanvas')
usePlugin.
9) Play with the halo. Rotate (bottom left handle) and Zool (bottom
right handle) Now it is very fast! The plugin is working.
10) Hide the taskbar
11) redefine WidgetMorph>>requiresVectorCanvas to answer true,
12) refresh the display. Now every window and window element, including
all the text, is drawn by VectorEngine. You might notice that all the
appareances of any glyph, for example $a are no longer identical. Text
layout and Glyph placement is done with Float arithmetic, using subpixel
locations!
13) redefine WidgetMorph>>hasVariableExtent to answer false.
14) Open the halo on any window. Use the rotate and zoom handles.
15) Yes. We can do high quality, subpixel antialiased text at _any_
scale and rotation angle! I don't know of any other Smalltalk or
windowing system that can do this. It is like pdf scaling, but for _all_
the UI!
B - You want to look at the generated C code for the plugin, or build it
for another platform. You need a working setup to build the
OpenSmalltalk VM. The dropbox opensmalltalk-vm includes the files needed
to build the VM with the plugin.
C - You want to experiment with the Slang plugin source code. I have
only done this in Cuis, not yet in the official Squeak VMMaker image.
1) Clone / pull VMMaker repo
2) Feature require: 'VMMaker'.
3) FileIn 'IntegerArrayWordArray-stdint-VMMaker-jmv.006.cs.st'
4) Feature require: 'VectorEnginePlugin'
5) VectorEnginePlugin translateInDirectory: DirectoryEntry
currentDirectory doInlining: true
I wanted to use stdint.h C types. The file
IntegerArrayWordArray-stdint-VMMaker-jmv.006.cs.st includes changes to
VMMaker to generate the proper declarations.
David, Eliot, do you think this is a sensible way to enable the use of
stdint.h? It would affect any uses of IntegerArray and WordArray. I
think we'd use stdint.h as much as possible. But I'm not certain if
these changes could break other things.
Feedback is most welcome.
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
More information about the Cuis-dev
mailing list