al_grab_font_from_bitmap - Online Linux Manual PageSection : 3
Updated :
Source : Allegro reference manual
Note :
NAMEal_grab_font_from_bitmap − Allegro 5 API
SYNOPSIS
#include <allegro5/allegro_font.h>
ALLEGRO_FONT *al_grab_font_from_bitmap(ALLEGRO_BITMAP *bmp,
int ranges_n, const int ranges[])
DESCRIPTIONCreates a new font from an Allegro bitmap. You can delete the bitmap after the function returns as the font will contain a copy for itself. Parameters: • bmp: The bitmap with the glyphs drawn onto it • n: Number of unicode ranges in the bitmap. • ranges: 'n' pairs of first and last unicode point to map glyphs to for each range. The bitmap format is as in the following example, which contains three glyphs for 1, 2 and 3.
.............
. 1 .222.333.
. 1 . 2. 3.
. 1 .222.333.
. 1 .2 . 3.
. 1 .222.333.
.............
In the above illustration, the dot is for pixels having the background color. It is determined by the color of the top left pixel in the bitmap. There should be a border of at least 1 pixel with this color to the bitmap edge and between all glyphs. Each glyph is inside a rectangle of pixels not containing the background color. The height of all glyph rectangles should be the same, but the width can vary. The placement of the rectangles does not matter, except that glyphs are scanned from left to right and top to bottom to match them to the specified unicode codepoints. The glyphs will simply be drawn using al_draw_bitmap(3), so usually you will want the rectangles filled with full transparency and the glyphs drawn in opaque white. Examples:
int ranges[] = {32, 126};
al_grab_font_from_bitmap(bitmap, 1, ranges)
int ranges[] = {
0x0020, 0x007F, /* ASCII */
0x00A1, 0x00FF, /* Latin 1 */
0x0100, 0x017F, /* Extended−A */
0x20AC, 0x20AC}; /* Euro */
al_grab_font_from_bitmap(bitmap, 4, ranges)
The first example will grab glyphs for the 95 standard printable ASCII characters, beginning with the space character (32) and ending with the tilde character (126). The second example will map the first 96 glyphs found in the bitmap to ASCII range, the next 95 glyphs to Latin 1, the next 128 glyphs to Extended−A, and the last glyph to the Euro character. (This is just the characters found in the Allegro 4 font.)
SEE ALSOal_load_bitmap(3), al_grab_font_from_bitmap(3) 0
Johanes Gumabo
Data Size : 7,417 byte
man-al_grab_font_from_bitmap.3Build : 2024-12-29, 07:25 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 260,647
Visitor ID : :
Visitor IP : 3.147.13.83 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.