Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1:   // This is a roxen module. Copyright © 1996 - 2000, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.214 2000/03/16 01:35:36 mast Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.215 2000/03/16 03:01:23 nilsson Exp $";      #include <module.h>   inherit "module";   inherit "roxenlib";         // ------------------- Module registration ---------------------      constant module_type = MODULE_PARSER;   constant module_name = "Graphics text";
Roxen.git/server/modules/graphics/graphic_text.pike:43: Inside #if defined(manual)
  <attr name=alpha value=path>    Use the specified image as an alpha channel, together with the    background attribute.   </attr>      <attr name=background value=path>    Specifies the image to use as background.   </attr>      <attr name=bevel value=width> -  Draws a bevel box. +  Draws a bevel-box around the text. +  <ex type=vert> + <gtext bevel=\"2\">Ok</gtext> +  </ex>   </attr>      <attr name=bgcolor value=color>    Sets the background color. Normally taken from the normal HTML tags    in your document (Currently: body, table, tr or td).       <p>If you set the background color, it is probably best to add the    notrans attribute as well.</p>    <ex type=vert>   <gtext notrans=\"\" bgcolor=\"pink\">Pink</gtext>   <gtext notrans=\"\" bgcolor=\"#ff0000\">Red</gtext>   <gtext notrans=\"\" bgcolor=\"%50,0,100,0\">%50,0,100,0</gtext>    </ex>   </attr>      <attr name=bgturbulence value=frequency,color;frequency,color...> -  Apply a turbulence effect. +  Apply a turbulence effect on the background.   </attr>      <attr name=black>    Use a black, or heavy, version of the font, if available.   </attr>      <attr name=bold>    Use a bold version of the font, if available.   </attr>      <attr name=bshadow value=distance>    Draw a blured black drop-shadow behind the text. Using 0 as distance    does not currently place the shadow directly below the text. Using    negative values for distance is possible, but you might have to add    'spacing'.    <ex type=vert> - <gtext scale=\"0.8\" fgcolor=\"#FF6600\" quant=\"200\" bshadow=\"1\">&lt;gtext bshadow=1&gt;</gtext><br /> - <gtext scale=\"0.8\" fgcolor=\"#FF6600\" quant=\"200\" bshadow=\"2\">&lt;gtext bshadow=2&gt;</gtext> + <gtext scale=\"0.8\" fgcolor=\"#FF6600\" bshadow=\"1\">&lt;gtext bshadow=1&gt;</gtext><br /> + <gtext scale=\"0.8\" fgcolor=\"#FF6600\" bshadow=\"2\">&lt;gtext bshadow=2&gt;</gtext>    </ex>   </attr>      <attr name=chisel>    Make the text look like it has been cut into the background.    <ex type=vert> - <gtext bold=\"\" quant=\"200\" ypad=\"-40%\" xpad=\"-20%\" chisel=\"\" talign=\"center\" + <gtext bold=\"\" ypad=\"-40%\" xpad=\"-20%\" chisel=\"\" talign=\"center\"   opaque=\"70\" fgcolor=\"gold\" bevel=\"2\" background=\"tiles.jpg\"> Chisel   opaque=70</gtext>    </ex>   </attr>      <attr name=crop>    Remove all white-space around the image   </attr>    - <attr name=encoding> -  + <attr name=encoding value=string> +  Choose with which charset the text is encoded with.   </attr>      <attr name=fadein value=blur,steps,delay,initialdelay>    Generates an animated GIF file of a fade-in effect.   </attr>      <attr name=fgcolor value=color>    Sets the text color. -  +     <ex type=vert>   <gtext fgcolor=\"#0080FF\">#0080FF</gtext>    </ex>   </attr>    - <attr name=font> + <attr name=font value=string>      </attr>    - <attr name=font_size> + <attr name=font_size value=int>      </attr>    - <attr name=format> -  + <attr name=format value=string> +  Set the image format, e.g. \"png\".   </attr>      <attr name=fs>    Apply floyd-steinberg dithering to the resulting image. Most of the    time it is much better to increase the number of colors, instead of    dithering the image, but sometimes when using very complex background    images dithering is O.K.   </attr>      <attr name=ghost value=dist,blur,color>    Apply a ghost effect. Cannot be used together with shadow or magic    coloring.    <ex type=vert> - <gtext spacing=\"2\" crop=\"\" quant=\"200\" ghost=\"1,1,red\">ghost=1,1,red</gtext> - <gtext spacing=\"2\" crop=\"\" quant=\"200\" ghost=\"1,3,blue\">ghost=1,3,blue</gtext> + <gtext spacing=\"2\" crop=\"\" ghost=\"1,1,red\">ghost=1,1,red</gtext> + <gtext spacing=\"2\" crop=\"\" ghost=\"1,3,blue\">ghost=1,3,blue</gtext>   <gtext spacing=\"2\" crop=\"\" bshadow=\"1\" opaque=\"90\" ghost=\"-1,1,yellow\">ghost=-1,1,yellow opaque=90 bshadow=1</gtext>    </ex>   </attr>      <attr name=glow value=color>    Apply a 'glow' filter to the image. Quite a CPU eater. Looks much    better on a dark background, where a real 'glow' effect can be    achieved.    <ex type=vert> - <gtext quant=\"200\" glow=\"red\">&lt;gtext glow=red&gt;</gtext> + <gtext glow=\"red\">&lt;gtext glow=red&gt;</gtext>    </ex>   </attr>      <attr name=italic>    Use an italic version of the font, if available.   </attr>      <attr name=light>    Use a light version of the font, if available.   </attr>
Roxen.git/server/modules/graphics/graphic_text.pike:173: Inside #if defined(manual)
   Tiles the background and foreground images around x-axis and y-axis    for odd frames, creating seamless textures.   </attr>      <attr name=move value=x,y>    Moves the text relative to the upper left corner of the background    image. This will not change the size of the image.   </attr>      <attr name=narrow> -  +  Use a narroe version of the font, if available.   </attr>      <attr name=nfont value=fontname>    Select a font using somewhat more memonic font-names. You can get a    font-list by accessing the configuration interface.       <p>There are several modifiers available: bold, italic, black and light.    If the requested version of the font is available, it will be used to    render the text, otherwise the closest match will be used.</p>   
Roxen.git/server/modules/graphics/graphic_text.pike:206: Inside #if defined(manual)
  <attr name=notrans>    Do not make the background transparent. Useful when making 'boxes' of    color around the text.    <ex type=vert>   <gtext bgcolor=\"red\">&lt;gtext bgcolor=red&gt;</gtext>   <gtext bgcolor=\"red\" notrans=\"\">&lt;gtext bgcolor=red notrans&gt;</gtext>    </ex>   </attr>      <attr name=nowhitespace> -  +  Removes all whitespaces before and after the real text.   </attr>      <attr name=opaque value=percentage> -  Generate text with this amount of opaqueness. 100% is default. -  <ex> - <gtext fgcolor=\"blue\" opaque=\"50\">Opaque</gtext> +  Sets the 'opaque' value of the color used to draw the text. Default is 100%. +  In the example below, notice how the text color mixes with the two background colors +  <ex type=vert> + <gtext scale=\"0.6\" textbox=\"100,pink,-11\" bgcolor=\"lightblue\" +  notrans=\"\" opaque=\"40\" fgcolor=\"black\">&lt;Demonstration of opaque text&gt;</gtext>    </ex>   </attr>    - <attr name=outline> -  + <attr name=outline value=color,extra-radius> +  Draw an outline around the text. Quite useful when combined with textscale. +  <ex type=vert> + <gtext xspacing=\"4\" textscale=\"red,red,yellow,yellow\" outline=\"black,1\">black, 2 pixels</gtext> +  </ex>   </attr>      <attr name=pressed>    Inverts the direction of the bevel box, to make it look like a button -  that is pressed down. +  that is pressed down. The magic modifier will do this automatically.   </attr>      <attr name=quant value=number> -  Use this number of colors in the generated image. For GIF images, -  fewer colors implies smaller images but also aliasing effects. It is -  advisable to use powers of 2 to optimize the palette allocation. +  Quantifies the image with this number of colors. Using a lower number will decrease +  the image (file)size, but make the text look more 'edgy', and if you use complex +  backgrounds or image textures, more colors will be neded. At most 255 colors can +  be used, and less than 2 is quite useless. It is advisable to use powers of 2 to +  optimize the palette allocation. +  <ex type=vert> + <gtext quant=\"2\">A</gtext> + <gtext quant=\"6\">A</gtext> + <gtext quant=\"20\">A</gtext> + <gtext quant=\"200\">A</gtext> +  </ex>   </attr>      <attr name=rescale>    Rescale the background to fill the whole image.   </attr>      <attr name=rotate value=angle>    Rotates the image this number of degrees counter-clockwise.   </attr>   
Roxen.git/server/modules/graphics/graphic_text.pike:256: Inside #if defined(manual)
     <attr name=scolor value=color>    Use this color for the shadow. Used with the shadow attribute.   </attr>      <attr name=scroll value=width,steps,delay>    Generate an animated GIF image of the text scrolling.   </attr>      <attr name=shadow value=intensity,distance> -  Draw a drop-shadow with the specified intensity and distance. The -  intensity is specified as a percentage. +  Draw a blured black drop-shadow behind the text. Using 0 as distance +  does not currently place the shadow directly below the text. Using negative +  values for distance is possible, +  <ex type=vert> + <gtext scale=\"0.8\" fgcolor=\"blue\" shadow=\"40,0\">&lt;gtext shadow=40,0&gt;</gtext><br /> + <gtext scale=\"0.8\" fgcolor=\"blue\" shadow=\"40,2\">&lt;gtext shadow=40,2&gt;</gtext><br /> +  </ex>   </attr>      <attr name=size value=width,height>    Set the size of the image.   </attr>      <attr name=spacing value=number>    Add space around the text.   </attr>      <attr name=talign value=left,right,center>    Adjust the alignment of the text.   </attr>      <attr name=textbelow value=color>    Place the text centered in a box of the given color below the image    area. Useful together with background to make captions for images. -  +  <ex type=vert> + <gtext scale=\"0.5\" background=\"internal-roxen-roxen\" textbelow=\"#c0c0c0\">Roxen</gtext> +  </ex>   </attr>      <attr name=textbox value=opaque,color>    Draw a box with an opaque value below the text of the specified color.   </attr>    -  + <attr name=textscale value=color,color,color,color> +  Apply a color filter to the text. The colors are, +  respectively, upper left, lower left, upper right and lower right. +  It is probably a good idea to increase the 'quant' value when +  using this argument. +  <ex type=vert> + <gtext textscale=\"blue,red,black,darkgreen\">Blue, red, black, darkgreen</gtext> +  </ex> + </attr> +    <attr name=texture value=path>    Uses the specified images as a field texture.   </attr>      <attr name=tile>    Tiles the background and foreground images if they are smaller than    the actual image.   </attr>      <attr name=verbatim>    Allows the gtext parser to not be typographically correct.   </attr>      <attr name=xpad value=percentage> -  Increases padding between characters. +  Sets the padding between characters. +  <ex type=vert> + <gtext xpad=\"-30%\" scale=\"0.6\">&lt;gtext xpad=-30%&gt;</gtext><br /> + <gtext xpad=\"-10%\" scale=\"0.6\">&lt;gtext xpad=-10%&gt;</gtext><br /> + <gtext scale=\"0.6\">&lt;gtext&gt;</gtext><br /> + <gtext xpad=\"10%\" scale=\"0.6\">&lt;gtext xpad=10%&gt;</gtext><br /> + <gtext xpad=\"30%\" scale=\"0.6\">&lt;gtext xpad=30%&gt;</gtext><br /> +  </ex>   </attr>      <attr name=xsize value=number>    Sets the width.   </attr>      <attr name=xspacing value=number>    Sets the horizontal spacing.   </attr>    - <attr name=ypad> -  + <attr name=ypad value=percentage> +  Sets the padding beteen lines.   </attr>      <attr name=ysize value=number>    Sets the height.   </attr>      <attr name=yspacing value=number>    Sets the vertical spacing.   </attr>";   constant tagdoc=([
Roxen.git/server/modules/graphics/graphic_text.pike:372: Inside #if defined(manual)
   will highlight the image when the mouse is moved over it. The message    is shown in the browser's status bar.    <ex type=vert>   <gtext href=\"http://www.roxen.com\" magic=\"Roxen\">www.roxen.com</gtext>    </ex>   </attr>      <attr name=magic-attribute value=value> Same as for any    <tag>gtext</tag> attribute, except for the highlighted image.    <ex type=vert> - <gtext fgcolor=\"blue\" magic-fgcolor=\"darkgreen\" magic=\"\">Magic_attribute</gtext> + <gtext fgcolor=\"blue\" magic-glow=\"yellow\" magic=\"\">Magic_attribute</gtext>    </ex>   </attr>      <attr name=noxml> -  +  Do not terminate the image tag with \"/\".   </attr>      <attr name=split>    <gtext scale=0.4 split>Make each word into a separate gif image.    Useful if you are writing a large text, and word wrap at the edges of    the display is desired. This text is an example (try resisizing your    browser window, the images should move just like normal text    would)</gtext>       <p>This will allow the browser to word-wrap the text, but will disable certain attributes like magic.</p>
Roxen.git/server/modules/graphics/graphic_text.pike:502:    }    res+="\n";    }    text=replace(res[..strlen(res)-2], ({"!","?",": "}),({ nbsp+"!",nbsp+"?",nbsp+": "}));    text=replace(replace(replace(text,({". ",". "+nbsp}),    ({"\000","\001"})),".","."+nbsp+nbsp),    ({"\000","\001"}),({". ","."+nbsp}));    }       if( args->afont ) -  font = resolve_font((args->afont||args->font)+" "+(args->font_size||32)); +  font = resolve_font((args->afont||args->font)+" "+(args["font-size"]||32));    else    {    int bold=0, italic=0;    if(args->nfont) args->font = args->nfont;    if(args->bold) bold=1;    if(args->light) bold=-1;    if(args->black) bold=2;    if(args->italic) italic=1;    font = get_font(args->font||"default", -  (int)(args->font_size||args["font-size"])||32, +  (int)args["font-size"]||32,    bold,    italic,    lower_case(args->talign||"left"),    (float)args->xpad,    (float)args->ypad);    }    if(!font)    font = resolve_font(0);       if (!font)
Roxen.git/server/modules/graphics/graphic_text.pike:624:    "black",    "bold",    "bshadow",    "chisel",    "crop",    "encoding",    "fadein",    "fgcolor",    "fs",    "font", -  "font_size", +  "font-size",    "format",    "ghost",    "glow",    "italic",    "light",    "mirrortile",    "move",    "narrow",    "nfont",    "notrans",