1 USING: io.files kernel math namespaces pdf pdf.libhpdf prettyprint sequences ;
10 : font-list ( -- seq ) {
18 "Helvetica-BoldOblique"
28 ! HPDF_COMP_ALL set-compression-mode
30 ! HPDF_PAGE_MODE_USE_OUTLINE set-page-mode
32 ! Add a new page object
35 get-page-height height set
37 get-page-width width set
39 ! Print the lines of the page
42 50 50 width get 100 - height get 110 - page-rectangle
46 ! Print the title of the page (with positioning center)
47 "Helvetica" f get-font font set
49 font get 24 set-page-font-and-size
51 "Font Demo" page-text-width twidth set
54 width get twidth get - 2 / height get 50 - "Font Demo" page-text-out
60 font get 16 set-page-font-and-size
62 60 height get 80 - "<Standard Type1 font samples>" page-text-out
68 60 height get 105 - page-move-text-pos
76 fontname get f get-font font set
78 ! print a label of text
79 font get 9 set-page-font-and-size
81 fontname get page-show-text
83 0 -18 page-move-text-pos
86 font get 20 set-page-font-and-size
88 "abcdefgABCDEFG12345!#$%&+-@?" page-show-text
90 0 -20 page-move-text-pos
96 "font_test.pdf" temp-file save-to-file