android
  #1  
Old 12-10-2011, 03:03 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default ISO-8859-1 Character issues

Hi fellow devs!
(Though, I guess it's just pretty much jbob, bret and me left here...)

Today during a 2h train ride I scripted something which I call "Easy Clock". I encountered an issue though, as I try to use the characters , and . As previously described in this thread those are either not displayed at all, or is displayed as a Kanji sign.

Did anyone ever figure out a fix for this? I couldn't dig anything up by searching the forums.

~Hab
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 12-10-2011, 03:15 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

I will test if the player can handle those characters in 1 easy line of code.

--------------------------------------------------------------------------
The player does in-fact know that character, it has a byte value of 197 so try using text.draw("Font test: " .. string.char(197))

Its the character:

-------------------------------------------------------------------------------------------------------------------

After further testing, the font does not have that character, if you would like to help me, then we can make a custom font engine. I just need a program that will give me the offsets, width, and height of letters. Though it will not support font size.

Last edited by jbob182; 12-10-2011 at 03:21 PM.
Reply With Quote

  #3  
Old 12-10-2011, 04:03 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

I can try to help, but tomorrow evening when I have more time. What exactly is it you'd need help with? I didn't quite follow you with that sparse specification.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #4  
Old 12-10-2011, 04:21 PM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default

the player is UTF-8
and it's happy about what.
for the rest of the world...well...
Reply With Quote

  #5  
Old 12-10-2011, 04:24 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Sorry about that, I need a file like this:

times new roman.font

char(157);offset(5,3);rect(157,93,20,20);advance(7 );image("numbers.png");
ect


char: the byte number ( use string.byte("some character") to get the number) of a character
offset: the number of pixel you have to add to the glyph coordinates so that the glyph properly aligns with the rest of the characters
(empty space isn't present in the glyphs, thus offset is needed)
rect: is the position of the glyph in the image
advance: the number of pixel to move forward for the next char
image: the image which the character is located on, there will have to be several since there is a height limit of images, or we can use one long image with only one row of characters


I will also need a transparent image of all of the characters that the .font file will refer to.

If you would like some help, refer to the original Pingus, they use a similar setup in fonts ( I just copied most of the explanation on the line with a few edits from a conversation about fonts with one of the original developers of Pingus)


Here is a link to a newer version of Pingus with source, (they state somewhere what tool they use for the font):

http://code.google.com/p/pingus/downloads/list


Last edited by jbob182; 12-10-2011 at 04:30 PM.
Reply With Quote

  #6  
Old 12-10-2011, 06:03 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Here is the proper link:

http://code.google.com/p/pingus/sour...ac240d65650231


view the readme to get a link to the tools used.
Reply With Quote

  #7  
Old 12-10-2011, 06:29 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Hm okay.. I think I get it, only the offset(5,3) I'm not quite grasping what it represents. Problem is I had intended to make this translated into as many languages as I could, meaning lots of custom font things. And also needing to have them at different size, since you said that engine of yours didn't support font sizes.

Sorry if I seem slow to understand right now, but I got some personal issues, which are also the reason for me needing to develop this app, so my mind is kind of elsewhere at the moment.

EDIT: Also, I can't open the .png's to get a look on what they look like. Windows photo viewer claim corrupt files, and photoshop also complained about something... And YIKES, that's a lot of rows in the .font file... That'd take some time to type up.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^

Last edited by Habhome; 12-10-2011 at 06:35 PM.
Reply With Quote

  #8  
Old 12-10-2011, 07:21 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Hmm, ok. I can simplify all of this for you, all i need is a picture of those characters in the player's font, and they can even be in a row: ie: fonts 1-25 of in one image.
If you can do that, then the lua code should not take to long.

As for the offset, let me explain. When you type two ie: , I need to know how far away to space them apart to represent a space between characters. So it should really be offset(3) for 3 pixels.


Also, sorry if my thoughts seemed mixed up and misleading, I am concentrating mostly on Pingus. The lua code is so close to completion, and only has a few things left. As you can imagine, this is quite exciting; finishing a project that I started over a year ago, and it was thought to be impossible, even by myself at times.
Reply With Quote

  #9  
Old 12-11-2011, 09:42 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by jbob182 View Post
Hmm, ok. I can simplify all of this for you, all i need is a picture of those characters in the player's font, and they can even be in a row: ie: fonts 1-25 of in one image.
If you can do that, then the lua code should not take to long.

As for the offset, let me explain. When you type two ie: , I need to know how far away to space them apart to represent a space between characters. So it should really be offset(3) for 3 pixels.


Also, sorry if my thoughts seemed mixed up and misleading, I am concentrating mostly on Pingus. The lua code is so close to completion, and only has a few things left. As you can imagine, this is quite exciting; finishing a project that I started over a year ago, and it was thought to be impossible, even by myself at times.
Hm ok. So you mean the .png should look like:



But placed so that they are directly adjacent? And the rectangle in the .font file should specify exactly a square around the corresponding character?

X = ""-Bytecode
char(X);offset(3);rect(0,15,10,10);advance(10);ima ge("font.png"); --Size 10 ""
char(X);offset(3);rect(10,10,15,15);advance(15);im age("font.png"); --Size 15 ""

I'm not entirely sure how that "advance" one specifies either. If you have a char in the specified rect, then why do you need to know how far to the next one? Doesn't the rect already specify the character's width?

And do you happen to know which font is used by default? Or do I have to try and match them up? From memory I believe it looks like Arial though...
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #10  
Old 12-11-2011, 10:01 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

I am not sure which font it is, so I would suggest:
http://www.identifont.com/

As for the .font file, just include the byte code, the rect value, and a new value called size ie: size(12) referring to the font size.

And that is the correct layout for the png you provided.
Reply With Quote

Reply

Tags
character, character set, font, issue, problem, set, trouble

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 03:46 AM.