Game Development Reference
In-Depth Information
Changing FIF_PNG to any of the FIF_BMP , FIF_TIFF , or FIF_JPEG forms will change the
output ile format to BMP, TIFF, or JPEG respectively.
There's moreā€¦
To understand the importance of reading an image from memory blocks, we should keep
two things in mind. Web services, such as Picasa and Flickr, provide URLs of images,
which are then downloaded into memory using the techniques from the Chapter 3 ,
Networking . To avoid wasting time, we do not save this memory block to disk, and instead
just decode it from memory using the FreeImage library. The same applies to reading an
image ile from a compressed archive.
See also
F Chapter 4 , Organizing a Virtual Filesystem
Using the FreeType library for text rendering
FreeType has become a de facto standard for high-quality text rendering. The library itself is
quite easy to use, and the compilation of a static version relies on the makeile similar to other
libraries from this chapter.
Getting ready
Download the most recent source code from the library home page:
http://www.freetype.org .
The main FreeType concepts are: a font face, a glyph, and a bitmap. Font faces are collections
of all the characters in a font for a given encoding. This is exactly what is stored in the .ttf
iles (besides copyrights and similar meta information). Each character is called a glyph and
is represented using geometrical primitives, such as spline curves. These glyphs are not
something that we can copy pixel-wise to the screen or a frame buffer. We have to rasterize a
bitmap of the glyph using FreeType rasterization functions.
Let's look at a single glyph:
 
Search WWH ::




Custom Search