Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Mod ttf
From Bennu Wiki
Up to DLL's Truetype font module. Can load TTF files and convert them into Bennu fonts in memory.
Contents
1 Description 2 Features 3 How to use 4 Download 5 Functions 6 Dependencies 7 Test program
Description
mod_ttf is a module for loading True Type fonts (http://en.wikipedia.org/wiki/TrueType) into Bennu.
Features
Loading of True Type fonts. Anti-aliasing (http://en.wikipedia.org/wiki/Anti_aliasing) functionality.
How to use
To be able to use it, you must import the module, like any other:
import "mod_ttf"
Then you can use the functions to load fonts. After you are done with the loaded fonts, you can unload them using fnt_unload(), just like you would unload regular Bennu fonts.
Download
Here's a package containing the library and the source: mod_ttf.dll (win32) Requires freetype6.DLL (included in package).
wiki.bennugd.org/index.php?title=Mo 1/3
22/11/2010
Functions
Ttf_load() Ttf_loadaa() Ttf_loadx() 3 functions in this module
Dependencies
libfont libgrbase 2 dependencies for this module
Test program
import "mod_key" import "mod_map" import "mod_video" import "mod_ttf" import "mod_text" import "mod_screen" Global int id_ttfs[4]; int id_bg; int depth = 32; string fontfilename="c:/windows/fonts/vladimir.ttf"; End Process Main() Begin set_mode(320,240,depth); id_bg = new_map(320,240,depth); map_clear(0,id_bg,RGB(0,255,0)); put_screen(0,id_bg); id_ttfs[0] = load_ttf(fontfilename,48); id_ttfs[1] = load_ttfaa(fontfilename,48,depth,RGBA(255,0,0,255),RGBA(255,0,0,0)); id_ttfs[2] = ttf_loadx(fontfilename,48,depth,RGBA(0,0,255,255),RGBA(0,0,255,0),1); id_ttfs[3] = ttf_loadx(fontfilename,48,depth,RGBA(0,0,255,255),RGBA(0,0,255,0),100); id_ttfs[4] = ttf_loadx(fontfilename,48,depth,RGBA(0,0,255,255),RGBA(0,0,255,0),255); write(id_ttfs[0],25,30,0,"Hello"); set_text_color(rgb(255,0,255)); write(id_ttfs[0],155,30,0,"World"); write(id_ttfs[1],25,130,0,"Bye"); write(id_ttfs[2],155,90,0,"World"); write(id_ttfs[3],155,130,0,"World"); write(id_ttfs[4],155,170,0,"World"); Repeat frame; Until(key(_ESC)) unload_fnt(id_ttfs[4]); unload_fnt(id_ttfs[3]); unload_fnt(id_ttfs[2]); unload_fnt(id_ttfs[1]); unload_fnt(id_ttfs[0]); unload_map(0,id_bg); End
wiki.bennugd.org/index.php?title=Mo
2/3
22/11/2010
Modules
Low Libblit Libdraw Libfont Libgrbase Libjoy Libkey Libmouse Librender Libscroll Libsdlhandler level Libtext Libvideo Libwm Mod_blendop Mod_cd Mod_crypt Mod_debug Mod_dir Mod_draw Mod_effects Mod_ffi Mod_file High Mod_flic Mod_grproc Mod_joy Mod_key Mod_m7 Mod_map Mod_math Mod_mem Mod_mouse level Mod_path Mod_proc Mod_rand Mod_regex Mod_say Mod_screen Mod_scroll Mod_sort Mod_sound Mod_string Mod_sys Mod_text Mod_time Mod_timers Mod_video Mod_wm 3rd Mod_ttf Mod_wpad Pango.dll Party
Retrieved from "http://wiki.bennugd.org/index.php?title=Mod_ttf" Categories: Modules | 3rd party | Libgrbase | Libfont | Libfreetype-6 This page was last modified on 16 November 2009, at 01:29. Content is available under GNU Free Documentation License 1.2.
wiki.bennugd.org/index.php?title=Mo
3/3