|
|
1.1 ! root 1: .ds ZZ DEVELOPMENT PACKAGE ! 2: .TH FONTSAVE 3L "630 MTG" ! 3: .XE "fontcache()" ! 4: .XE "fontsave()" ! 5: .XE "fontremove()" ! 6: .SH NAME ! 7: fontsave, fontcache, fontremove \- save/remove a font from the cache ! 8: .SH SYNOPSIS ! 9: .B #include <dmd.h> ! 10: .br ! 11: .B #include <font.h> ! 12: .sp ! 13: .B int fontcache (fname, f) ! 14: .sp ! 15: .B Font *fontsave (fname, f) ! 16: .sp ! 17: .B void fontremove (fname) ! 18: .sp ! 19: .B char \(**fname; ! 20: .br ! 21: .B Font \(**f; ! 22: .SH DESCRIPTION ! 23: .I Fname ! 24: points to a font name, ! 25: a null terminated string of up to 14 characters. ! 26: .PP ! 27: The ! 28: .I fontsave ! 29: and ! 30: .I fontcache ! 31: functions put the given font into the font cache ! 32: and give it the name ! 33: .IR fname . ! 34: Once the font is in the cache, any other ! 35: process within the terminal can use it by calling ! 36: .IR fontrequest . ! 37: .PP ! 38: The ! 39: .I fontcache ! 40: function expects ! 41: the given font to be already in allocated memory through calls to ! 42: \fIalloc\fR and \fIgcalloc\fR. ! 43: This function also does a \fIfontrequest\fR for the ! 44: calling application. If the caching or subsequent ! 45: request fails, \fIfontcache\fR will return a 0; otherwise, ! 46: a 1 is returned on success. Note that once ! 47: the font is put into ! 48: the cache, the font should only be freed by calling ! 49: .IR fontremove . ! 50: .PP ! 51: The ! 52: .I fontsave ! 53: function is used to cache fonts not in ! 54: memory allocated through calls to \fIalloc\fR and \fIgcalloc\fR. ! 55: \fIFontsave\fR first attempts to allocate ! 56: memory, then duplicates the given font into the allocated memory, and ! 57: finally calls ! 58: .I fontcache ! 59: to cache the newly created font. ! 60: On success, \fIfontsave\fR returns the pointer to the new font. ! 61: If it cannot allocate enough memory for the creation of the new font, ! 62: of if \fIfontcache\fR fails, \fIfontsave\fR will return a null pointer. ! 63: .PP ! 64: The ! 65: .I fontremove ! 66: function removes the named font from the cache and frees its memory. ! 67: A request to remove a font that is currently requested by some other ! 68: process will be ignored. ! 69: .SH SEE ALSO ! 70: alloc(3R), fontname(3R), fontrequest(3R), gcalloc(3R), infont(3R/3L), ! 71: structures(3R).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.