/usr/share/doc/libpaps-dev/html/index.html is in libpaps-dev 0.6.8-7.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libpaps: Main Page</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
<ul>
<li id="current"><a href="index.html"><span>Main Page</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul></div>
<h1>libpaps Documentation</h1>
<p>
<h3 align="center">0.6.7 </h3><h2><a class="anchor" name="intro">
Introduction</a></h2>
paps is a a program that renders UTF8 files in PostScript through pango. paps also comes with libpaps, a library that makes it easy to render PostScript output in any pango based programs, e.g. programs based on gtk.<h2><a class="anchor" name="API">
API documentation</a></h2>
<ul>
<li><a class="el" href="libpaps_8h.html">libpaps.h </a> - Libpaps API documentation</li></ul>
<h2><a class="anchor" name="Examples">
Examples</a></h2>
Here are is an example showing the use of libpaps.<p>
<div class="fragment"><pre class="fragment"><span class="comment">/*======================================================================</span>
<span class="comment">// test-paps.c - Testing the paps library.</span>
<span class="comment">//</span>
<span class="comment">// Dov Grobgeld <dov.weizmann@weizmann.ac.il></span>
<span class="comment">// Tue Nov 8 21:50:31 2005</span>
<span class="comment">//----------------------------------------------------------------------</span>
<span class="comment">*/</span>
<span class="preprocessor">#include <pango/pango.h></span>
<span class="preprocessor">#include <pango/pangoft2.h></span>
<span class="preprocessor">#include <stdio.h></span>
<span class="preprocessor">#include "<a class="code" href="libpaps_8h.html">libpaps.h</a>"</span>
<span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>*argv[])
{
<a class="code" href="libpaps_8h.html#b6cb108cff4a0306a2786a4b748f81ac">paps_t</a> *paps = <a class="code" href="libpaps_8h.html#4ddc548ab818eb9fe351def79d48ced6">paps_new</a>();
gchar *header, *ps_layout;
PangoContext *pango_context;
PangoFontDescription *font_description;
PangoDirection pango_dir = PANGO_DIRECTION_LTR;
PangoLayout *layout;
gchar *font_family = <span class="stringliteral">"sans"</span>;
<span class="keywordtype">int</span> font_scale = 14;
GString *ps_text = g_string_new(<span class="stringliteral">""</span>);
pango_context = <a class="code" href="libpaps_8h.html#3eb383e3f29a4ed8545907c2957db9b0">paps_get_pango_context</a>();
<span class="comment">/* Setup pango */</span>
pango_context_set_language (pango_context, pango_language_from_string (<span class="stringliteral">"en_US"</span>));
pango_context_set_base_dir (pango_context, pango_dir);
font_description = pango_font_description_new ();
pango_font_description_set_family (font_description, g_strdup (font_family));
pango_font_description_set_style (font_description, PANGO_STYLE_NORMAL);
pango_font_description_set_variant (font_description, PANGO_VARIANT_NORMAL);
pango_font_description_set_weight (font_description, PANGO_WEIGHT_NORMAL);
pango_font_description_set_stretch (font_description, PANGO_STRETCH_NORMAL);
pango_font_description_set_size (font_description, font_scale * PANGO_SCALE);
pango_context_set_font_description (pango_context, font_description);
<span class="comment">// Create a layout and set its properties</span>
layout = pango_layout_new (pango_context);
pango_layout_set_justify (layout, TRUE);
pango_layout_set_width (layout, <a class="code" href="libpaps_8h.html#fcf44cad7f299c059dc132fed567beca">paps_postscript_points_to_pango</a>(5*72));
pango_layout_set_text (layout,
<span class="stringliteral">"It was the best of times, it was the worst of times, "</span>
<span class="stringliteral">"it was the age of wisdom, it was the age of foolishness, "</span>
<span class="stringliteral">"it was the epoch of belief, it was the epoch of incredulity, "</span>
<span class="stringliteral">"it was the season of Light, it was the season of Darkness, "</span>
<span class="stringliteral">"it was the spring of hope, it was the winter of despair, "</span>
<span class="stringliteral">"we had everything before us, we had nothing before us, "</span>
<span class="stringliteral">"we were all going direct to Heaven, we were all going direct "</span>
<span class="stringliteral">"the other way--in short, the period was so far like the present "</span>
<span class="stringliteral">"period, that some of its noisiest authorities insisted on its "</span>
<span class="stringliteral">"being received, for good or for evil, in the superlative degree "</span>
<span class="stringliteral">"of comparison only. "</span>
<span class="stringliteral">"\n\n"</span>
<span class="stringliteral">"There were a king with a large jaw and a queen with a plain face, "</span>
<span class="stringliteral">"on the throne of England; there were a king with a large jaw and "</span>
<span class="stringliteral">"a queen with a fair face, on the throne of France. In both "</span>
<span class="stringliteral">"countries it was clearer than crystal to the lords of the State "</span>
<span class="stringliteral">"preserves of loaves and fishes, that things in general were "</span>
<span class="stringliteral">"settled for ever. "</span>
<span class="stringliteral">"\n\n"</span>
<span class="stringliteral">"It was the year of Our Lord one thousand seven hundred and "</span>
<span class="stringliteral">"seventy-five. Spiritual revelations were conceded to England at "</span>
<span class="stringliteral">"that favoured period, as at this. Mrs. Southcott had recently "</span>
<span class="stringliteral">"attained her five-and-twentieth blessed birthday, of whom a "</span>
<span class="stringliteral">"prophetic private in the Life Guards had heralded the sublime "</span>
<span class="stringliteral">"appearance by announcing that arrangements were made for the "</span>
<span class="stringliteral">"swallowing up of London and Westminster. Even the Cock-lane "</span>
<span class="stringliteral">"ghost had been laid only a round dozen of years, after rapping "</span>
<span class="stringliteral">"out its messages, as the spirits of this very year last past "</span>
<span class="stringliteral">"(supernaturally deficient in originality) rapped out theirs. "</span>
<span class="stringliteral">"Mere messages in the earthly order of events had lately come to "</span>
<span class="stringliteral">"the English Crown and People, from a congress of British subjects "</span>
<span class="stringliteral">"in America: which, strange to relate, have proved more important "</span>
<span class="stringliteral">"to the human race than any communications yet received through "</span>
<span class="stringliteral">"any of the chickens of the Cock-lane brood. "</span>
, -1);
ps_layout = <a class="code" href="libpaps_8h.html#50206ea82dafae0aabb642a9801a02af">paps_layout_to_postscript_strdup</a>(paps,
0, 0,
layout);
g_string_append_printf(ps_text,
<span class="stringliteral">"gsave\n"</span>
<span class="stringliteral">"1 0.8 0.8 setrgbcolor\n"</span>
<span class="stringliteral">"72 72 10 mul translate\n"</span>
<span class="stringliteral">"3 rotate %s\n"</span>
<span class="stringliteral">"grestore\n"</span>,
ps_layout);
g_free(ps_layout);
pango_font_description_set_size (font_description, 25 * PANGO_SCALE);
pango_context_set_font_description (pango_context, font_description);
pango_layout_set_width (layout, <a class="code" href="libpaps_8h.html#fcf44cad7f299c059dc132fed567beca">paps_postscript_points_to_pango</a>(7*72));
pango_layout_set_text (layout,
<span class="stringliteral">"paps by Dov Grobgeld (\327\223\327\221 \327\222\327\250\327\225"</span>
<span class="stringliteral">"\327\221\327\222\327\234\327\223\n"</span>
<span class="stringliteral">"Printing through \316\240\316\261\316\275\350\252\236 (Pango)\n"</span>
<span class="stringliteral">"\n"</span>
<span class="stringliteral">"Arabic \330\247\331\204\330\263\331\204\330\247\330\271"</span>
<span class="stringliteral">"\331\204\331\212\331\203\331\205\n"</span>
<span class="stringliteral">"Hebrew \327\251\327\201\326\270\327\234\327\225\326\271\327\235\n"</span>
<span class="stringliteral">"Greek (\316\225\316\273\316\273\316\267\316\275\316\271\316\272"</span>
<span class="stringliteral">"\316\254) \316\223\316\265\316\271\316\254 \317\203\316\261\317\202\n"</span>
<span class="stringliteral">"Japanese (\346\227\245\346\234\254\350\252\236) \343\201\223\343"</span>
<span class="stringliteral">"\202\223\343\201\253\343\201\241\343\201\257, \357\275\272\357\276"</span>
<span class="stringliteral">"\235\357\276\206\357\276\201\357\276\212\n"</span>
<span class="stringliteral">"Chinese (\344\270\255\346\226\207, \346\231\256\351\200\232\350"</span>
<span class="stringliteral">"\257\235,\346\261\211\350\257\255) \344\275\240\345\245\275\n"</span>
<span class="stringliteral">"Vietnamese (Ti\341\272\277ng Vi\341\273\207t) Xin Ch"</span>
<span class="stringliteral">"\303\240o\n"</span>,
-1
);
ps_layout = <a class="code" href="libpaps_8h.html#50206ea82dafae0aabb642a9801a02af">paps_layout_to_postscript_strdup</a>(paps,
0, 0,
layout);
g_string_append_printf(ps_text,
<span class="stringliteral">"gsave\n"</span>
<span class="stringliteral">"0.2 0.2 1.0 setrgbcolor\n"</span>
<span class="stringliteral">"100 700 translate\n"</span>
<span class="stringliteral">"-10 rotate %s\n"</span>
<span class="stringliteral">"grestore\n"</span>,
ps_layout);
g_string_append_printf(ps_text,
<span class="stringliteral">"gsave\n"</span>
<span class="stringliteral">"0 0.5 0.1 setrgbcolor\n"</span>
<span class="stringliteral">"500 300 translate\n"</span>
<span class="stringliteral">"-5 rotate -0.5 1 scale %s\n"</span>
<span class="stringliteral">"grestore\n"</span>,
ps_layout);
g_free(ps_layout);
header = <a class="code" href="libpaps_8h.html#ee8da2e0bfae73ca0e8a9046384d838d">paps_get_postscript_header_strdup</a>(paps);
printf(<span class="stringliteral">"%s"</span>,header);
g_free(header);
printf(<span class="stringliteral">"%s"</span>, ps_text->str);
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
The result is shown here:<p>
<div align="center">
<img src="example-output.png" alt="example-output.png">
</div>
<hr size="1"><address style="align: right;"><small>Generated on Tue Nov 28 23:28:29 2006 for libpaps by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>
|