PDA

View Full Version : Two questions...


irimiab
09-17-2003, 09:42 AM
1. Is there any way to use another font than the default font of the device (the OEM font) ? If it is possible, can I use it with the IDisplay class's functions for text displaying ?

2. How can I load a picture which isn't on the device, but on a remote server ? The first option would be to use the ftp transfer protocol to download it on the phone and then to load it. The second one would be to download it through the web interface, and then to print it on the screen. But if I want to print an animation, I have to download each frame and to display them in a rapid succession. It would be simplier to download the picture as an animated picture, using the BREW's compressed format, but the image has to be automatically generated on server, and I don't know the format of the .bci file. If you have any sugestions, or another solution, please help me.

Thank you !

Dragon
09-17-2003, 11:49 AM
Using Brew' UI you can not use any font other than the system font of the handset. If you want custom fonts, etc the only way is to write your own UI implementations - whihc I highly recommend to anyone anyway because of the inconsistencies and bugs in the Brew UI across handsets.

radub
09-17-2003, 12:36 PM
I imagine you can also implement your own IFont interface and set it as default using IDISPLAY_SetFont (Brew >=1.2)

irimiab
09-17-2003, 12:51 PM
...I'm affraid that it is a little too complicated for me to write my own font class. :cool: Yet it seems to be an excellent solution, but I definetly need some help. I would appreciate any help you could give me.

About my second problem, the one with the remote images, can you give me an acceptable solution for downloading remote images on the device ? Do I use the IWeb interface ? And if yes, how exactly do I do it ?

ruben
09-17-2003, 01:04 PM
1. It is possible to do that, you need to implement IFont interface on your own, and then you can IDISPLAY_SetFont to that font so that any IDISPLAY_DrawText can use your font implementation. There is a thred in BREW forums, regarding this, I have posted some info.

2. It would be simplier to download the picture as an animated picture, using the BREW's compressed format, but the image has to be automatically generated on server, and I don't know the format of the .bci file.

Yes that's better option. You use IWEB interface to do HTTP download and then playback.

ruben

irimiab
09-17-2003, 01:19 PM
Thank you for your REAL help. About the .bci file though I have some questions, because the animation has to be automatically updated by a special tool running on the server. Thus I need to know the format of the .bci file to be able to write the server-side application. This application has only to take the frames and to pack them into a .bci file. Using the BCI authoring tool from the BREW SDK isn't the solution, because it needs a "human hand" ... or "brain" :)

Thank you a lot ! ;)

ruben
09-17-2003, 01:49 PM
Well, I did some search on BCI file format, looks like Qualcomm did not open this file format.

May be you need to contact Qualcomm guys to get little more details in BCI file format.

ruben

irimiab
09-17-2003, 02:03 PM
I will try to find some docs on .bci...
Your reply has been very helpful !

Thank you !

Mickey Portilla
10-17-2003, 12:22 PM
If you all you need is a drawtext substitute then implementing your own font is quite easy and the code is tiny. The size of the font will be limited by the bitmap and the space the bitmap takes up could be hefty depending on how much of the ascii character set you need.

Here is a simple function I wrote for the number set only, it would be trivial to add alpha. I use a more optimized version for rendering scores.

Where:
IMG_ZERO is the index into your bitmap, BLOC_SIZE is the width of each cell inside your bitmap

#define ASCII_IMG_OFFSET (int8)( '0' - IMG_ZERO )

static void RenderScore( MyApp* me, uint16 score, uint8 x, uint8 y )
{
char buffer[6];
char *c = buffer;

SPRINTF( buffer, "%i", score );

while( *c != '\0' )
{
IDISPLAY_BitBlt( me->applet.m_pIDisplay,
x,
y,
BLOC_SIZE,
BLOC_SIZE,
me->bloxRaw,
( ( *c ) - ASCII_IMG_OFFSET ) * BLOC_SIZE,
0,
AEE_RO_COPY );
x += BLOC_SIZE;
c++;
}
}