SRL Archive - Development

New Font, what is it?


Wizzup?

2011-11-22 15:54:25

In a follow up of this post:

From: Wizzup?

Didn't change a thing. Now to use the font.


Most of Simba doesn't need to be changed, what we need to know is what the new font is. Method posted a fonts.zip here: http://villavu.com/forum/showpost.php?p=847997&postcount=24

But it doesn't seem to match the Uptext as far as I could see. (I posted it might we p12_full, but it isn't)

Any suggestions as to what the font is would be very helpful. If we know it, I can update Simba. (Although technically you can just replace the UpChars folder with the new font and it should just work)

The closest match I found was '24'. (in fonts.zip)

YoHoJo

2011-11-22 15:58:47

What are you asking exactly? Based on that picture it looks like you got the OCR working?

Wizzup?

2011-11-22 16:00:59

From: YoHoJo
What are you asking exactly? Based on that picture it looks like you got the OCR working?


The only thing that works (I didn't change anything) is filtering out the background and splitting it into character. (Hooray for my algorithm)

What does not work is deciding what each character is. I don't have the right font set to try it.

Sabzi

2011-11-22 16:03:29

Uhm, that's the ocr working, no? Narrowing down to what we should "compare" to the fonts(which we don't know what it is).
Fix me if I am wrong.

EDIT: semi :ninja:'d

YoHoJo

2011-11-22 16:12:52

Looks like
C:\Users\Aakash\Desktop\fonts\0
and
C:\Users\Aakash\Desktop\fonts\21
looks like C:\Users\Aakash\Desktop\fonts\p12_full too but you said it's not.

Besides that (with my eye) none other seem to be too similar, so try those two.

Coh3n

2011-11-22 16:22:24

From: YoHoJo
Looks like
C:\Users\Aakash\Desktop\fonts\0
and
C:\Users\Aakash\Desktop\fonts\21
looks like C:\Users\Aakash\Desktop\fonts\p12_full too but you said it's not.

Besides that (with my eye) none other seem to be too similar, so try those two.
Wizzup?, can we test those fonts right from Method's folder, or do they have to be altered in some way?

weequ

2011-11-22 16:24:21

21 matches for Chop d
cba checking it full.

Wizzup?

2011-11-22 16:27:26

From: Coh3n
Wizzup?, can we test those fonts right from Method's folder, or do they have to be altered in some way?


Well, I just tried them, but no dice. It doesn't identify a lot. Perhaps some (weird chars) are causing interference. Or Simba doesn't load them properly. Anyway, when I make my own 'C' and add it (from a RS Image), it'll instantly identify the 'C'. Chances are we just need to make our own font again.

E: I just realized. Hehe, Method's font is Black. We need white. And '21' looks good. Let me try.

nickrules

2011-11-22 16:30:46

I've narrowed it down to these three, i think:

20,21,24

I was just looking though - nothing too precise.

E: Nevermind, sorta.

mormonman

2011-11-22 16:31:15

Its looks like 21 to me.

Silent

2011-11-22 17:07:10

From: Wizzup?
Well, I just tried them, but no dice. It doesn't identify a lot. Perhaps some (weird chars) are causing interference. Or Simba doesn't load them properly. Anyway, when I make my own 'C' and add it (from a RS Image), it'll instantly identify the 'C'. Chances are we just need to make our own font again.

E: I just realized. Hehe, Method's font is Black. We need white. And '21' looks good. Let me try.


I batch inverted them all. Not sure if you had already done this. Anyway, here is '21' in all white.

EDIT: see post below.

Wizzup?

2011-11-22 17:10:23

No, I didn't. I'm not very good with photoshop and all; I was hoping someone else would do it. ReadySteadyGo is also giving it a go. By the way, Simba typically reads .bmp's, and transparency does seem to cause some trouble. Things we didn't really run into before… ;)

Silent

2011-11-22 17:13:30

From: Wizzup?
No, I didn't. I'm not very good with photoshop and all; I was hoping someone else would do it. ReadySteadyGo is also giving it a go. By the way, Simba typically reads .bmp's, and transparency does seem to cause some trouble. Things we didn't really run into before… ;)


What level of bitmap do you want? 24 or 32?

Markus

2011-11-22 17:14:47

shouldn't matter as simba reads tbitmaps, 24 and 32 should do.

Shuttleu

2011-11-22 17:18:10

From: Markus
shouldn't matter as simba reads tbitmaps, but 8bit should do.


theoretically 1-bit would do

~shut

Silent

2011-11-22 17:26:32

From: Markus
shouldn't matter as simba reads tbitmaps, 24 and 32 should do.


Alright, here is the 24 bmp version.

ReadySteadyGo

2011-11-22 17:27:24

Wizzup

Shuttleu

2011-11-22 17:29:41

what happened to my post?

its dissapeared!

~shut

YoHoJo

2011-11-22 17:31:55

This message has been deleted by Markus.

he mad?

Shuttleu

2011-11-22 17:32:38

From: YoHoJo
asfd


i see… hmph!

~shut

Silent

2011-11-22 17:33:19

From: Shuttleu
what happened to my post?

its dissapeared!

~shut


The forums ate it? Haha, I don't know what to tell you.. Anyway photoshop only let me do 24 or 32.. So I did 24

Markus

2011-11-22 17:40:26

hey the post is back, sst.

Shuttleu

2011-11-22 17:43:39

your changing them again :duh:

~shut

Markus

2011-11-22 17:45:51

That's my own post.

Shuttleu

2011-11-22 17:48:01

oh yea, sorry

~shut

weequ

2011-11-22 18:46:35

I just noticed that UpText font is not same as ChooseOption font.

Wizzup?

2011-11-22 19:01:41

I've looked at my OCR code and noticed some bugs I had never seen before. Nothing serious, but I'll end up fixing it soon enough. I've also commented most of the code properly now, I had a hard time understanding my old code…
Anyway, there aren't really any show-stopping bugs in Simba itself. But it is a bit picky right now when it comes to spacing of the fonts, so that might explain why initially characters don't work.

( http://git.villavu.com/simba.git/log/?h=ocr-stuff )

Summarizing before I go to bed:

  • The filtering still works (wonders).
  • ChooseOption is not the same font as the text in the top-left corner.
  • We might be able to use the auto-generated (or something) font that Method posted, but we'll need to figure out the exact spacing anyway. (To ``Create'' bitmaps of text we need proper spacing, we use this a lot…)
  • If we cannot figure out how Runescape does spacing or if there simply isn't a pattern, we'll have to create the font manually. (I doubt this)

I've done some work in the ocr-stuff branch in Simba. If you check that out and compile the OCRBench project (in Projects/OCRBench) you'll be able to play with the new font. (Make sure it is in Fonts/NewChars)

Shadows won't yet work in OCRBench + Newfont, so don't bother trying it. :)

I'm going to bed now so I won't compile an OCRBench.exe for you guys, hopefully someone on Windows can do it. It's just as trivial as compiling Simba)

If you don't like the git-branching stuff, just download the latest zip of my ocr-stuff branch on github and compile that.

Also, weequ, can you find out what the ChooseOption font IS then? (See Method's .zip posted earlier)

weequ

2011-11-22 19:50:20

From: Wizzup?
Also, weequ, can you find out what the ChooseOption font IS then? (See Method's .zip posted earlier)

I will go to bed now but I'll try to find out tomorrow.

Edit: p12_full

Edit2: It's same font as chatbox.

ReadySteadyGo

2011-11-22 20:38:33

up text with correct top and bottom borders

Aftermath

2011-11-22 20:47:19

Dumping the fonts for you all, sec.

Edit: here you go.


YoHoJo

2011-11-22 20:56:34

From: ReadySteadyGo
up text with correct top and bottom borders


Would putting this into correct folder make uptext work again?
@Aftermath, wow thanks for the work!
But I think it helps a lot more if each individual letter is made into a file, like ReadySetGo's upload. Each letter must be it's own file with correct amount of pixels around it and stuff. also could you please say which number/folder each set is from?

Aftermath

2011-11-22 20:59:48

From: YoHoJo
Would putting this into correct folder make uptext work again?
@Aftermath, wow thanks for the work!
But I think it helps a lot more if each individual letter is made into a file, like ReadySetGo's upload. Each letter must be it's own file with correct amount of pixels around it and stuff. also could you please say which number/folder each set is from?


I have no idea, I wasn't using your numbered package of fonts. I can at least tell you that one of these is the UpText, and that one of these is the text that can be found on the chat settings buttons at the bottom of the screen. I don't have the time available right now to cut out individual letters, but this can pretty easily be done automatically.

Edit: I just eyeballed it and it seems pretty clear to me that the first set is the UpText, the second set is the chat button text, and the third set is the chat message text.

YoHoJo

2011-11-22 21:01:18

Okay cool, thanks for the help!

Aftermath

2011-11-22 21:08:08

From: YoHoJo
Okay cool, thanks for the help!


Not sure if you posted this before or after I specified which set was which - just making sure you see it:

First set is the UpText; Second set is the chat button text; Third set is the chat message text.

I also dumped this font:


I think this is the chat text that appears overhead.

ReadySteadyGo

2011-11-22 21:08:15

yohojo: no, it's for people who are working on the ocr

YoHoJo

2011-11-22 21:14:52

DAMNIT!
I just got back into scripting a few weeks ago and have 3 projects going right now, WHYYYYYYYYYYYYYYYYYYYYYY!

ReadySteadyGo

2011-11-22 21:19:44

I'm sure it'll be fixed within a day. I'm going to take a look at it, and Wizzup is working on it.

Aftermath

2011-11-22 21:24:10

Actually, looking at the fonts, it would be very easy to cut them out automatically - the left and tops of each letter are aligned, even if the letters have different heights or widths.

The program would work like this: cut out the box for each letter (defining the width to be the distance between two starts of letters, and the same for the height except in the vertical direction), producing several images of equal dimensions. Then, in each image, you can cut off all rows below the bottom-most pixel in the character, and all columns to the right of the right-most pixel in the character. The PNG images for the fonts are black where there is a character, and transparent everywhere else.

Flight

2011-11-22 21:26:10

From: Aftermath 96
Not sure if you posted this before or after I specified which set was which - just making sure you see it:

First set is the UpText; Second set is the chat button text; Third set is the chat message text.

I also dumped this font:


I think this is the chat text that appears overhead.


I can't make a comparison to the second set but that first set isn't accurate. Are you sure you have the right font?

ReadySteadyGo

2011-11-22 21:32:27

From: Aftermath 96
Actually, looking at the fonts, it would be very easy to cut them out automatically - the left and tops of each letter are aligned, even if the letters have different heights or widths.

The program would work like this: cut out the box for each letter (defining the width to be the distance between two starts of letters, and the same for the height except in the vertical direction), producing several images of equal dimensions. Then, in each image, you can cut off all rows below the bottom-most pixel in the character, and all columns to the right of the right-most pixel in the character. The PNG images for the fonts are black where there is a character, and transparent everywhere else.


i've done this, check my previous attachment ^

Coh3n

2011-11-22 21:51:05

ReadySteadyGo's look good, except there's no shadow like in the current bitmaps. How is the shadow made? I could write up a script that draws the shadow on each image if that is the easiest way.

Aftermath

2011-11-22 21:53:06

From: Flight
I can't make a comparison to the second set but that first set isn't accurate. Are you sure you have the right font?


Those were the only fonts in use on the screen at the time, so unless they're drawing the UpText using Java's methods, which is highly unlikely, those are the fonts. I also eyeballed them and they matched; however, it's possible that they have been re-sized in the game.

ReadySteadyGo

2011-11-22 23:05:43

Coh3n

The shadows are not needed. But I added them anyway.

Attached.

Flight

2011-11-22 23:46:28

Was there always random spacing between text characters before? I'm getting it very frequently right now. Here's 3 version of the uptext "Lure" taken in a 30 second time period:


Gonna make it a pain to make bitmaps for multiple letters. I'll have to do it the complicated way. :(

Nava2

2011-11-23 00:02:03

From: Flight
Was there always random spacing between text characters before? I'm getting it very frequently right now. Here's 3 version of the uptext "Lure" taken in a 30 second time period:


Gonna make it a pain to make bitmaps for multiple letters. I'll have to do it the complicated way. :(


Yup, don't worry about that. :)

Coh3n

2011-11-23 02:21:13

Thanks, Ready. Those look good, I'll try to test tomorrow if needed. We also have to be sure to keep the old Uptext font (i.e. the ones currently in the updater) because that font is still used for interface titles (bank screen for sure) and we need it for functions like BankScreen and DepositScreen.

We also need a new font for ChooseOption. I saw Wanted post in this in the other thread: have UpChars, OptionChars, and ScreenChars (Simba's current UpChars) updated for everything to work. I think that will fix everything, but I'm not 100% sure.

E: @ReadySteadyGo: Think you could post a tutorial or something on how you made that font so quickly? Will be nice for future reference. I'm assuming you somehow inverted the black text from OpenGL, then added the shadow somehow (though you said this wasn't necessary).

E2: This one is more for Wizzup? but I'm also interested to know everything that needs changing when the fonts are updated (i.e. does something in Simba need to change). Also, if a new font is added to Simba/Fonts/.

ReadySteadyGo

2011-11-23 02:35:44

I just used photoshop and recorded my actions. The shadow is just the letter duplicated with an offset of (1, 1).

Coh3n

2011-11-23 02:42:35

What do you mean, "recorded my actions"? Like photoshop recorded them or you just did it manually for every image?

Wizzup?

2011-11-23 03:52:44

ReadySteadyGo, the last NewChars you posted look completely empty to me.

Coh3n, the shadow can be added programatically. Simba's OCR even has a function that returns the shadow of a TPA.

ReadySteadyGo, I've picked your old set of characters (posted as SIMBAUPTEXT) and I'm getting some results now, but certainly no accurate ones yet. Simba preferred more fat text. ;)

From: Flight
Was there always random spacing between text characters before? I'm getting it very frequently right now. Here's 3 version of the uptext "Lure" taken in a 30 second time period:


Gonna make it a pain to make bitmaps for multiple letters. I'll have to do it the complicated way. :(


Spacing is not an issue. Or hardly anyway, they used to do this all the time.

Silent

2011-11-23 03:57:21

From: Coh3n
What do you mean, "recorded my actions"? Like photoshop recorded them or you just did it manually for every image?


No, he is talking about batch processing items, but if it isn't one of Photoshop's default functions, you can "record" your own. Have a look at this tutorial. It's actually pretty easy. :)

Wizzup?

2011-11-23 11:50:53

Uploaded new UpChars to Simba's Font updater.

Gu3st...

2011-11-23 15:28:28

Aftermath: I posted a script to cut it into separate characters some months ago. It probably still works, but we already have the fonts so there's really no need to do it again

Coh3n

2011-11-23 15:37:16

Don't we still need the old UpChars and a new font for ChooseOption?

Wizzup?

2011-11-23 15:42:32

From: Coh3n
Don't we still need the old UpChars and a new font for ChooseOption?


We don't need a new font for chooseoption, but we do need the old UpChars back.

Coh3n

2011-11-23 15:44:10

From: Wizzup?
We don't need a new font for chooseoption, but we do need the old UpChars back.
I thought the new ChooseOption and new Uptext fonts were different?

I'm testing now, and uptext is working, but choose option isn't. Could be the first that needs adjusting as well.

Also, what do you want to do about the old uptext. We'll have to rename it, and the functions in SRL that uses it will have to be renamed I suppose.

nickrules

2011-11-23 15:53:19

From: Coh3n
Don't we still need the old UpChars and a new font for ChooseOption?


I haven't checked what you said about the bank, but I'm *pretty sure* (just from looking) that chooseoption uses the same (new) UpChars font.

Coh3n

2011-11-23 15:55:41

From: nickrules
I haven't checked what you said about the bank, but I'm *pretty sure* (just from looking) that chooseoption uses the same (new) UpChars font.
No, they're different. I just caught up on some threads and by the looks of it, the Uptext has a new font, the interface text (BankScreen, GE) uses the old font, and ChooseOption uses ChatChars (which, by the looks of things, is also new).

Wizzup?

2011-11-23 18:25:40

ChooseOption is the same as whatever the character set in the chatbox is - probably SmallChars. Bankscreen etc. need the old UpChars. I'll upload the old UpChars and name them UpCharsEx (as Home suggested), then we can fix the other functions in SRL. (See the list I posted in the other thread)

YoHoJo

2011-11-23 18:28:50

I think chatbox font is also different (durf sorry if this is already known:duh:).
I script I use that uses ClickToTontinue no longer Clicked to Continue.

(Code from ClickContinue);
  FindColors(bTxt, 16711680, MCX1, MCY1, MCX2, MCY2);
FindColors(wTxt, 16777215, MCX1, MCY1, MCX2, MCY2);

SearchTPA := CombineTPA(bTxt, wTxt);
if Length(SearchTPA) < 1 then
Exit;

Search2D := SplitTPAEx(SearchTPA, 20, 2);

TextTPA := LoadTextTPA('here to conti', NPCChars, Height);

So either those two colors changed, or the text changed, or both.

Coh3n

2011-11-23 20:32:01

Scripts will now work with the latest SRL update. Not sure about the ClickToContinue, though.

moparisthebest

2011-12-01 00:42:16

I'm late to the party here, but for future reference imagemagick's 'convert' and 'mogrify' utilities can do just about any manipulations you wanted to do on the font images, usually in a single command. Like change black font to white, remove transparency, change all .png files to .bmp etc etc. I use it all the time. (because I am completely inept at using GIMP :))