Sorry for the late response but here I am finally.
If you're using Allegro with Pascal you
should use
Allegro.pas, so you don't need to deal with such stuff as "how to pass this to a C function" because Allegro.pas will do it correctly.
Except if you're doing some weird stuff. Are your doing weird stuff? You shouldn't.
The header declaration of this function (amongst others) reads:
PROCEDURE al_draw_text (CONST font: ALLEGRO_FONTptr; color: ALLEGRO_COLOR; x, y: AL_FLOAT; flags: AL_INT; CONST str: AL_STR);
CDECL; EXTERNAL ALLEGRO_FONT_LIB_NAME;
Where AL_STR is defined as:
AL_STR = ANSISTRING;
So, afaik that basically means: whatever i throw at that function, be it a ShortString, a PChar or a AnsiString and to an certain extend even unicodestring, (with conversion loss as expressed by the compiler) that the compiler takes care of making sure that whatever is passed it will be pushed to the library as an AnsiString ?
Yes, it is.
I know there's a problem with text encoding. That's the main reason I didn't release a "beta" version. Anyway, I used both ASCII and UTF-8 enconding in ANSISTRING variables with Allegro.pas 5.2.alpha and seems to work. See
my TINS'16 entry, it includes a few UNICODE text (UTF-8) and renders it correctly even using a TTF font.
[Edit]
I was reading the thread again so I'll add something:
As well you're using ANSISTRING (i.e. {H+} or -Sh) you should not have any problem to use texts on Allegro, even using UNICODE encoding (but you may need to configure Allegro). I use this always with UTF-8 strings without any problem.
If you're using SHORTSTRING you need to convert them to ANSISTRING (i.e. use the functions and procedures of the "strutils" unit. Anyway I don't understand why you may want to do so.
If you're doing something weird (i.e. WIDESTRING?) then you can change the AL_STR and AL_STRptr definitions if you need it.
In any case, if you find something interesting, please let me know so I can improve Allegro.pas to make it better.