Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Metafont
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== The following example creates a closed beanlike shape for the character "B" of a font: <syntaxhighlight lang="matlab"> %file name: beta.mf %mode_setup; % Define a beanlike shape for the character B beginchar("B",11pt#,11pt#,0); % Setup coordinates as an equation system y1=y2=y3=0; y4=y5=y6=h; x1=x4=0; x2=x5=w; x3=x6=2*w; % Define pen pickup pencircle xscaled 0.2w yscaled 0.04w rotated 45; % Draw the character curve % z1 is the same as (x1, y1) draw z1..z3..z6{z2-z6}..z5..{z4-z2}z4..cycle; endchar; end </syntaxhighlight> This yields the following glyph: [[File:metafont-example-output.svg|284px|class=skin-invert]] The above example will be processed with a command line such as:<ref name=grandsir>{{cite web|url=http://metafont.tutorial.free.fr/|title=METAFONT Tutorial|author=Christophe Grandsir}}</ref> <syntaxhighlight lang=bash> mf '\mode=ljfour; mode_setup; input beta.mf'; gftopk beta.600gf beta.600pk </syntaxhighlight> Then it can be used in a LaTeX file such as the following<ref name=grandsir/> (all files should dwell in the same directory, or the TeX system should be informed about them using appropriate methods): <syntaxhighlight lang="latex"> \documentclass{article} \newfont{\letterbeta}{beta} \newcommand{\otherbeta}{{\letterbeta B}} \begin{document} Let's try having a strange \otherbeta\ here. \end{document} </syntaxhighlight> The resulting PDF file should look like this: [[File:Tex mf beta.pdf|187px]]
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Metafont
(section)
Add topic