/usr/share/doc/libsdl-pango-dev/html/index.html is in libsdl-pango-dev 0.1.2-6.
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 | <!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>SDL_Pango: Main Page</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindexHL" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>SDL_Pango Documentation</h1>
<p>
<h3 align="center">0.1.2 </h3><h2><a class="anchor" name="intro">
Introduction</a></h2>
Pango is the text rendering engine of GNOME 2.x. SDL_Pango connects the engine to SDL. In Windows, pre-built binary package (MSI and merge module) is provided.<h3><a class="anchor" name="dist">
Distribution</a></h3>
If you are a game software developer, you should know the difficulties of distribution. So I will start to introduce SDL_Pango from the viewpoint of distribution.<p>
In Un*x, SDL_Pango is hard to use as system-independent module, because it depends on fontconfig and Pango which are designed as system-singleton modules. If you use SDL_Pango, your software will require those modules installed to target system. If your software is shipped as shrink-wrap package, it may cause much problem on your support desk. You should carefully design your installation process.<p>
In Windows, SDL_Pango is distributed as "merge module" which contains fontconfig and Pango. Those binaries are modified as side-by-side components. You should use Windows Installer and merge the module on your MSI package. The merge module not only contains files, but also includes custom action which must be run at installation.<h3><a class="anchor" name="api">
High-level API</a></h3>
From the viewpoint of text rendering, the heart of SDL_Pango is high-level API. Other text rendering APIs, like DrawText() of Windows, font and text must be specified separately. In SDL_Pango, font specification is embedded in text like HTML:<p>
<div class="fragment"><pre class="fragment"> <span font_family=<span class="stringliteral">"Courier New"</span>><i>This is Courier New and italic.</i></span>
</pre></div><p>
Color, size, subscript/superscript, obliquing, weight, and other many features are also available in same way.<h3><a class="anchor" name="i18n">
Internationalized Text</a></h3>
Internationalized text is another key feature. Text is specified by UTF-8. RTL script (Arabic and Hebrew) and complicated rendering (Arabic, Indic and Thai) are supported. You can see it with GNOME 2.x.<h2><a class="anchor" name="get">
Getting Started</a></h2>
<h3><a class="anchor" name="getlatest">
Get latest files</a></h3>
Get latest files from <a href="http://sourceforge.net/projects/sdlpango/">http://sourceforge.net/projects/sdlpango/</a> .<h3><a class="anchor" name="install">
Install Header and Library</a></h3>
In Windows and VS2003, I strongly recommend you to install MSI package. It contains Pango and fontconfig binaries which are modified as side-by-side components. It is nearly impossible to build them. (I spent much time to build them...)<p>
In MinGW, I recommend you to use VS2003. Otherwise you may run into the maze of distribution. If you insist MinGW, you should use MinGW binary archive.<p>
In Un*x, installation consists of:<p>
<div class="fragment"><pre class="fragment"> ./configure
make
make install
</pre></div><h3><a class="anchor" name="inc">
Includes</a></h3>
To use SDL_Pango functions in a C/C++ source code file, you must use the <a class="el" href="_s_d_l___pango_8h.html">SDL_Pango.h</a> include file:<p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="_s_d_l___pango_8h.html">SDL_Pango.h</a>"</span>
</pre></div><p>
In Windows, <a class="el" href="_s_d_l___pango_8h.html">SDL_Pango.h</a> is installed on <code>%ProgramFiles%\SDL_Pango</code> <code>Development\include</code> (usually <code>C:\Program</code> <code>Files\SDL_Pango</code> <code>Development\include</code>). You should add this directory to include path.<h3><a class="anchor" name="comp">
Compiling</a></h3>
In Un*x, to link with SDL_Pango you should use sdl-config to get the required SDL compilation options. After that, compiling with SDL_Pango is quite easy.<p>
Note: Some systems may not have the SDL_Pango library and include file in the same place as the SDL library and includes are located, in that case you will need to add more -I and -L paths to these command lines.<p>
Simple Example for compiling an object file:<p>
<div class="fragment"><pre class="fragment"> cc -c `sdl-config --cflags` mysource.c
</pre></div><p>
Simple Example for linking an object file:<p>
<div class="fragment"><pre class="fragment"> cc -o myprogram mysource.o `sdl-config --libs` -lSDL_Pango
</pre></div><p>
Now myprogram is ready to run.<p>
You can see a sample of autoconfiscation in 'test' directory.<p>
In Windows, MSI package installs many dlls to <code>%ProgramFiles%\SDL_Pango</code> <code>Development\import_lib</code>. To link with SDL_Pango you should use SDL_Pango.lib.<p>
SDL_Pango.dll depends on many dlls and other many files. Those dlls are installed on <code>%ProgramFiles%\SDL_Pango</code> <code>Development\bin</code>. MSI package adds the directory to PATH environment variable.<h2><a class="anchor" name="devel">
Development</a></h2>
<h3><a class="anchor" name="font">
Font Handling</a></h3>
In Un*x, font handling depends on fontconfig of your system.<p>
In Windows, local.conf of fontconfig is placed on <code>%ProgramFiles%\SDL_Pango</code> <code>Development\etc\fonts</code>. You should know about fontconfig's font cache mechanism.<h3><a class="anchor" name="example">
Step-by-step Example</a></h3>
The operation of SDL_Pango is done via context.<p>
<div class="fragment"><pre class="fragment"> SDLPango_Context *context = <a class="code" href="_s_d_l___pango_8c.html#a23">SDLPango_CreateContext</a>();
</pre></div><p>
Specify default colors and minimum surface size.<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="_s_d_l___pango_8c.html#a29">SDLPango_SetDefaultColor</a>(context, MATRIX_TRANSPARENT_BACK_WHITE_LETTER);
<a class="code" href="_s_d_l___pango_8c.html#a28">SDLPango_SetMinimumSize</a>(context, 640, 0);
</pre></div><p>
Set markup text.<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="_s_d_l___pango_8c.html#a32">SDLPango_SetMarkup</a>(context, <span class="stringliteral">"This is <i>markup</i> text."</span>, -1);
</pre></div><p>
Now you can get the size of surface.<p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> w = <a class="code" href="_s_d_l___pango_8c.html#a30">SDLPango_GetLayoutWidth</a>(context);
<span class="keywordtype">int</span> h = <a class="code" href="_s_d_l___pango_8c.html#a31">SDLPango_GetLayoutHeight</a>(context);
</pre></div><p>
Create surface to draw.<p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> margin_x = 10;
<span class="keywordtype">int</span> margin_y = 10;
SDL_Surface *surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
w + margin_x * 2, h + margin_y * 2,
32, (Uint32)(255 << (8 * 3)), (Uint32)(255 << (8 * 2)),
(Uint32)(255 << (8 * 1)), 255);
</pre></div><p>
And draw on it.<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="_s_d_l___pango_8c.html#a27">SDLPango_Draw</a>(context, surface, margin_x, margin_y);
</pre></div><p>
You must free the surface by yourself.<p>
<div class="fragment"><pre class="fragment"> SDL_FreeSurface(surface);
</pre></div><p>
Free context.<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="_s_d_l___pango_8c.html#a24">SDLPango_FreeContext</a>(context);
</pre></div><p>
You can see actual code in <code>test/testbench</code>.cpp.<h3><a class="anchor" name="pack">
Packaging</a></h3>
In Un*x, do it yourself.<p>
In Windows, font files must be installed on apprication folder (usually <code>C:\Program</code> <code>Files\</code>[Manufacturer]\[ProductName]). The property of apprication folder must be <code>TARGETDIR</code> (this is default setting of VS2003). SDL.dll also must be installed on apprication folder. Add SDL_Pango.msm to your MSI package.<h2><a class="anchor" name="ack">
Acknowledgment</a></h2>
SDL_Pango is developed with financial assistance of Information-technology Promotion Agency, Japan.<p>
<ul>
<li>NAKAMURA Ken'ichi <<a href="mailto:nakamura@sbp.fp.a.u-tokyo.ac.jp">nakamura@sbp.fp.a.u-tokyo.ac.jp</a>> </li></ul>
<hr size="1"><address style="align: right;"><small>Generated on Thu Dec 9 08:33:15 2004 for SDL_Pango by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>
|