Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ps_hyphenate(3) [php man page]

PS_HYPHENATE(3) 							 1							   PS_HYPHENATE(3)

ps_hyphenate - Hyphenates a word

SYNOPSIS
array ps_hyphenate (resource $psdoc, string $text) DESCRIPTION
Hyphenates the passed word. ps_hyphenate(3) evaluates the value hyphenminchars (set by ps_set_value(3)) and the parameter hyphendict (set by ps_set_parameter(3)). hyphendict must be set before calling this function. This function requires the locale category LC_CTYPE to be set properly. This is done when the extension is initialized by using the envi- ronment variables. On Unix systems read the man page of locale for more information. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $text -$text should not contain any non alpha characters. Possible positions for breaks are returned in an array of interger numbers. Each number is the position of the char in $text after which a hyphenation can take place. RETURN VALUES
An array of integers indicating the position of possible breaks in the text or FALSE on failure. EXAMPLES
Example #1 Hyphennate a text <?php $word = "Koordinatensystem"; $psdoc = ps_new(); ps_set_parameter($psdoc, "hyphendict", "hyph_de.dic"); $hyphens = ps_hyphenate($psdoc, $word); for($i=0; $i<strlen($word); $i++) { echo $word[$i]; if(in_array($i, $hyphens)) echo "-"; } ps_delete($psdoc); ?> The above example will output: Ko-ordi-na-ten-sys-tem SEE ALSO
ps_show_boxed(3), locale(1). PHP Documentation Group PS_HYPHENATE(3)

Check Out this Related Man Page

PS_GET_PARAMETER(3)							 1						       PS_GET_PARAMETER(3)

ps_get_parameter - Gets certain parameters

SYNOPSIS
string ps_get_parameter (resource $psdoc, string $name, [float $modifier]) DESCRIPTION
Gets several parameters which were directly set by ps_set_parameter(3) or indirectly by one of the other functions. Parameters are by def- inition string values. This function cannot be used to retrieve resources which were also set by ps_set_parameter(3). The parameter $name can have the following values. o fontname - The name of the currently active font or the font whose identifier is passed in parameter $modifier. o fontencoding - The encoding of the currently active font. o dottedversion - The version of the underlying pslib library in the format <major>.<minor>.<subminor> o scope - The current drawing scope. Can be object, document, null, page, pattern, path, template, prolog, font, glyph. o ligaturedisolvechar - The character which dissolves a ligature. If your are using a font which contains the ligature `ff' and `|' is the char to dissolve the ligature, then `f|f' will result in two `f' instead of the ligature `ff'. o imageencoding - The encoding used for encoding images. Can be either hex or 85. hex encoding uses two bytes in the postscript file each byte in the image. 85 stand for Ascii85 encoding. o linenumbermode - Set to paragraph if lines are numbered within a paragraph or box if they are numbered within the surrounding box. o linebreak - Only used if text is output with ps_show_boxed(3). If set to TRUE a carriage return will add a line break. o parbreak - Only used if text is output with ps_show_boxed(3). If set to TRUE a carriage return will start a new paragraph. o hyphenation - Only used if text is output with ps_show_boxed(3). If set to TRUE the paragraph will be hyphenated if a hypen dic- tionary is set and exists. o hyphendict - Filename of the dictionary used for hyphenation pattern. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $name - Name of the parameter. o $modifier - An identifier needed if a parameter of a resource is requested, e.g. the size of an image. In such a case the resource id is passed. RETURN VALUES
Returns the value of the parameter or FALSE on failure. SEE ALSO
ps_set_parameter(3). PHP Documentation Group PS_GET_PARAMETER(3)
Man Page