File:Metafont-example-output.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 568 × 247 pixels, file size: 3 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: To create the image, put the following code in mfont.mf (from w:Metafont's Example section)
    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
      draw z1..z3..z6{z2-z6}..z5..{z4-z2}z4..cycle;
    endchar;
    
    end
    

    and the following code in main.tex

    \documentclass{article}
    \newfont{\obrfont}{mfont}
    
    \begin{document}
    
    \pagestyle{empty}
    
    \begin{center}
    {\obrfont B}
    \end{center}
    
    \end{document}
    

    Put those two files in the same directory, compile with these commands:

    $ latex main
    $ dvisvgm -n1 -e -Z0.1 main
    
    The end result is the file main.svg
    Date
    Source Own work
    Author ngoclong19

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
    The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.


    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    17 July 2015

    2,696 byte

    image/svg+xml

    a7d1dbbd03d6fd2ff574c7deaa808bf20d0832b8

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current04:20, 17 July 2015Thumbnail for version as of 04:20, 17 July 2015568 × 247 (3 KB)wikimediacommons>Ngoclong19User created page with UploadWizard

    There are no pages that use this file.