Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
FabriceSalvaire committed Sep 15, 2014
1 parent dd5965e commit e70c1b1
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 59 deletions.
61 changes: 37 additions & 24 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@
<!-- .. _PyDvi@pypi: https://pypi.python.org/pypi/PyDVI -->
<!-- End -->
<!-- -*- Mode: rst -*- -->
<!-- an extended version of pdfTeX using Lua as an embedded scripting language -->
<!-- A DVI-to-PNG converter -->
<!-- End -->
<div class="section" id="pydvi">
<h1>PyDvi</h1>
Expand All @@ -367,35 +369,46 @@ <h1>PyDvi</h1>
</div>
<div class="section" id="introduction">
<h1>Introduction</h1>
<p>PyDvi is a <a class="reference external" href="http://python.org">Python</a> library that provides tools to read TeX DVI file, Packed Font and TeX Font
Metric, Font Map and Font Encoding. The library provides a DVI Machine base class hat can be plugged
to a TeX Daemon instance in order to render on-the-fly TeX inputs.</p>
<!-- is able to ... -->
<!-- link to TUG -->
<p>PyDvi is a <a class="reference external" href="http://python.org">Python</a> module which is able to read the DVI (DeVice Independent) file format, the
native output of the famous TeX typesetting program implemented by <a class="reference external" href="http://www-cs-faculty.stanford.edu/~uno">Donald E. Knuth</a>.</p>
<p>PyDvi is also able to read most of the file formats associated to the TeX world like Packed Font,
TeX Font Metric, Font Map and Font Encoding.</p>
<p>Basically a DVI file describes the layout of a page by a list of opcodes that interact with a
register machine to update the position on the page, to load fonts and to paint glyphs and rules. In
short it contains the glyphs and their positions on the page. Since TeX was designed to layout the
series of books <em>The Art of Computer Programming</em> at the beginning of the eighties, it focuses on
texts and mathematical expressions. Thus DVI is much simpler than Postscript or its successor PDF
which are designed for graphics. However we can extend the capabilities of DVI using the <em>special</em>
opcode which can contains any text like Postscript snippets.</p>
<p>A DVI stream can come from a file or a TeX daemon in order to render TeX inputs on-the-fly.</p>
<p>The DVI parser of PyDvi builds a program from a DVI stream that could be later processed by the
provided DVI machine which is designed to be subclassed by the user.</p>
<p>The source code includes as exemple an experimental DVI viewer which uses the OpenGL API for the
rendering and thus feature an hardware accelerated rendering. PyDvi and the viewer can be used as an
platform to experiment complex text rendering on GPU.</p>
<!-- The aim of PyDvi is multiple -->
<p>PyDvi can be user for several purpose, we will review them in the followings:</p>
<p>TeX is a major and historical typesetting program. PyDvi can serve to read and process its output
using Python. The user can be a curious pearson who want to lean TeX or somebody interested by TeX
postprocessing.</p>
<p>TeX is one of the oldest computer program still in activity. The reason is quite simple, these
algorithms do the right job, its ecosystem is rich and its code is not so simple. Thus nobody
succeeds to reimplement it up to now, excepted its mathematical layout algorithms by the <a class="reference external" href="http://www.mathjax.org">MathJax</a>
Javascript library which is intended to bring Mathematical layout to web browser. Before the
delivery of Mathjax, the only solution to render properly mathematical content was to generate an
image using a program like <a class="reference external" href="http://savannah.nongnu.org/projects/dvipng">Dvipng</a>. It is what does the engine of Wikipedia behind the
scene. <a class="reference external" href="http://matplotlib.org">Matplotlib</a> uses also this approach to render LaTeX labels. Usually these programs like
<a class="reference external" href="http://asymptote.sourceforge.net">Asymptote</a> or <a class="reference external" href="https://ece.uwaterloo.ca/~aplevich/Circuit_macros">Circuit_macros</a> generate the graphics as a PDF document and then include this
document in a LaTeX document which contains the labels placed at absolute postion in the page. With
PyDvi we can try another approach which consists to send TeX content to a daemon and get back the
glyphs and their positions.</p>
<!-- -*- Mode: rst -*- -->
<div class="section" id="to-go-further">
<h2>To Go Further</h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Warning:</th><td class="field-body">The development of PyDvi is on standby since several years now.</td>
</tr>
</tbody>
</table>
<p>Some idea to go further:</p>
<ul class="simple">
<li>implement an OpenGL based viewer, actual Qt rendering is inefficient</li>
<li>use Freetype to render the glyph, cf. <a class="reference external" href="http://code.google.com/p/freetype-gl">http://code.google.com/p/freetype-gl</a> and distance field
rendering technique</li>
<li>review the font manager</li>
<li>review the DVI machine</li>
<li>review everything</li>
<li>try pypy</li>
</ul>
<!-- End -->
<!-- End -->
<!-- -*- Mode: rst -*- -->
</div>
</div>
<div class="section" id="installation">
<span id="installation-page"></span><h1>Installation</h1>
<p>The installation of PyDvi by itself is quite simple. However it will be easier to get the
Expand Down
86 changes: 71 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,35 @@
.. |Sphinx| replace:: Sphinx
.. _Sphinx: http://sphinx-doc.org

.. |TUG| replace:: TeX User Group
.. _TUG: http://sphinx-doc.org

.. an extended version of pdfTeX using Lua as an embedded scripting language
.. |LuaTeX| replace:: LuaTeX
.. _LuaTeX: http://www.luatex.org

.. |Knuth| replace:: Donald E. Knuth
.. _Knuth: http://www-cs-faculty.stanford.edu/~uno

.. |MathJax| replace:: MathJax
.. _MathJax: http://www.mathjax.org

.. A DVI-to-PNG converter
.. |Dvipng| replace:: Dvipng
.. _Dvipng: http://savannah.nongnu.org/projects/dvipng

.. |Matplotlib| replace:: Matplotlib
.. _Matplotlib: http://matplotlib.org

.. |PGF| replace:: PGF
.. _PGF: http://sourceforge.net/projects/pgf

.. |Asymptote| replace:: Asymptote
.. _Asymptote: http://asymptote.sourceforge.net

.. |Circuit_macros| replace:: Circuit_macros
.. _Circuit_macros: https://ece.uwaterloo.ca/~aplevich/Circuit_macros

.. End
=========
Expand All @@ -79,26 +108,53 @@ Written by `Fabrice Salvaire <http://fabrice-salvaire.pagesperso-orange.fr>`_.
Introduction
==============

PyDvi is a |Python|_ library that provides tools to read TeX DVI file, Packed Font and TeX Font
Metric, Font Map and Font Encoding. The library provides a DVI Machine base class hat can be plugged
to a TeX Daemon instance in order to render on-the-fly TeX inputs.
.. is able to ...
.. link to TUG
.. -*- Mode: rst -*-
PyDvi is a |Python|_ module which is able to read the DVI (DeVice Independent) file format, the
native output of the famous TeX typesetting program implemented by |Knuth|_.

PyDvi is also able to read most of the file formats associated to the TeX world like Packed Font,
TeX Font Metric, Font Map and Font Encoding.

Basically a DVI file describes the layout of a page by a list of opcodes that interact with a
register machine to update the position on the page, to load fonts and to paint glyphs and rules. In
short it contains the glyphs and their positions on the page. Since TeX was designed to layout the
series of books *The Art of Computer Programming* at the beginning of the eighties, it focuses on
texts and mathematical expressions. Thus DVI is much simpler than Postscript or its successor PDF
which are designed for graphics. However we can extend the capabilities of DVI using the *special*
opcode which can contains any text like Postscript snippets.

A DVI stream can come from a file or a TeX daemon in order to render TeX inputs on-the-fly.

To Go Further
-------------
The DVI parser of PyDvi builds a program from a DVI stream that could be later processed by the
provided DVI machine which is designed to be subclassed by the user.

:Warning: The development of PyDvi is on standby since several years now.
The source code includes as exemple an experimental DVI viewer which uses the OpenGL API for the
rendering and thus feature an hardware accelerated rendering. PyDvi and the viewer can be used as an
platform to experiment complex text rendering on GPU.

Some idea to go further:
.. The aim of PyDvi is multiple
* implement an OpenGL based viewer, actual Qt rendering is inefficient
* use Freetype to render the glyph, cf. http://code.google.com/p/freetype-gl and distance field
rendering technique
* review the font manager
* review the DVI machine
* review everything
* try pypy
PyDvi can be user for several purpose, we will review them in the followings:

TeX is a major and historical typesetting program. PyDvi can serve to read and process its output
using Python. The user can be a curious pearson who want to lean TeX or somebody interested by TeX
postprocessing.

TeX is one of the oldest computer program still in activity. The reason is quite simple, these
algorithms do the right job, its ecosystem is rich and its code is not so simple. Thus nobody
succeeds to reimplement it up to now, excepted its mathematical layout algorithms by the |Mathjax|_
Javascript library which is intended to bring Mathematical layout to web browser. Before the
delivery of Mathjax, the only solution to render properly mathematical content was to generate an
image using a program like |Dvipng|_. It is what does the engine of Wikipedia behind the
scene. |Matplotlib|_ uses also this approach to render LaTeX labels. Usually these programs like
|Asymptote|_ or |Circuit_macros|_ generate the graphics as a PDF document and then include this
document in a LaTeX document which contains the labels placed at absolute postion in the page. With
PyDvi we can try another approach which consists to send TeX content to a daemon and get back the
glyphs and their positions.

.. -*- Mode: rst -*-
.. End
Expand Down
29 changes: 29 additions & 0 deletions doc/sphinx/source/abbreviation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,33 @@
.. |Sphinx| replace:: Sphinx
.. _Sphinx: http://sphinx-doc.org

.. |TUG| replace:: TeX User Group
.. _TUG: http://sphinx-doc.org

.. an extended version of pdfTeX using Lua as an embedded scripting language
.. |LuaTeX| replace:: LuaTeX
.. _LuaTeX: http://www.luatex.org

.. |Knuth| replace:: Donald E. Knuth
.. _Knuth: http://www-cs-faculty.stanford.edu/~uno

.. |MathJax| replace:: MathJax
.. _MathJax: http://www.mathjax.org

.. A DVI-to-PNG converter
.. |Dvipng| replace:: Dvipng
.. _Dvipng: http://savannah.nongnu.org/projects/dvipng

.. |Matplotlib| replace:: Matplotlib
.. _Matplotlib: http://matplotlib.org

.. |PGF| replace:: PGF
.. _PGF: http://sourceforge.net/projects/pgf

.. |Asymptote| replace:: Asymptote
.. _Asymptote: http://asymptote.sourceforge.net

.. |Circuit_macros| replace:: Circuit_macros
.. _Circuit_macros: https://ece.uwaterloo.ca/~aplevich/Circuit_macros

.. End
15 changes: 0 additions & 15 deletions doc/sphinx/source/features.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
.. -*- Mode: rst -*-
To Go Further
-------------

:Warning: The development of PyDvi is on standby since several years now.

Some idea to go further:

* implement an OpenGL based viewer, actual Qt rendering is inefficient
* use Freetype to render the glyph, cf. http://code.google.com/p/freetype-gl and distance field
rendering technique
* review the font manager
* review the DVI machine
* review everything
* try pypy

.. End
48 changes: 45 additions & 3 deletions doc/sphinx/source/introduction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,51 @@
Introduction
==============

PyDvi is a |Python|_ library that provides tools to read TeX DVI file, Packed Font and TeX Font
Metric, Font Map and Font Encoding. The library provides a DVI Machine base class hat can be plugged
to a TeX Daemon instance in order to render on-the-fly TeX inputs.
.. is able to ...
.. link to TUG
PyDvi is a |Python|_ module which is able to read the DVI (DeVice Independent) file format, the
native output of the famous TeX typesetting program implemented by |Knuth|_.

PyDvi is also able to read most of the file formats associated to the TeX world like Packed Font,
TeX Font Metric, Font Map and Font Encoding.

Basically a DVI file describes the layout of a page by a list of opcodes that interact with a
register machine to update the position on the page, to load fonts and to paint glyphs and rules. In
short it contains the glyphs and their positions on the page. Since TeX was designed to layout the
series of books *The Art of Computer Programming* at the beginning of the eighties, it focuses on
texts and mathematical expressions. Thus DVI is much simpler than Postscript or its successor PDF
which are designed for graphics. However we can extend the capabilities of DVI using the *special*
opcode which can contains any text like Postscript snippets.

A DVI stream can come from a file or a TeX daemon in order to render TeX inputs on-the-fly.

The DVI parser of PyDvi builds a program from a DVI stream that could be later processed by the
provided DVI machine which is designed to be subclassed by the user.

The source code includes as exemple an experimental DVI viewer which uses the OpenGL API for the
rendering and thus feature an hardware accelerated rendering. PyDvi and the viewer can be used as an
platform to experiment complex text rendering on GPU.

.. The aim of PyDvi is multiple
PyDvi can be user for several purpose, we will review them in the followings:

TeX is a major and historical typesetting program. PyDvi can serve to read and process its output
using Python. The user can be a curious pearson who want to lean TeX or somebody interested by TeX
postprocessing.

TeX is one of the oldest computer program still in activity. The reason is quite simple, these
algorithms do the right job, its ecosystem is rich and its code is not so simple. Thus nobody
succeeds to reimplement it up to now, excepted its mathematical layout algorithms by the |Mathjax|_
Javascript library which is intended to bring Mathematical layout to web browser. Before the
delivery of Mathjax, the only solution to render properly mathematical content was to generate an
image using a program like |Dvipng|_. It is what does the engine of Wikipedia behind the
scene. |Matplotlib|_ uses also this approach to render LaTeX labels. Usually these programs like
|Asymptote|_ or |Circuit_macros|_ generate the graphics as a PDF document and then include this
document in a LaTeX document which contains the labels placed at absolute postion in the page. With
PyDvi we can try another approach which consists to send TeX content to a daemon and get back the
glyphs and their positions.

.. include:: features.txt

Expand Down
4 changes: 4 additions & 0 deletions doc/sphinx/source/reference-manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

This is the auto-generated API documentation for the PyDvi library.

.. note:: The docstings and the code need a review. Most of the code was written a long time ago
(for Python 2.4).

.. warning:: The API documentation is automatically generated from the docstrings in the source
using the |Sphinx| tool. This way to produce the documentation is know to be perfectible
actually, but not too bad.
Expand All @@ -18,6 +21,7 @@ Contents:
:maxdepth: 2

api/PyDvi
api/PyDviGui

Indexes
-------
Expand Down
2 changes: 2 additions & 0 deletions github-title.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PyDvi is a Python module which is able to read DVI files generated by LaTeX and files like packed font, tex font metric, font map and font encoding. The module provides a DVI machine as a base class which can be extended by the user and plugged to a TeX daemon in order to render contents on-the-fly. Also the source code provides as example a DVI viewer featuring an hardware accelerated rendering on GPU.

4 changes: 2 additions & 2 deletions setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

source ${HOME}/python-virtual-env/standard/bin/activate

append_to_python_path_if_not $PWD

append_to_python_path_if_not $HOME/PyOpenGLng
append_to_ld_library_path_if_not /usr/local/stow/freetype-2.5.2/lib

append_to_python_path_if_not $PWD

####################################################################################################
#
# End
Expand Down

0 comments on commit e70c1b1

Please sign in to comment.