gesturing paths → notes
- Juancho Capic
- Pierre Huyghebaert
- Eric Schrijver
- Colm O’Neill
- Vincent Moisan
- S V
- Loraine Furter
- Ludivine Loiseau
- Femke Snelting
Tuesday plan
Proper introduction to Git
Work environment, workflow, basic syntax introduction
First Metafont shape!
Quick point on the proceedings, mini workgroups, direct documentation
Quick look at the various modules
http://ospublish.constantvzw.org/images/var/albums/Relearn-2013/DSCF0019.JPG
Installation
MetapolatorThis is a lot of stuff to install!
On Ubuntu, this is how we managed to do it…
- sudo apt-get install texlive texlive-metapost texlive-metafont
- sudo apt-get install mysql-client mysql-server libmysqlclient-dev
- sudo apt-get install python-virtualenv
- sudo apt-get install t1utils
- sudo apt-get install build-essential
And a Fontforge built from source…
Python bindings
- mkdir ~/venvs
- cd ~/venvs
- virtualenv metapolator
- source ~/venvs/metapolator/bin/activate
- pip install distribute --upgrade
- pip install MySQL-python
- pip install web.py
Compile mf2pt1
- mkdir -p ~/src/mf2pt1
- cd ~/src/mf2pt1
- curl -O http://archive.cs.uu.nl/mirror/CTAN/support/mf2pt1.zip
- unzip mf2pt1.zip
- mpost -progname=mpost -ini mf2pt1
- cp mf2pt1.mem ~/relearn/metapolator/
- # or wherever you put metapolator
Compile sfnt2woff
- mkdir -p ~/src/sfnt2woff
- cd ~/src/sfnt2woff
- curl -O http://people.mozilla.com/~jkew/woff/woff-code-latest.zip
- unzip woff-code-latest.zip
- make
Install sfnt2woff
- mkdir -p ~/bin/
- cd ~/bin/
- ln -s ~/src/sfnt2woff/sfnt2woff
- source ~/.profile
Compile ttf2eot
- cd ~/src
- git clone https://github.com/jgmdev/ttf2eot.git
- cd ttf2eot/
- make
Install ttf2eot
- cd ~/bin
- ln -s ~/src/ttf2eot/ttf2eot
- source ~/.profile
http://ospublish.constantvzw.org/images/var/albums/Relearn-2013/Screen%20Shot%202013-08-29%20at%202_59_54%20PM.png
Basic syntax
To start off, let’s have a look at the basic syntax for a Metafont drawing.
Along with this text file you will find a folder in the relearn.gesturing-paths.git containing a file with an .mp extension.
Open it up with a text editor and have a look around.
We’re going to look at how to output a visual result to the .mp file.
This extension might look strange but it’s actually just describing a MetaPost file.
MetaPost is what we’re going to be using to translate the syntax text you’re looking at in the .mp.
Open a terminal shell and type:
- mpost --help
You’re now looking at all the options that MetaPost allows.
Move to the directory where your file is saved, now tell MetaPost what you’ve been working on and type:
mpost whateveryoucalledyourfile.mp
The program will return a message log to confirm that it has performed the translation action.
Now check the folder where your .mp file resides.
Committer : FS - Fri, 30 Aug 2013 14:09:53 - A first attempt to see about merge, changes through a simple search-and-replace
Notes, links
- Some simpler MetaPost examples: http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html
- Metapost manual: http://users.encs.concordia.ca/~grogono/Writings/mpref.pdf
- Tutorials:
- Hector Spray Project: http://hektor.ch/Videos/Dexter-Sinister.mov/
Cheatsheet
http://git.constantvzw.org/?p=relearn.gesturing-paths.git;a=blob_plain;f=iceberg/Screenshot+from+2013-08-29+18:34:03.png;
MetaPost
- Go in the relearn folder (for the terminal questions see: http://relearn.be/w/relearn-cheatsheet )
- cd relearn
- Clone (copy) the folder relearn.gesturing-paths and its Git history from OSP website
- git clone git@git.constantvzw.org:/relearn.gesturing-paths.git
- Run the program mpost on the file
- mpost nameoffileinthefolder
- It generates an EPS file: draw.1
An example: file draw.1
- beginfig(1)
- draw (5,5) -- (0,30) --- (15,15) .. (30,30) -- (25,5) --- cycle;
- endfig;
- end
In the file draw.1:
- -- → means a straight line between the coordinates
- .. → means a curved line between the coordinates
- --- → means a curved line with a “round” angle
- ... → aligns horizontally the two points (used for instance to make the bottom of a letter |_| on the baseline)
- cycle → links the last coordinate with the first one
- --- cycle; → means a curved line between the end and the beginning
Committer : Loraine - Thu, 29 Aug 2013 14:09:13 - Starting a Meta-post-font-TeX poster
A sequel to OSP Visual Grammar poster, showing the construction of a Bezier curve-based font and a spiro curve-based font. This new one, possibly followed by other ones, will show the process of drawing or programming a font with metapost, and will be laid-out with Metafont and TeX!!!!
A sequel to OSP Visual Grammar poster, showing the construction of a Bezier curve-based font and a spiro curve-based font. This new one, possibly followed by other ones, will show the process of drawing or programming a font with metapost, and will be laid-out with Metafont and TeX!!!!
Tools
MetaPost was created by mathematicians —Donald Knuth is also the creator of TeX— to do graphics of illustrations (this is why you have a function fill or color, that are not really usable in the case or a stroke font).- fill instead of draw will fill the figure.
- withcolor will change the color.
Pen settings (the brush parameters)
If nothing is specified, it sets a “normal” pen (circular nib).
Calligraphic pen:
- pen circle (round shape)
- pen square (square shape)
- pen razor (only a line without width)
Pen attributes:
- xscaled (scales horizontally)
- yscaled (scales vertically)
- rotated (rotates the pen)
Committer : Caroline_Dath - Thu, 29 Aug 2013 16:40:15 - la crème de la crème
Before starting to draw:
- pickup pen circle scaled 0.8pt %(in MetaPost it will be postscript points)
- beginfig(1)
- draw (5,5) -- (0,30) --- (15,15) .. (30,30) -- (25,5) --- cycle;
- endfig;
- end
In the example above, we scaled homothetically the pen, now we want to stretch it differently in x and y, and we rotate it:
- pickup pen circle
- xscaled 0.8pt
- yscaled 0.2pt
- rotated 45
- beginfig(1)
- draw (5,5) -- (0,30) --- (15,15) .. (30,30) -- (25,5) --- cycle;
- endfig;
- end
Committer : Juancho-Capic - Fri, 30 Aug 2013 09:11:20 - Analogic Metapost
This is a signal the i show on the square next to Variable, so i took a photo of if because it reminds me of the Metapost program. Geeky!
This is a signal the i show on the square next to Variable, so i took a photo of if because it reminds me of the Metapost program. Geeky!
Using vector points
Here’s an example :
draw (03,03) {up}..{up} (10,17);
The path will move straight up from (03,03) and arrive from below to (10,17).
http://git.constantvzw.org/?p=relearn.gesturing-paths.git;a=blob_plain;f=Modules/Coordinates/VM/metapost_vector-point-example.png;
The path will leave the starting point as indicated but will join the end point as the opposite way you indicate. The path will actually follow the direction you assign to the end point: to keep on the up direction, the path has to come from below. And to keep on the “right” direction, the path has to come from the left. You can use "left", “right”, “up” and “down” attributes to define the direction.
With degrees:
- draw (02,13) {dir40}.. {dir20} (10,47);
Other examples:http://git.constantvzw.org/?p=relearn.gesturing-paths.git;a=blob_plain;f=iceberg/VM-vm.png;h=3e3007aa9c901150cf819b74a5967e1b90b3d3ff;hb=HEAD
http://git.constantvzw.org/?p=relearn.gesturing-paths.git;a=blob_plain;f=iceberg/VM-z.png;h=869ff1c4637ea0a106bd17c2d563f1a1f9c36086;hb=HEAD
http://git.constantvzw.org/?p=relearn.gesturing-paths.git;a=blob_plain;f=iceberg/VM-k.png;h=0a1e629b6c7f933d7cb8b849b3a569f79d6f474d;hb=HEAD
Committed : kevin-cocquio - Fri, 30 Aug 2013 08:55:58 - Nouveau fichier de définition des associations de modules de lettres
Back to Git
To modify a file from the Git (take it and modify it)
From anywhere in the repository, see if there were any changes yet:
- git pull
Sometimes you can’t pull on Git because first you need to clean all the commits that you “should do” on the files that you already made in your computer. But normally you don’t want to push those files on the Git repository so all you need yo do is: git stash and it will store your commits in a box, so now you should be able to pull correctly; if you want to get your changes back again with git stash apply.
On the online git repository, you can see the changes made: drawG.mp.
And click on log.
Meta-Hershey
Hershey fonts are stroke fonts drawn for engraving. Meta-Hershey variants are generated here: the paths of the SVG Hershey files were translated into Metafont.http://en.wikipedia.org/wiki/Hershey_font
http://ospublish.constantvzw.org/images/var/albums/Relearn-2013/Screenshot%20from%20gijs%203.png
Letterwriter
A happy accident, a book found in Okno where Thomas was staying during the summer school:
http://git.constantvzw.org/?p=osp.relearn.gesturing-paths.git;a=blob_plain;f=letterwriter/DSC04811.JPG;hb=HEAD
http://git.constantvzw.org/?p=osp.relearn.gesturing-paths.git;a=blob_plain;f=letterwriter/DSC04828.JPG;hb=HEAD
Letterwriter was designed by S. Robert Speel in 1982. It is a little BASIC program for the Spectrum ZX81 to emulate handwritten text. The program reads in a DATA file to generate the fonts. This projects takes the DATA file as a starting point to port the Letterwriter font to Metafont. The project consists essentially of two main files: one containing the bitmaps in decimal encoding and the other one containing the conversion script.
http://git.constantvzw.org/?p=osp.relearn.gesturing-paths.git;a=blob_plain;f=letterwriter/font-001-1.png;hb=HEAD
http://git.constantvzw.org/?p=osp.relearn.gesturing-paths.git;a=blob_plain;f=letterwriter/font-003-1.png;hb=HEAD
http://git.constantvzw.org/?p=osp.relearn.gesturing-paths.git;a=blob_plain;f=letterwriter/font-04-0.png;hb=HEAD
http://git.constantvzw.org/?p=osp.relearn.gesturing-paths.git;a=blob_plain;f=letterwriter/font-004-1.png;hb=HEAD