Can someone please attach or link me to libalfont.a? I'm using Dev-Cpp by the way and I can't seem to find this file.
If you have a choice, use Glyph Keeper. ALFont is no longer maintained. That said, I can't, because I don't have it installed.
ok, I'm looking int Glyph Keeper now...
If you download OpenLayer the .a file is included, though you'll have to get the manuals elsewhere.
cool. I used libglyph.a from Openlayer. Openlayer to the rescue! thanks
I'm gonna bump this thread because I'm pretty sure you'll need it.
I'm gonna bump this thread because I'm pretty sure you'll need it.
good work, because now I'm having this problem
:
I cannot convert the Glyph Keeper to the Allegro's FONT. The error is: "'gk_create_allegro_font' is undeclared;"
the function:
| 1 | int save_text_bmp(string filename, GLYPH_FACE *f, int font_size, string message, int font_color, int background_color, int padding_left, int padding_top, int padding_right, int padding_bottom) |
| 2 | { |
| 3 | GLYPH_REND *rend; |
| 4 | |
| 5 | if (!f) return 1; |
| 6 | rend = gk_create_renderer(f,0); |
| 7 | if (!rend) return 1; |
| 8 | |
| 9 | gk_rend_set_size_pixels(rend, font_size, font_size); |
| 10 | |
| 11 | int width = gk_text_width_utf8(rend, message.c_str()); |
| 12 | int height = gk_rend_height_pixels(rend); |
| 13 | |
| 14 | //width += padding_left + padding_right; |
| 15 | //height += padding_top + padding_bottom; |
| 16 | |
| 17 | BITMAP *b = create_bitmap(width, height); |
| 18 | |
| 19 | clear_to_color(b, background_color); |
| 20 | |
| 21 | //gk_render_line_utf8(b, rend, message.c_str(), padding_left, padding_top); |
| 22 | |
| 23 | FONT *afont; |
| 24 | afont = gk_create_allegro_font(rend); |
| 25 | |
| 26 | textout_ex(b, afont, message.c_str(), padding_left, padding_top, font_color, -1); |
| 27 | |
| 28 | save_bitmap(filename.c_str(), b, NULL); |
| 29 | |
| 30 | destroy_bitmap(b); |
| 31 | |
| 32 | return 0; |
| 33 | } |
#define GLYPH_TARGET GLYPH_TARGET_ALLEGRO? The OpenLayer libglyph.a might have trouble because its target is GLYPH_TARGET_ALLEGROGL...
I added #define GLYPH_TARGET GLYPH_TARGET_ALLEGRO above the #include "glyph.h" line and it still gives me that error : "'gk_create_allegro_font' is undeclared;" or "undefined reference to 'gk_create_allegro_font'".
It is defined the glyph.h file, is it possible that it was not compiled into the Openlayer .a version?
Yes. If you get the "undefined reference", it means that the linker cannot find it. It was not compiled into OpenLayer. If you get "undeclared", it means the compiler cannot find it, amongst the .h files.
I'm trying to compile Glyph Keeper myself but it failes -- see attachment. What am I doing wrong?
The compiler in the makefile is set to cc, instead of say gcc. Try
make CC=gcc
. Also, if you clock the prompt's icon, you can go to Edit->Mark, select text, and press enter to copy it to the clipboard.
I tried changing the cc's to gcc's in the makefile but it still will not compile.
also tried this:
| 1 | C:\gc>make CC=gcc |
| 2 | make: *** No targets specified and no makefile found. Stop. |
| 3 | |
| 4 | C:\gc>make.mingw |
| 5 | |
| 6 | C:\gc>MINGDIR=C:\Dev-Cpp |
| 7 | 'MINGDIR' is not recognized as an internal or external command, |
| 8 | operable program or batch file. |
| 9 | |
| 10 | C:\gc>PATH=C:\msys\1.0\bin;C:\Dev-Cpp\bin;C:\msys\1.0\bin;C:\Dev-Cpp\bin;C:\WIND |
| 11 | OWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSy |
| 12 | stem\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Dev-Cpp\bin; |
| 13 | |
| 14 | C:\gc>make -f Makefile.MinGW TARGET=ALLEGRO |
| 15 | Compiling Glyph Keeper / Allegro with MinGW |
| 16 | cc -W -Wall -std=c89 -O3 -DGK_NO_LEGACY -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -s - |
| 17 | c -o obj/libgkalleg.o src/glyph.c |
| 18 | process_begin: CreateProcess((null), cc -W -Wall -std=c89 -O3 -DGK_NO_LEGACY -DG |
| 19 | LYPH_TARGET=GLYPH_TARGET_ALLEGRO -s -c -o obj/libgkalleg.o src/glyph.c, ...) fai |
| 20 | led. |
| 21 | make (e=2): The system cannot find the file specified. |
| 22 | make: *** [obj/libgkalleg.o] Error 2 |
| 23 | |
| 24 | C:\gc> |
[edit] another alternative: is there a function that converts OpenLayer bitmap to an allegro Bitmap?
You forgot the CC=gcc on the last line.
I type
[edit]
make -f Makefile.MinGW TARGET=ALLEGRO CC=gcc
and get a slew of errors, most of them say "dereferencing pointer to incomplete type"
here is an exerpt:
| 1 | src/glyph_to_allegro.c:111: error: dereferencing pointer to incomplete type |
| 2 | src/glyph_to_allegro.c:111: error: `FT_RENDER_MODE_MONO' undeclared (first |
| 3 | n this function) |
| 4 | src/glyph_to_allegro.c: In function `gk_text_width_allegro': |
| 5 | src/glyph_to_allegro.c:250: error: dereferencing pointer to incomplete type |
| 6 | src/glyph_to_allegro.c:256: error: dereferencing pointer to incomplete type |
| 7 | src/glyph_to_allegro.c:256: error: dereferencing pointer to incomplete type |
| 8 | src/glyph_to_allegro.c: In function `_gk_vtable_render_char': |
| 9 | src/glyph_to_allegro.c:336: error: dereferencing pointer to incomplete type |
| 10 | src/glyph_to_allegro.c:339: error: dereferencing pointer to incomplete type |
| 11 | src/glyph_to_allegro.c:340: error: dereferencing pointer to incomplete type |
| 12 | src/glyph_to_allegro.c:346: error: dereferencing pointer to incomplete type |
| 13 | src/glyph_to_allegro.c: In function `_gk_vtable_render': |
| 14 | src/glyph_to_allegro.c:388: error: dereferencing pointer to incomplete type |
| 15 | src/glyph_to_allegro.c:391: error: dereferencing pointer to incomplete type |
| 16 | src/glyph_to_allegro.c:392: error: dereferencing pointer to incomplete type |
| 17 | src/glyph_to_allegro.c:398: error: dereferencing pointer to incomplete type |
| 18 | src/glyph_to_allegro.c: In function `_gk_vtable_destroy': |
| 19 | src/glyph_to_allegro.c:421: error: dereferencing pointer to incomplete type |
| 20 | src/glyph_to_allegro.c: In function `gk_create_allegro_font': |
| 21 | src/glyph_to_allegro.c:484: error: dereferencing pointer to incomplete type |
| 22 | src/glyph_to_allegro.c:484: error: dereferencing pointer to incomplete type |
| 23 | src/glyph_to_allegro.c:489: error: dereferencing pointer to incomplete type |
| 24 | src/glyph_to_allegro.c:490: error: dereferencing pointer to incomplete type |
That'd probably be because Glyph can't find/isn't including FreeType... Check its docs?
I have found another way to get it to work.
I was able to do all the text drawing and stuff in OpenLayer, capture a screenshot, thanks to this thread: http://www.allegro.cc/forums/thread/552667 . then crop the bitmap and saved it.
Thanks for all your help.
Wait, this was jsut a one-image deal? That couldn't've been done in MS Paint?
I plan on doing a bunch of them. They need to be the same font size, have the same margins, etc.
It's always a pain to do 10 in a row, only to find out they should be a font size smaller, or the margin is off... this way I can do them in batch.
Now to save them as a 16-color gif with a transparent background.
Forgot about the allegrogl build, sorry. Do you still want a copy as it's just a quick recompile to get the original allegro version built?