Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » libalfont.a anyone?

Credits go to CGamesPlay, Kitty Cat, and Neil Walker for helping out!
This thread is locked; no one can reply to it. rss feed Print
libalfont.a anyone?
Mark Oates
Member #1,146
March 2001
avatar

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.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

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.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

ok, I'm looking int Glyph Keeper now...

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Neil Walker
Member #210
April 2000
avatar

If you download OpenLayer the .a file is included, though you'll have to get the manuals elsewhere.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Mark Oates
Member #1,146
March 2001
avatar

cool. I used libglyph.a from Openlayer. Openlayer to the rescue! thanks

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

I'm gonna bump this thread because I'm pretty sure you'll need it.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

Quote:

I'm gonna bump this thread because I'm pretty sure you'll need it.

good work, because now I'm having this problem :P :

I cannot convert the Glyph Keeper to the Allegro's FONT. The error is: "'gk_create_allegro_font' is undeclared;"

the function:

1int 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}

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

#define GLYPH_TARGET GLYPH_TARGET_ALLEGRO? The OpenLayer libglyph.a might have trouble because its target is GLYPH_TARGET_ALLEGROGL...

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

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?

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

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.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

I'm trying to compile Glyph Keeper myself but it failes -- see attachment. What am I doing wrong?

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

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.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

I tried changing the cc's to gcc's in the makefile but it still will not compile.

also tried this:

1C:\gc>make CC=gcc
2make: *** No targets specified and no makefile found. Stop.
3 
4C:\gc>make.mingw
5 
6C:\gc>MINGDIR=C:\Dev-Cpp
7'MINGDIR' is not recognized as an internal or external command,
8operable program or batch file.
9 
10C:\gc>PATH=C:\msys\1.0\bin;C:\Dev-Cpp\bin;C:\msys\1.0\bin;C:\Dev-Cpp\bin;C:\WIND
11OWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSy
12stem\;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Dev-Cpp\bin;
13 
14C:\gc>make -f Makefile.MinGW TARGET=ALLEGRO
15Compiling Glyph Keeper / Allegro with MinGW
16cc -W -Wall -std=c89 -O3 -DGK_NO_LEGACY -DGLYPH_TARGET=GLYPH_TARGET_ALLEGRO -s -
17c -o obj/libgkalleg.o src/glyph.c
18process_begin: CreateProcess((null), cc -W -Wall -std=c89 -O3 -DGK_NO_LEGACY -DG
19LYPH_TARGET=GLYPH_TARGET_ALLEGRO -s -c -o obj/libgkalleg.o src/glyph.c, ...) fai
20led.
21make (e=2): The system cannot find the file specified.
22make: *** [obj/libgkalleg.o] Error 2
23 
24C:\gc>

[edit] another alternative: is there a function that converts OpenLayer bitmap to an allegro Bitmap?

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Kitty Cat
Member #2,815
October 2002
avatar

You forgot the CC=gcc on the last line.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Mark Oates
Member #1,146
March 2001
avatar

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:

1src/glyph_to_allegro.c:111: error: dereferencing pointer to incomplete type
2src/glyph_to_allegro.c:111: error: `FT_RENDER_MODE_MONO' undeclared (first
3n this function)
4src/glyph_to_allegro.c: In function `gk_text_width_allegro':
5src/glyph_to_allegro.c:250: error: dereferencing pointer to incomplete type
6src/glyph_to_allegro.c:256: error: dereferencing pointer to incomplete type
7src/glyph_to_allegro.c:256: error: dereferencing pointer to incomplete type
8src/glyph_to_allegro.c: In function `_gk_vtable_render_char':
9src/glyph_to_allegro.c:336: error: dereferencing pointer to incomplete type
10src/glyph_to_allegro.c:339: error: dereferencing pointer to incomplete type
11src/glyph_to_allegro.c:340: error: dereferencing pointer to incomplete type
12src/glyph_to_allegro.c:346: error: dereferencing pointer to incomplete type
13src/glyph_to_allegro.c: In function `_gk_vtable_render':
14src/glyph_to_allegro.c:388: error: dereferencing pointer to incomplete type
15src/glyph_to_allegro.c:391: error: dereferencing pointer to incomplete type
16src/glyph_to_allegro.c:392: error: dereferencing pointer to incomplete type
17src/glyph_to_allegro.c:398: error: dereferencing pointer to incomplete type
18src/glyph_to_allegro.c: In function `_gk_vtable_destroy':
19src/glyph_to_allegro.c:421: error: dereferencing pointer to incomplete type
20src/glyph_to_allegro.c: In function `gk_create_allegro_font':
21src/glyph_to_allegro.c:484: error: dereferencing pointer to incomplete type
22src/glyph_to_allegro.c:484: error: dereferencing pointer to incomplete type
23src/glyph_to_allegro.c:489: error: dereferencing pointer to incomplete type
24src/glyph_to_allegro.c:490: error: dereferencing pointer to incomplete type

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

That'd probably be because Glyph can't find/isn't including FreeType... Check its docs?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

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.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

CGamesPlay
Member #2,559
July 2002
avatar

Wait, this was jsut a one-image deal? That couldn't've been done in MS Paint? :o

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Mark Oates
Member #1,146
March 2001
avatar

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.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Neil Walker
Member #210
April 2000
avatar

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?

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Go to: