Environment variables / Genero environment variables |
Defines the search paths for VM server image files.
The FGLIMAGEPATH environment variable is used by the runtime system, to find image resources on the server where the program executes, when the image name specified in the form element is not an URL that can be directly resolved and fetched by the front-end.
Image resources found through FGLIMAGEPATH will be transmitted to the front-end for display.
FGLIMAGEPATH defines a list of directories and/or image-to-font-glyph mapping files: If a path of FGLIMAGEPATH is a directory, it will be used for image file and font file lookup. If the element is a file name, it will be used as an image-to-font-glyph mapping file.When executing on a mobile device, the environment variables must be defined with mobile.environment FGLPROFILE entries. The FGLAPPDIR and FGLDIR environment variables are automatically defined by the front-end component, and can be referenced with the $FGLAPPDIR and $FGLDIR placeholders, when defining FGLIMAGEPATH in FGLPROFILE:
mobile.environment.FGLIMAGEPATH = "$FGLAPPDIR/myimages:$FGLAPPDIR/icons/myimage2font.txt:$FGLDIR/lib/image2font.txt"
For more details about environment variable settings for mobile apps, see Setting environment variables in FGLPROFILE (mobile).
It is possible to mix several image file directories with several image-to-font-glyph mapping files in FGLIMAGEPATH:
The list of mapping files and directories defines the order of precedence to resolve conflicts, when several image names can resolve to several image resources.
/opt/myapp/images:/opt/myapp/image2font.txt
If the /opt/myapp/images directory contains an image file "smiley.png", and the /opt/myapp/image2font.txt file contains a mapping for "smiley", the "smiley.png" file from /opt/myapp/images will be selected by the runtime system.
/opt/myapp/image2font.txt:/opt/myapp/images
The mapping for smiley to font glyph would take precedence.
FGLIMAGEPATH must contain a list of paths, separated by the operating system specific path separator. The path separator is ":" on UNIX™ platforms and ";" on Windows® platforms.
$ export FGLIMAGEPATH="/var/myapp/myimages:$FGLDIR/lib/image2font.txt"
Image names can be mapped to font glyphs when at least one file path is specified in FGLIMAGEPATH. The runtime system distinguishes file paths (as image-to-font-glyph mapping files), from directory paths (as locations to file plain image files and font files).
A default mapping file ("image2font.txt") and its corresponding font file ("FontAwesome.ttf") are provided in FGLDIR/lib. If FGLIMAGEPATH is not defined, the runtime system will use these files to make the image to font glyph mapping.
The image-to-font-glyph mapping file must have the following syntax:
image-name=font-file:hexa-ordinal[:color-spec]
Lines starting with the # sharp character are considered as comment lines and ignored.
For example:
# Common icons camera=FontAwesome.ttf:f030 file=FontAwesome.ttf:f0f6:#8B0000 smiley=FontAwesome.ttf:f118:yellow # Traffic lights circle-red=FontAwesome.ttf:f111:red circle-orange=FontAwesome.ttf:f111:orange circle-green=FontAwesome.ttf:f111:green
For applications executing on a server and displaying on GDC/GMA/GMI front-ends in client/server mode (not through the GAS), you can use the FGLIMAGEPATH environment variable to locate the HTML files of gICAPI web components on the server. Like image resources, the web component files will be automatically transferred to the front-end.