Page 1 of 1

Graphics question: Font geometries

Posted: Sun May 21, 2006 2:45 am
by WWWWolf
Good news. Finnish U7BG translation is going well. Today, I wrote a script to dump my text from the database and recompile the usecode. And lo and behold, the first scene works fine. I'm almost done translating all conversations in Trinsic.

Anyway, a small problem: I modified the letters a,o,A,O to ä,ö,Ä,Ö in Personal Paint for Amiga (I don't happen to have any other good paletted pixel art programs around =), cropped in GIMP, and... then what?

Now, a small problem: ExultStudio-exported graphics have following sort of image geometries:

capA.png PNG 13x14 1x11-12-3 DirectClass 942

...and my own pictures have this geometry:

capAE.png PNG 13x14 13x14+0+0 PseudoClass 256c 958

My transparency doesn't work at all, but I suppose that can be handled by converting the picture to DirectClass (24-bit RGB). But what's really weirding me up is the weird geometry spec, 1x11-12-3. As the letters appear in game now, they are in completely wrong position.

Does anyone know how to fix this weird geometry problem in Linux?

Re: Graphics question: Font geometries

Posted: Sun May 21, 2006 6:25 am
by WWWWolf
Actually, I just tried converting paletted files to RGB and surprise surprise, the new letters are still black rectangles. =/

So now I have two problems: How do I *really* get the things stay transparent, and how do I *really* get the thing offsetted in the right place?

Wishing TrueType Was Invented,

Re: Graphics question: Font geometries

Posted: Sun May 21, 2006 11:38 am
by WWWWolf
OK, found out that Yes, Alpha Channels Actually Do Work.

But I have slight problems with the *weird* offset things. Basically, if I open up Studio, open up fonts.vga, pick a letter from the yellow font, then export it to .png and open the .png in GIMP, I get a layer that's been moved a bit to side. Which GIMP can't save, because the layer has an offset. Um, a file that can be opened but not saved because the format doesn't support what... it... has. A little bit of a chicken and egg problem...

ImageMagick seems to call this the "page" geometry, but refuses to create a file with negative offsets.

Okay, can anyone tell me what to hex-edit in my .png files? =)

Re: Graphics question: Font geometries

Posted: Sun May 21, 2006 12:20 pm
by marzo
and open the .png in GIMP, I get a layer that's been moved a bit to side. Which GIMP can't save,
Hmm. At least with the version I am using of GIMP (2.2.11 -- but IIRC, it was the same from 2.2.6 onwards), it says that it can't save but offers the option of saving anyway -- 'ignore' -- and it works.

From what you said, what you have been calling 'geometry' is what Exult Studio calls 'origin', but multiplied by -1. Try double-clicking the character in fonts.vga and setting origin. For example,

Code: Select all

capA.png PNG 13x14 1x11-12-3 DirectClass 942
the -12 and -3 are very likely the numbers of interest; in ES, set 'origin' to 12 and 3, apply and save the file.

Re: Graphics question: Font geometries

Posted: Sun May 21, 2006 2:43 pm
by WWWWolf
Ohhhkayyyy... Weirdly enough, it doesn't appear to save an oFFs chunk to the PNG file no matter if I tell it to, so I guess the offset is needed.

But thank you - the origin thingy seems to work just fine. The ES user interface isn't the best possible; I had no idea it applies to each frame individually. But now that it was set, whee, it works just fine. And here I was already cursing the mysteries of RMagic and all... =)

http://www.iki.fi/wwwwolf/games/ultima/ ... rstrun.jpg

Re: Graphics question: Font geometries

Posted: Sun May 21, 2006 2:46 pm
by WWWWolf
Egh. It really shows it's past three in the morning. What I meant was, GIMP saves the pic but it doesn't work for me, no matter if I check the layer offset option in GIMP's PNG save options.

Re: Graphics question: Font geometries

Posted: Mon May 22, 2006 8:40 am
by drcode
Maybe ES has a bug getting the offset when it reads the PNG file back in. I seem to recall this happening before. In any case, your font looks great.