Jump to content
Tuts 4 You
Sign in to follow this  
human

Font Problem

Recommended Posts

human

does someone has a clue wtf is goin on.

i try to use terminal font inside edit box.

font=CreateFont(-8,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,0,0,0,0,"Terminal");

hEdit=GetDlgItem(hWnd,MINT_EDIT);

SendMessage(hEdit,WM_SETFONT,(WPARAM)font,1);

well it sets font to terminal but some of chars are incorrect, but when i run ollydbg in background or run it in olly then somehow magical all chars are like ansi in dos.

and question is what do i have to set more to get same effect without olly, i could do it all as bitmap but im too lazy to recode asm back to c++

Share this post


Link to post
Share on other sites
Ufo-Pu55y
font=CreateFont(-8,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,0,0,0,0,"Terminal");
I'm not sure about your problem, but lately I had mine with 'Termnal'... it's bitchy.

It shouldn't be set to DEFAULT_CHARSET, but to ANSI_CHARSET !

If you set it to DEFAULT_CHARSET.. an english OS won't see the special chars or something.

I set it to ANSI_CHARSET and everything went fine for everybody.

Windows NT/2000/XP: DEFAULT_CHARSET is set to a value based on the current system locale. For example, when the system locale is English (United States), it is set as ANSI_CHARSET.

Share this post


Link to post
Share on other sites
human

i already tried it and it doesnt help, also case was its ok with olly in background

Share this post


Link to post
Share on other sites
Angel-55

i used terminal font in my NFO Viewer coded in masm

the DEFAULT_CHARSET works fine with all chars i have no problems with it......

i used FW_THIN with 12,6 font height and width and default_charset of course these settings work fine here and i don't have any problems with them all char appeare correctly in the edit box nothing special just like olly :)

INVOKE CreateFont,12,6,0,0,FW_THIN,0,0,0,DEFAULT_CHARSET,0,0,0,0,SADD"Terminal"
MOV hFont,EAXINVOKE GetDlgItem,hWnd,ID_EDIT
MOV hEdit,EAXINVOKE SendMessage,hEdit,WM_SETFONT,hFont,1

MASM..... same as your C code no differences except the settings try them and see if it works :)

your code looks fine to me and i didn't notice anything in it so it should be a setting problem !!

Share this post


Link to post
Share on other sites
human

well that doesnt help

check my newest production

due im lazy i created nfogen.

as exercise in c++ instead of 99.99999% always asm:P

it can paste text into nfo fields from mtp template.

that is:

Text as field name

x start from 0

y start from 0

x end from 0

y end from 0

0 or 1 or 2 as left,center,right align text

so field to fill is a squere or like windows rect

in field text is always y aligned so if field is 7 lines and text is 3 lines then you will have 2 lines empty up and down.

also it splits text to fit field, so if there is space with another word and it doesnt fit field lenght then its moved to next line, if there is manual CRLF then also it autosplits.

whats left is autofields, like Date when it will find it it will auto fill field with current date, also expanding line, when text field is too short for pasted text then it will expand nfo with line you choose to paste with text so nfo will not look odd.

this will require to add next line to template

now i dont know somehow now it shows without olly all correctly.

maybe its another app fault:(

nfogen.rar

Edited by human (see edit history)

Share this post


Link to post
Share on other sites
Ufo-Pu55y
i used terminal font in my NFO Viewer coded in masm

the DEFAULT_CHARSET works fine with all chars i have no problems with it......

Hehe... so I didn't have any probs, when I started with DEFAULT_CHARSET.

If your app is only for yourself, then it's ok,

but just let it test by users with english OS... :^

And they will see sh!t like this:

http://www.tuts4you.com/forum/index.php?s=...ost&p=62263

@human:

I tried to run your nfogen, but I couldn't. It says something about wrong app configuration ?!

My Olly can't load it, too. XPSP2 here...

Share this post


Link to post
Share on other sites
human

do you have newest vcredistr, aka mfc80.dll msvcp80.dll and others, due its vs2005 compiled

Share this post


Link to post
Share on other sites
Ufo-Pu55y
do you have newest vcredistr, aka mfc80.dll msvcp80.dll and others, due its vs2005 compiled
I'm also with vs2005.

Erm.. mfc80.dll and similar are v8.0.50727.42.

Dunno, if this is the newest. But not older than 2005.. that's for sure.

Share this post


Link to post
Share on other sites
human

well mine is .762 not .42 also i have vs2005 sp1

Share this post


Link to post
Share on other sites
Ufo-Pu55y
well mine is .762 not .42 also i have vs2005 sp1
Yeah, I missed it - whoa.. installation took 1/2 hour :X

Anyway, runs fine now.. nice work ! :D

Share this post


Link to post
Share on other sites
Angel-55

UFO :P

3 guys with english OS's checked my file and nothing wen't wrong before that i had a little color problem that shown when ther NFO Viewer ran for too much time all edges disappear and the colors turn down to gray........for that i had to set color using a different method now it works fine it has a small size without a chip but i can't find a packer to shrink it to the MAX possibility avilable ;)

if you have any idea about that then can you help me bro' and thanks :D

Note: left display is the right thing for NFO display and i sized the dialog to fit the nfo ;)

so i have no problem with that issue.........if you wanna use the centered display you must size the edit box to be

a bit bigger than the NFO itself caused the edit box gets a few empty fields on the sides "left,right" to be sure it's centered ,in that case it shows correctly but if it fits the NFO width then it'll become incorrect !!

the NFO Viewer hasn't been published yet so it's private

but i'll post it in this forum cause i trust all the guys here ;)

Size: 42.3 Kb :(

NFO_Viewer.rar

Share this post


Link to post
Share on other sites
Ufo-Pu55y

@ Angel-55:

Ofc it requested a foff.nfo file, which I didn't have.

So I took the snd.nfo. The foff.nfo must be much shorter,

because the snd one was cut in the middle.

And that made it also crash, when pressing the '?' button.

I guess the code was overwritten by the too large snd.nfo file.

Then I cut the snd.nfo in the middle and ran it again.

Now it worked fine. Since it seems to be only used for

smaller sized .nfo files, this isn't really a bug ?

Regarding the size.. I couldn't see the resources,

but I guess the .gif takes a lot ?

I could always do an amazing shrinking job

by manually working on the gifs in Photoshop,

without loosing much quality... dunno

Greets

Share this post


Link to post
Share on other sites
Angel-55

not realy :) i was the one who limited the file size to be sure none other files will be used XD

sorry i forgot to add the NFO file but i have one form a release i attached :)

it's not a good thing to accept all files right :P in case of anyone tries to rip it but still i know my coding and it's easy to recognize so i don't think anyone would get away with this...........lol

i hope it works fine on your machine too !!

@Edit:

yes the GIF has a good size and i'am a PS noob unlike you guys

it's not much though cause with the GIF and when unpacked the file is 52.2 Kb so it's not much of a compression i got with WinUPack :( damit !!

greetz

FOFF.rar

Edited by Angel-55 (see edit history)

Share this post


Link to post
Share on other sites
human

well i intend to rls nfogen with src when i finish Date autoadd and expanding line, still with ollydbg i get correct font, even under vista. for some time it was even working without olly after reboot same problem. to this nfo viewer i can see also it doesnt show correctly nfo.

well all i can say problem is that it doesnt see all fonts, when in notepad2 i press alt+F12 then it shows windows dialog with fonts there on terminal font you can choose 5,6,9,12,14 under size there is small font preview, and it only has a 2 font sizes, you choose 5,6,9,12 and its small, you choose 14 its big, now when again i run olly and do same ****, i have 5 different sizes for terminal font. 5 then 6 is bigger, 9 again,12 again, and 14 biggest. so now explain that magic because i giveup

Edited by human (see edit history)

Share this post


Link to post
Share on other sites
Angel-55

it's weired that you say so human :P

i dunno why..........where is the incorrect stuff ?? the nfo is shown just as it should be like in DAMN NFO Viewer it's really clear here......... a snapshot would be good if you see weired things in it :)

as for your problem you say you rebooted and tried the file again and now it turnned back to the same old problem ?? it's weired :/ honestly why did it show correctly at first if it changed after reboot........maybe you changed something in it ??

you can choose any size with that dummy API it'll work but the problem remains that the font doesn't function correctly with some sizes so you must use a size that works for it else you won't get the rigght chars or even the text........terminal isn't found in the system fonts anymore and that sucks :( you could have included the font as a resource if youi had it on you system and then work with it it wsouldn't be a problem but i don't have it ;)

Edited by Angel-55 (see edit history)

Share this post


Link to post
Share on other sites
human

i havent changed anything same exe, rebooted to vista and same crap, rebooted to xp and same crap, here is your nfoviewer screenshot, look at those like O and T

post-12672-1186314587_thumb.png

Share this post


Link to post
Share on other sites
Angel-55

weired the NFO Viewer was tested on 3 different machines except both of mine too

and this problem never shows you can see that in this screenshot human :)

i use Windows XP SP2 and never tested on vista cause i hate it :)

maybe other guys can test and return results it might be an OS problem but who knows !!

post-23007-1186315307_thumb.jpg

Edited by Angel-55 (see edit history)

Share this post


Link to post
Share on other sites
Killboy

Dunno if that helps, but I guess you must have missed something.

In Textpad you can associate certain file types with special fonts etc., when opening .nfos it's supposed to show text with Terminal font and so on.

In contrast to Damn NFO Viewer (I hate writing that) it also shows these weird

Share this post


Link to post
Share on other sites
Angel-55

actually Killboy i'am bored :P lol

still i'am not in the mood to debug that bitch..........

i have another snapshot from DAMN NFO Viewer and it's ok too ?!!

i must say i dunno what's going on here but something is really messy here

and we need to know what's wrong exactly with it even ANSII_CHARSET as UFO said didn't work

with human why ?? i have no idea about it so we must find a solution before it used to work correctly

so it might be an M$ **** again if any of you updated latly his O Sthen try checking it again i don't update never ever M$ suck and ****s my CORE files while update..........just like the xp manifest in MASM with Ziggy same issue that happned because of there damn updates :D

post-23007-1186319577_thumb.jpg

Share this post


Link to post
Share on other sites
Ufo-Pu55y

No need to compare with DAMN NFO viewer, since it

only uses its own included bitmap fonts... :^

Here's my screenshot:

post-20979-1186329664_thumb.png

Share this post


Link to post
Share on other sites
human

well but question is why sometimes it shows correctly, what makes that condition.

Share this post


Link to post
Share on other sites
Ufo-Pu55y

@human:

Does notepad++ correctly show NFOs for you ?

http://notepad-plus.sourceforge.net/de/site.htm

For me it shows the few special characters without any

problem. I mean the characters, which are wrong with Angel-55's

nfo viewer on my box.

But therefor there are a few other characters wrong,

which are correct in Angel-55's nfo viewer... :X

I thought that notepad++ would be the key to our probs with Terminal font,

because it's open source. And it doesn't use bitmap fonts for

showing NFOs. I just took a look into the source,

but I couldn't find a sh!t... real sh!tload of files... too complex :X

I even tried to debug notepad++ and brake on CreateFont or something.

NOTHING ! It simply shows the nfo and that's it... :/

Share this post


Link to post
Share on other sites
Killboy

Me again :>

I just tested all the apps attached in here...

a) nfogen crashes without the .mtp file, msgbox would be better I guess

B) you could add drag n' drop support (not more than 4 lines of code)

c) all the opened nfos where shown with crap chars (with and w/o Olly running in the background)

d) the viewer posted by Angel doesn't show correct chars either :x

Share this post


Link to post
Share on other sites
Ufo-Pu55y

post-20979-1186333697_thumb.png

I mean this chars. human's, angel-55's and my nfo viewer show 'em like that.

But notepad++ shows 'em correctly...

EDIT/

Aargh.. just realized that notepad++ comes with LINEDRAW.TTF,

which is used for showing nfos... :---/

Share this post


Link to post
Share on other sites
Angel-55

Incorrect in yours and correct in mine :X WTH is going on here :/

pretty weired lol.........here and on the testers machines it's shown correctly but on your three machines it doesn't

human said that his didn't work neither after reboot...........there must be something wrong in here it can't be that on some machines it shows correctly without the wrong chars O_o

i'am thinking of sharing sources to get a multi nfo viewer that shows them correctly form all the sources :P haha

i tried the option ANSI_CHARSET as UFO suggeted but it doesn't even show it as an nfo just a bunch of chars around nothing special in it not order or something so it's useless............but OEM_CHARSET shows them here fine too just the the options DEFAULT_CHARSET so i dunno if this one works fine on other systems........

this attachment uses OEM_CHARSET and it shows the correct chars too as i see :/

NFO_Viewer.rar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×