Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

Font problems


Font problems

Postby jsantos98 » Feb 26, 2007 @ 6:55pm

Hello,

After an entire weekend trying to make my font work, I give up :(.

I've tried to make my own font, use the font included in C:\projects\Edge\media (font_outline.png), and nothing seemed to work!

I'm including the following in the zip file :
1. font_outline.png = File included in C:\projects\Edge\media (Not working)
2. @Arial Unicode MS_12_.bmp : My image with the chars (For some reason, the font tool included is not working with BMPs)
3. @Arial Unicode MS_12_.png : The same as 2. but saved in .png format. This file could be converted by font tool
4. @Arial Unicode MS_12__target.bmp : Image generated by font tool
5. Connect.png : Screenshot of the connect demo project using the Arial Unicode MS_12__target.bmp file (renamed to "Arial_Unicode_MS_12__target.bmp").


Here is the changed code :
Code: Select all









10 
11 
12 
13 
14 
15 
ERESULT ClassMain::OnDisplayInit(EINSTANCE instance, ClassEDisplay *display)
{
    //Load a fixed font file
    if (display->CreateSurface(&font, "Arial_Unicode_MS_12__target.bmp") != E_OK)
    {
        SetErrorMsg("Error loading font");
        return(E_ERROR);
    }
    else
        font.SetColorKey(ECOLOR_FUCHSIA);

    curbuffer = &display->buffer;
    DrawGUI(curbuffer);
    return(E_OK);
}
15 lines; 4 keywds; 0 nums; 41 ops; 2 strs; 1 coms    Syntactic Coloring v0.4 - Dan East  


Can you help me understanding what I am doing wrong?


Many thanks.

Joao
Attachments
media.zip
(15.48 KiB) Downloaded 19 times
jsantos98
pm Member
 
Posts: 22
Joined: Jan 21, 2007 @ 12:27am


Postby edge » Feb 27, 2007 @ 9:54am

Hi Joao,

The bitmap can't be read by the font tool because it is saved as 32-bit. Formats currently supported are: 1, 4, 8 and 24 bits.

The font is not displayed correctly because the quote (") character uses 2 characters in the font. You can fix this by opening your font file and manually draw the white line above this character. Attached is the corrected font.

Play around with the scan tolerance option to fix these issues.
Attachments
font_corrected.zip
Corrected font
(2.1 KiB) Downloaded 16 times
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby jsantos98 » Feb 27, 2007 @ 12:17pm

Sorry, but it didn't solve the problem...

Just to be sure, I used the file you attached

Code: Select all

if (display->CreateSurface(&font, "font_corrected.bmp") != E_OK)
1 lines; 1 keywds; 0 nums; 10 ops; 1 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


But the result was exactly the same. Trying to play with the scan tolerance didn't help much either.

Shouldn't the file "font_outline.png" included in the media folder of the Edge package work? I must be doing something really wrong :(

Sorry for the inconvenience.
Attachments
Connect_Font_Outline.zip
(7.62 KiB) Downloaded 9 times
jsantos98
pm Member
 
Posts: 22
Joined: Jan 21, 2007 @ 12:27am


Postby edge » Feb 27, 2007 @ 2:07pm

Hi Joao,

Please use the following 2 function calls after loading your font:

Code: Select all


font.SetColorKey(ECOLOR_FUCHSIA);
font.BuildTableVwf();
2 lines; 0 keywds; 0 nums; 8 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


I hope this works better.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby jsantos98 » Feb 27, 2007 @ 4:41pm

I was already using the first, but not the second :oops:

It now fixed the problem, however, the caracters are very close to each other. Do you have any solution for that?

Joao
jsantos98
pm Member
 
Posts: 22
Joined: Jan 21, 2007 @ 12:27am


Postby edge » Feb 27, 2007 @ 7:44pm

Hi Joao,

You can use the SetFontPadding functions to increase horizontal or vertical space. This function also takes negative values. More information can be found here:
http://www.edgelib.com/index.php?node=299
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby jsantos98 » Feb 27, 2007 @ 11:21pm

Just like borat would say... Nice :):):):):)

Thanks a lot.
jsantos98
pm Member
 
Posts: 22
Joined: Jan 21, 2007 @ 12:27am


Postby jsantos98 » Feb 27, 2007 @ 11:53pm

I've created a simple tool that creates a bitmap (now it saves in 24bit) with the charset used by Edge. I've created this because I was unable to work with the spacing in paint and my favorite image editing application (Paint.Net) doesn't allow me to define the spacing. Photoshop licenses are out of question because of princing.

If you want, you can make it available to anyone that wants to use it. I'll release the full source code later, as soon as I make some small enhacements like :

* Save the last used settings
* Try to be able to draw the fonts without any cleartype setting
* Try to create the final image file used in edge

Hope you find it useful. It took me an entire hour to make :)
Attachments
EdgeFont.zip
(256.08 KiB) Downloaded 17 times
jsantos98
pm Member
 
Posts: 22
Joined: Jan 21, 2007 @ 12:27am


Postby edge » Feb 28, 2007 @ 2:29pm

Hi Joao,

The font tool works great!

Is it OK if we upload on the edgelib.com website under 'contributed tools'?
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby jsantos98 » Feb 28, 2007 @ 3:29pm

Of course you can. Since the beginning it was my intention to give the tool for anyone who had the same problem ;)

Yesterday, I was able to make the tool to draw the font without any cleartype effect even with the clear type active in XP... it was tricky but fun.

Is there any way I can contact you to finetune the tool with some options without needing to bother everyone who access the forum?

Best regards,

Joao
jsantos98
pm Member
 
Posts: 22
Joined: Jan 21, 2007 @ 12:27am


Postby edge » Feb 28, 2007 @ 4:59pm

jsantos98 wrote:Of course you can. Since the beginning it was my intention to give the tool for anyone who had the same problem ;)

Yesterday, I was able to make the tool to draw the font without any cleartype effect even with the clear type active in XP... it was tricky but fun.

Thanks, please keep us posted about new versions!

jsantos98 wrote:Is there any way I can contact you to finetune the tool with some options without needing to bother everyone who access the forum?

Yes, please contact us directly using "support at edgelib dot com".
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron