Skip to content

Correspondence Technologies

Sections
Personal tools
You are here: Home » Software » SfIndex Demo » collective - FontTool

Package: collective - FontTool

a test of SfIndex product

Sourceforge Info

Project Name: collective
Package Name: FontTool
Files Page:
Browse CVS: http://cvs.sourceforge.net/viewcvs.py/collective/FontTool/  

Package README (CVS ver. 1.1.1.2)

A simple font generating tool for zope/cmf. Currently this is used
with my menu generator to generate dynamic labels for menus in custom
fonts, but it can be used to generate and cache pretty much any text.

The model is that a Recipe object gets loaded into the font tool,
either TTW or (after some refactoring, or just dropping the
allowable_types constraint) using a custom class. This is just a
simple callable that can produce a graphic (and optionally cache it).

Manual invocation is simple enough:

    <img tal:replace="structure python: here.font_tool('simple_recipe',
    'Foo').tag()"/>

would render the text "Foo" according to whatever rules were in simple_recipe.


Some of the emitters in the menu tool can optionally delegate to this
tool by adding a recipe attribute.

For example the XML menu notation might look like this to use
simple_recipe with the top level node:


<menu name="sample_menu">
   <node title="ABOUT US" id="about_menu" action="${portal_url}/docs/about"
   recipe="simple_recipe">
       <node title="Contact" id="contact" action="${portal_url}/docs/contact"/>
       <node title="Employment" id="employment"
       action="${portal_url}/docs/employment"/>
   </node>
</menu>


With the correct emitter this should just work.

RECIPES
----------------------------------------
in the ZMI goto font_tool and click add recipe
goto its prop tab and play around

NOTE: the test code in the skin path relies on a 'test' recipe being
created but this is not done by the installer. If you need to test
this code add a recipe called 'test'.


DEPENDENCIES
----------------------------------------

PIL                    http://www.pythonware.com/products/pil/

Install these in the context of the python you use to run your Zope
instance.


FUTURE
----------------------------------------

I've started to move this to use a layer abstraction that rides just
over image. I would like to make this scriptable at the python level
and have recipes be modeled by either property recipes (like now) or
python scripts in the futre for the more complex cases.
 

Powered by Plone

This site conforms to the following standards: