Difference between revisions of "FreeTypeGX"
(Documentation updated for 0.2.0) |
(Update to 0.2.1) |
||
Line 6: | Line 6: | ||
| display = Any | | display = Any | ||
| author = [[User:ArminTamzarian|Armin Tamzarian]] | | author = [[User:ArminTamzarian|Armin Tamzarian]] | ||
− | | version = 0.2. | + | | version = 0.2.1 |
− | | download = [http:// | + | | download = [http://code.google.com/p/freetypegx/ Here] |
}} | }} | ||
'''FreeTypeGX''' is a wrapper class for libFreeType which renders a compiled FreeType parsable font into a GX texture for Wii homebrew development. '''FreeTypeGX''' is written in C++ and makes use of a selectable pre-buffered or buffer-on-demand methodology to allow fast and efficient printing of text to the EFB. | '''FreeTypeGX''' is a wrapper class for libFreeType which renders a compiled FreeType parsable font into a GX texture for Wii homebrew development. '''FreeTypeGX''' is written in C++ and makes use of a selectable pre-buffered or buffer-on-demand methodology to allow fast and efficient printing of text to the EFB. | ||
+ | |||
+ | '''Note:''' As of version 0.2.1 FreeTypeGX has forked into two disparate projects and now relies upon the [[Metaphrasis]] library. | ||
This library was developed in-full by Armin Tamzarian with the support of developers in #wiibrew on EFnet, [[User:Chaosteil|Chaosteil]] of [[libwiisprite]], and [[User:DrTwox|DrTwox]] of [[GRRLIB]]. | This library was developed in-full by Armin Tamzarian with the support of developers in #wiibrew on EFnet, [[User:Chaosteil|Chaosteil]] of [[libwiisprite]], and [[User:DrTwox|DrTwox]] of [[GRRLIB]]. | ||
Full Doxygen API documentation is included within the download archive for assistance with program integration. | Full Doxygen API documentation is included within the download archive for assistance with program integration. | ||
− | ==Installation== | + | |
− | # | + | ==Installation (Source Code)== |
− | # Extract the FreeTypeGX archive into your project's development path. | + | # Ensure that you have the [http://www.tehskeen.com/forums/showthread.php?t=9404 libFreeType] Wii library installed in your development environment. |
− | # Include the FreeTypeGX header file in your code using syntax such as the following: | + | # Ensure that you have the [[Metaphrasis]] library installed in your development environment with the library added to your Makefile where appropriate. |
− | include "FreeTypeGX.h" | + | # Extract the FreeTypeGX archive. |
+ | # Copy the contents of the src directory into your project's development path. | ||
+ | # Place a copy of the desired TrueType or OpenType font you wish to use in the FreeTypeGX/ttf directory. | ||
+ | # Modify the fontface.s file and change the value of the incbin variable to point to your font. | ||
+ | # Modify the fontface.s file and change the value of the fontsize variable to the byte-size of the font file. | ||
+ | # Include the FreeTypeGX header file in your code using syntax such as the following: | ||
+ | #include "FreeTypeGX.h" | ||
+ | |||
+ | ==Installation (Library)== | ||
+ | # Ensure that you have the [http://www.tehskeen.com/forums/showthread.php?t=9404 libFreeType] Wii library installed in your development environment. | ||
+ | # Ensure that you have the [[Metaphrasis]] library installed in your development environment with the library added to your Makefile where appropriate. | ||
+ | # Extract the FreeTypeGX archive. | ||
+ | # Copy the contents of the lib directory into your devKitPro/libogc directory. | ||
+ | # Include the FreeTypeGX header file in your code using syntax such as the following: | ||
+ | #include "FreeTypeGX.h" | ||
==Usage== | ==Usage== | ||
− | |||
− | |||
− | |||
* Within the file you included the FreeTypeGX.h file create an instance object of the FreeTypeGX class passing in the desired font point size: | * Within the file you included the FreeTypeGX.h file create an instance object of the FreeTypeGX class passing in the desired font point size: | ||
Revision as of 22:45, 7 January 2009
FreeTypeGX | |
![]() | |
General | |
---|---|
Author(s) | Armin Tamzarian |
Type | Development |
Version | 0.2.1 |
Links | |
[[Here|Download]] |
FreeTypeGX is a wrapper class for libFreeType which renders a compiled FreeType parsable font into a GX texture for Wii homebrew development. FreeTypeGX is written in C++ and makes use of a selectable pre-buffered or buffer-on-demand methodology to allow fast and efficient printing of text to the EFB.
Note: As of version 0.2.1 FreeTypeGX has forked into two disparate projects and now relies upon the Metaphrasis library.
This library was developed in-full by Armin Tamzarian with the support of developers in #wiibrew on EFnet, Chaosteil of libwiisprite, and DrTwox of GRRLIB.
Full Doxygen API documentation is included within the download archive for assistance with program integration.
Installation (Source Code)
- Ensure that you have the libFreeType Wii library installed in your development environment.
- Ensure that you have the Metaphrasis library installed in your development environment with the library added to your Makefile where appropriate.
- Extract the FreeTypeGX archive.
- Copy the contents of the src directory into your project's development path.
- Place a copy of the desired TrueType or OpenType font you wish to use in the FreeTypeGX/ttf directory.
- Modify the fontface.s file and change the value of the incbin variable to point to your font.
- Modify the fontface.s file and change the value of the fontsize variable to the byte-size of the font file.
- Include the FreeTypeGX header file in your code using syntax such as the following:
#include "FreeTypeGX.h"
Installation (Library)
- Ensure that you have the libFreeType Wii library installed in your development environment.
- Ensure that you have the Metaphrasis library installed in your development environment with the library added to your Makefile where appropriate.
- Extract the FreeTypeGX archive.
- Copy the contents of the lib directory into your devKitPro/libogc directory.
- Include the FreeTypeGX header file in your code using syntax such as the following:
#include "FreeTypeGX.h"
Usage
- Within the file you included the FreeTypeGX.h file create an instance object of the FreeTypeGX class passing in the desired font point size:
FreeTypeGX *freeTypeGX = new FreeTypeGX(32);
- Alternately you can specify a texture format you would like to which you would like to render the font characters.
FreeTypeGX *freeTypeGX = new FreeTypeGX(32, GX_TF_RGB565);
- Furthermore you can also specify a third flag which will load and cache all available font glyphs immidiately. Note that on large font sets enabling this feature could take a significant amount of time.
FreeTypeGX *freeTypeGX = new FreeTypeGX(32, GX_TF_RGB565, true);
- Currently supported textures are:
- GX_TF_I4
- GX_TF_I8
- GX_TF_IA4
- GX_TF_IA8
- GX_TF_RGB565
- GX_TF_RGB5A3
- GX_TF_RGBA8
- Using the allocated FreeTypeGX instance object call the drawText function to print a string at the specified screen X and Y coordinates to the current EFB:
freeTypeGX->drawText(10, 25, _TEXT("FreeTypeGX Rocks!"));
- Alternately you can specify a GXColor object you would like to apply to the printed characters:
freeTypeGX->drawText(10, 25, _TEXT("FreeTypeGX Rocks!"), (GXColor){0xff, 0xee, 0xaa, 0xff});
License
FreeTypeGX is distributed under the GNU Lesser General Public License.