| 199 | |
| 200 | == Displaying text == |
| 201 | |
| 202 | Older versions of the BOINC graphics API library included support for ''texture fonts'' in files of the form ''*.txf''. These are no longer supported, but we have added support for displaying !TrueType fonts in BOINC graphics applications. |
| 203 | * Add the files `api/ttfont.cpp` and `api/ttfont.h` to your application (they are not included in any BOINC library.) |
| 204 | * You will need to build and link with the [http://www.freetype.org FreeType2] and [http://sourceforge.net/projects/ftgl/files/FTGL%20Source/ FTGL] libraries. Depending on how you build the FreeType2 library, FreeType2 may require the libz and libbz2 libraries. |
| 205 | * We have put copies of the free Liberation fonts in the `api/ttf/` directory. If you wish to use other !TrueType fonts, you will need to adjust the list of font names in `ttfont.cpp`. |
| 206 | * Download the desired !TrueType fonts to the client where they are available to your graphics application. |
| 207 | |
| 208 | For examples, please see the `clientscr/ss_app.cpp` and `samples/exampple_app/uc2_graphics.cpp` in the BOINC SVN trunk. |
| 209 | |
| 210 | If your graphics application currently uses the older ''texture fonts'' , note that the ttf_load_fonts() and txf_render_string() APIs are slightly different from the old txf_load_fonts() and txf_render_string() APIs. Please see the `ttfont.cpp` and `ttfont.h` files for details. |