Пример #1
0
            ps_symbol($ps, $j * 16 + $i);
            ps_moveto($ps, $leftmargin + $i * $colwidth + $colwidth / 2 - $textwidth / 2, $bottommargin + (15 - $j) * $rowheight + $rowheight / 2 + 3 - $fontsize / 2);
            ps_lineto($ps, $leftmargin + $i * $colwidth + $colwidth / 2 + $textwidth / 2, $bottommargin + (15 - $j) * $rowheight + $rowheight / 2 + 3 - $fontsize / 2);
            ps_stroke($ps);
        }
    }
    /* The name of the symbol */
    ps_setfont($ps, $psfont, 3);
    for ($j = 0; $j < 16; $j++) {
        for ($i = 0; $i < 16; $i++) {
            $text = ps_symbol_name($ps, $j * 16 + $i, $samplefont);
            ps_set_value($ps, "textx", $leftmargin + $i * $colwidth + 2);
            ps_set_value($ps, "texty", $bottommargin + (15 - $j) * $rowheight + 2);
            ps_show($ps, $text);
            $text = sprintf(" (%d)", $j * 16 + $i);
            ps_show($ps, $text);
        }
    }
    $text = "This fontsample matrix is created with the ps_symbol() function. It prints a glyph by its decimal value in the font encoding vector. pslib can use the TeXBase1 encoding (default) or the encoding shipped with the font itself, which is usually AdobeStandardEncoding. The above matrix uses the encoding of the font which is used when the parameter 'encoding' of ps_findfont() is set to 'builtin'. This usually results in a subset of all available glyphs of the font.\n\nQuite a lot of glyphs cannot be reached without the ps_symbol() function. The reason is simple: If text is output with ps_show(), then each character will be first mapped to a glyph by applying the ISO-8859-1 input encoding on it. Since ISO-8859-1 has less characters then a font usually provides glyphs, there will be some glyphs not reachable with regular text.";
    ps_setfont($ps, $psfont, 8);
    ps_set_value($ps, "leading", 12.0);
    ps_set_value($ps, "parindent", 12.0);
    ps_show_boxed($ps, $text, $leftmargin, $bottommargin - 250, $colwidth * 7.5, 230, "fulljustify", NULL);
    ps_setfont($ps, $samplefont, 8);
    ps_set_value($ps, "leading", 12.0);
    ps_set_value($ps, "parindent", 12.0);
    ps_show_boxed($ps, $text, $leftmargin + $colwidth * 8.5, $bottommargin - 250, $colwidth * 7.5, 230, "fulljustify", NULL);
    ps_end_page($ps);
}
ps_close($ps);
ps_delete($ps);
Пример #2
0
 }
 if (isset($_REQUEST['box13']) && $_REQUEST['box13'] == "true") {
     if ($x > 3) {
         $y -= 150;
         $x = 0;
     }
     begin_example_box($ps, LEFT_BORDER + (EXAMPLE_BOX_WIDTH + 30) * $x++, $y, "invisible Text", $psfont);
     ps_setfont($ps, $psfont, 10.0);
     ps_show_xy($ps, "This is ", 5, 15);
     ps_set_value($ps, "textrendering", 3);
     ps_show($ps, "invisible");
     ps_set_value($ps, "textrendering", -1);
     ps_show($ps, " text.");
     ps_show_xy($ps, "This is ", 5, 35);
     ps_show($ps, "invisible");
     ps_show($ps, " text.");
     end_example_box($ps);
 }
 if (isset($_REQUEST['box14']) && $_REQUEST['box14'] == "true") {
     if ($x > 3) {
         $y -= 150;
         $x = 0;
     }
     begin_example_box($ps, LEFT_BORDER + (EXAMPLE_BOX_WIDTH + 30) * $x++, $y, "Text in a box (1)", $psfont);
     ps_setfont($ps, $psfont, 8.0);
     ps_set_value($ps, "leading", 11);
     $str1 = "Text can be put into a box of any size. This one is 80x80 pixels and its lower left corner ist at (10, 10). The text is left justified. The font size is 8.0.";
     ps_show_boxed($ps, $str1, 10, 10, 80, 80, "left", NULL);
     end_example_box($ps);
 }
 if (isset($_REQUEST['box15']) && $_REQUEST['box15'] == "true") {
Пример #3
0
            for ($j = 0; $j < 16; $j++) {
                for ($i = 0; $i < 16; $i++) {
                    if ($glc + ($j * 16 + $i) < $listlen) {
                        $textwidth = ps_glyph_width($ps, $glyphlist[$glc + ($j * 16 + $i)], 0, $fontsamplesize);
                        ps_set_value($ps, "textx", $leftmargin + $i * $colwidth + $colwidth / 2 - $textwidth / 2);
                        ps_set_value($ps, "texty", $bottommargin + (15 - $j) * $rowheight + $rowheight / 2 + 3 - $fontsize / 2);
                        ps_glyph_show($ps, $glyphlist[$glc + ($j * 16 + $i)]);
                        ps_moveto($ps, $leftmargin + $i * $colwidth + $colwidth / 2 - $textwidth / 2, $bottommargin + (15 - $j) * $rowheight + $rowheight / 2 + 3 - $fontsize / 2);
                        ps_lineto($ps, $leftmargin + $i * $colwidth + $colwidth / 2 + $textwidth / 2, $bottommargin + (15 - $j) * $rowheight + $rowheight / 2 + 3 - $fontsize / 2);
                        ps_stroke($ps);
                    }
                }
            }
            /* The name of the symbol */
            ps_setfont($ps, $psfont, 3);
            for ($j = 0; $j < 16; $j++) {
                for ($i = 0; $i < 16; $i++) {
                    if ($glc + ($j * 16 + $i) < $listlen) {
                        ps_set_value($ps, "textx", $leftmargin + $i * $colwidth + 2);
                        ps_set_value($ps, "texty", $bottommargin + (15 - $j) * $rowheight + 2);
                        ps_show($ps, $glyphlist[$glc + ($j * 16 + $i)]);
                    }
                }
            }
            ps_end_page($ps);
            $glc += 256;
        }
    }
}
ps_close($ps);
ps_delete($ps);